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



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: |

To that end, when files are actively downloading, a new icon now appears in the Search bar that users can tap to view and manage downloads, pause and resume all downloads or just individual items, and select one to increase its priority or view it in a chat. The Dow Jones Industrial Average fell 230 points, or 0.7%. Meanwhile, the S&P 500 and the Nasdaq Composite dropped 1.3% and 2.2%, respectively. All three indexes began the day with gains before selling off. This ability to mix the public and the private, as well as the ability to use bots to engage with users has proved to be problematic. In early 2021, a database selling phone numbers pulled from Facebook was selling numbers for $20 per lookup. Similarly, security researchers found a network of deepfake bots on the platform that were generating images of people submitted by users to create non-consensual imagery, some of which involved children. In December 2021, Sebi officials had conducted a search and seizure operation at the premises of certain persons carrying out similar manipulative activities through Telegram channels. 'Wild West'
from ua


Telegram Game journalist Tycoon
FROM American