Skip to content

Instantly share code, notes, and snippets.

@alangrainger
alangrainger / trip-calendar.js
Last active February 5, 2023 05:55
Obsidian event calendar
/*
I created this Dataview script to turn a list of events into a nice visual calendar representation.
Alternatively you can provide YAML start-date and end-date field names, and the script will find all
matching notes and display those as events.
Step 1:
Add a list to a note in this format:
- 2022-09-05 to 2022-09-16 | Conference in Houston
- 2022-10-04 to 2022-10-11 | [[Holiday in Bali]] | (this one is a link to a page)
@johanfriis
johanfriis / view.js
Last active March 5, 2025 14:18
A DataView View that implements almost the same rendering for lists that we have for tasks, and adds pagination. This version has tasks removed from output to drastically simplify the view.
if (!input?.query) {
dv.paragraph("You must pass a `query` to the view");
return;
}
const pagesWithLists = await dv.tryQuery(input.query);
const HEADER_SIZE = input?.headerSize ?? 2;
/**
@eoureo
eoureo / Insert_Callout.md.js
Created April 16, 2023 04:09
Obsidian Templater Template - Insert Callout. 옵시디언 템플레이터(Templater) - Callout 넣기 템플릿
<%_*
const run_type = 2;
/*
run_type = 0; // callout 형식만 대화상자에서 고른 다음 바로 노트에서 글 작성
run_type = 1; // 폴딩과 제목, 내용을 따로따로 입력 (키보드만으로 내용을 입력할 수 있음.)
run_type = 2; // 폴딩과 제목, 내용을 하나의 대화 상자에서 입력 (callout 모양 그대로 보며 내용을 입력할 수 있음)
* 되도록 obsidian 자체의 스타일로 callout을 보여주도록 함.
* callout 안의 callout을 사용할 수 있음 (callout 중첩)