Telegram Group & Telegram Channel
Я постоянно пишу, что использую Obsidian, и меня потом спрашивают про плагины и прочее. Возможно и правда стоит отдельную рубрику под это дело завести.

В этот раз поговорим про Dataview. Штукенция позволяет писать SQL-like запросы и потом формировать отображение.

Простейший пример: вывести список файлов с тегом diary.
TABLE 
FROM #diary

Оно отобразит файлы с возможностью перейти в него.

Но для меня фишечка в том, что можно запросы писать на JavaScript! Реальный пример: мне нужно автоматически формировать список заголовков из всех дневников.
```dataviewjs

const resultItems = [];
const diaries = app.vault.getFiles()
.filter(file => file.parent.path === 'Diary' && file.path.includes('.md') && file.name !== 'Diaries.md');

for (let i = 0; i < diaries.length; ++i) {
const d = await dv.io.load(diaries[i].path);
const path = diaries[i].path.substring(0, diaries[i].path.indexOf('.'));

const titles = d.split('\n').filter(line => line.contains('# '));
resultItems.push(...titles.map(t => dv.fileLink(path + t, false, t.substring(2))));
}

dv.list(resultItems);
```

Этот код автоматически в режиме чтения будет формировать актуальный список того, что я делал по дням с возможность перейти или посмотреть превью при наведении на ссылку.

#Obsidian #documentation
🤯12👍7🔥6



group-telegram.com/game_journalist_tycoon/27
Create:
Last Update:

Я постоянно пишу, что использую Obsidian, и меня потом спрашивают про плагины и прочее. Возможно и правда стоит отдельную рубрику под это дело завести.

В этот раз поговорим про Dataview. Штукенция позволяет писать SQL-like запросы и потом формировать отображение.

Простейший пример: вывести список файлов с тегом diary.

TABLE 
FROM #diary

Оно отобразит файлы с возможностью перейти в него.

Но для меня фишечка в том, что можно запросы писать на JavaScript! Реальный пример: мне нужно автоматически формировать список заголовков из всех дневников.
```dataviewjs

const resultItems = [];
const diaries = app.vault.getFiles()
.filter(file => file.parent.path === 'Diary' && file.path.includes('.md') && file.name !== 'Diaries.md');

for (let i = 0; i < diaries.length; ++i) {
const d = await dv.io.load(diaries[i].path);
const path = diaries[i].path.substring(0, diaries[i].path.indexOf('.'));

const titles = d.split('\n').filter(line => line.contains('# '));
resultItems.push(...titles.map(t => dv.fileLink(path + t, false, t.substring(2))));
}

dv.list(resultItems);
```

Этот код автоматически в режиме чтения будет формировать актуальный список того, что я делал по дням с возможность перейти или посмотреть превью при наведении на ссылку.

#Obsidian #documentation

BY Game journalist Tycoon




Share with your friend now:
group-telegram.com/game_journalist_tycoon/27

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Messages are not fully encrypted by default. That means the company could, in theory, access the content of the messages, or be forced to hand over the data at the request of a government. Additionally, investors are often instructed to deposit monies into personal bank accounts of individuals who claim to represent a legitimate entity, and/or into an unrelated corporate account. To lend credence and to lure unsuspecting victims, perpetrators usually claim that their entity and/or the investment schemes are approved by financial authorities. "The argument from Telegram is, 'You should trust us because we tell you that we're trustworthy,'" Maréchal said. "It's really in the eye of the beholder whether that's something you want to buy into." READ MORE On February 27th, Durov posted that Channels were becoming a source of unverified information and that the company lacks the ability to check on their veracity. He urged users to be mistrustful of the things shared on Channels, and initially threatened to block the feature in the countries involved for the length of the war, saying that he didn’t want Telegram to be used to aggravate conflict or incite ethnic hatred. He did, however, walk back this plan when it became clear that they had also become a vital communications tool for Ukrainian officials and citizens to help coordinate their resistance and evacuations.
from us


Telegram Game journalist Tycoon
FROM American