liu-qilong / obsidian-setup

My customized Obsidian Dataview templates, including TagLens, DailyLens, and PaperThread
4 stars 0 forks source link

My Obsidian setup

P.S. For readability, click the menu icon on the top-right corner to see the table of contents.

Introduction

I use Obsidian as my major note-taking tool. This repository stores my customized Dataview templates.

PaperThread

A light-weight literature management tool that visualizes papers' relations as threads:

img

The mainstream literature management software, e.g. Zotero, Mendeley, and JabRef, typically adopts a folder-based organization paradigm. However, when a paper is added to a large folder, it's hard to recall the relationships between papers. It could be a problem to find a specific paper later since their titles usually don't reflect their core idea in a sufficiently compact way.

What if we can see the trending & branching of a research topic at a glance? That's the major motivation for me to develop PapetThread, a lightweight literature management tool based on Obsidian.

TagLens

Show related notes in different types:

img

DailyLens

Benchmarks my time-spending, task completions, and other activities:

img

Get started

Open the example vault

Download and install Obsidian. Download the example vault from the Releases of this repository. It should be a folder obsidian-setup-example. Open [Obsidian], click Open folder as vault, and select the downloaded folder. Click Trust author and enable plugins.

img

P.S. If you don't see Open folder as vault, follow the instructions on Create vault from an existing folder.

TagLens

Create container note

Right-click any container/* folder and click New note to create a container note. Then you need to edit the aliases property as a tag name associated with this note. For example, you can create a new topic note under the container/topic folder titled AI and change its aliases property as Topic/AI.

P.S. Multi-layer tag name is supported. e.g. Topic/AI/CNN/R-CNN.

P.S. You can see a new tag Topic/AI appears in the tag plane in the right sidebar. Option + click on it will open the AI note.

img

Tag a note to a container note

Here comes the magic. Adding a new tag to a note's tags fields will make this note appear in the tag's note. For example, create a note under the content/note with titled What is AI?. You can add the tag Topic/AI to it, and then it will appear on the AI container note page.

img

Backlink a note to a container note

Another way to show a note on the container note page is backlinks. For example, create a note in content/book titled AI Book and add a line This book is about [[AI]].. This note will appear on the AI container note page.

img

P.S. If the AI page doesn't change, press cmd+E (on macOS) or ctrl + E (on Windows) twice to refresh.

DailyLens

Diary page

Open the right sidebar of Obsidian and click the calendar icon to shift to the calendar view. Click on a date. Confirm to create a diary page for this day by clicking the Create button. Then you will see the notes created this day automatically appear:

img

Daily thoughts

Under the Thoughts section, add bullet points to write brief thoughts. Tag it with a tag, e.g. Topic/AI, which will make it appears on that container page:

img

Tasks completed

On any note, such as the AI topic, page, you can add a task like this:

- [ ] Read about AI

You can add a completion date to this task to make it appear in the Completed section of the diary pages.

- [x] Read about AI
      [complete::2024-07-22]

img

P.S. It will also be shown automatically on the associated weekly/quarterly pages.

Time spent

You may have noticed that the diary note has several property fields in the format of time_*. They are used to log time statistics, which are then used to generate the time spend chart:

img

You can feel free to change the name and the number of these fields as long as they are in the format of time_*. You may edit the diary page format obsidian-setup/templates/diary page.md to make such changes reusable.

Weekly page

Click the week number on the calendar view and confirm to create a week page for this week by clicking the Create button. You will see all notes, thoughts, and completed tasks, as well as the time statistics during this week appears.

Quarter page

In the folder pane, right-click the review/quarter folder and click New note to create a quarter note. Title it as something like 2024-Q3 and fill in the year and quarter fields. Then you will see all notes, thoughts, completed tasks, as well as the time statistics during this quarter appear.

PaperThread

Thread page

Right-click on the container/thread folder and click New note to create a thread note. Then you need to edit the aliases property as a tag name associated with this note. For example, you can create a new note titled AI papers and change its aliases property to Thread/AI.

P.S. Multi-layer tag name is supported. e.g. Topic/AI/CNN/R-CNN.

P.S. You can see a new tag Topic/AI appears in the tag plane in the right sidebar. Option + click on it will open the AI note.

Paper page

Get metadata

Open material/doi2bib, you can gather the metadata of a paper from its DOI:

img

P.S. If it fails to gather meta online, you can input the bibtex and cites (citation number) to the property fields manually.

P.S. If nothing is shown, you can press cmd + P (on macOS) or ctrl + P (on Windows) to raise the command palette and insert Reload without saving.

Create a paper page

Right-click on the content/paper folder and click New note to create a paper note. Change the title of this note as the Generated entry ID, and then copy The YAML format entry information and insert them to the end of the property fields.

---
aliases: 
tags:
  - Type/Paper
  - Thread/AI
date: 2024-07-26
update: 
bib_link: 
bib_badge: 
bib_note: 
bib_remark: 
bib_pdf: 
bib_cites: 0
bib_type: article
bib_id: ZhangLiYing2024
bib_title: Prediction of Dynamic Plantar Pressure From Insole Intervention for Diabetic Patients Based on Patch-Based Multilayer Perceptron With Localization Embedding
bib_volume: 12
bib_issn: 2169-3536
bib_url: http://dx.doi.org/10.1109/ACCESS.2024.3425907
bib_doi: 10.1109/access.2024.3425907
bib_journal: IEEE Access
bib_publisher: Institute of Electrical and Electronics Engineers (IEEE)
bib_author: Zhang, Li-Ying and Ma, Ze-Qi and Yick, Kit-Lun and Li, Pui-Ling and Yip, Joanne and Ng, Sun-Pui and Liu, Qi-Long
bib_year: 2024
bib_pages: 100355–100365
---

P.S. It's recommended to open Settings > Editor and set the Default editing mode as source mode so that you can insert the properties more easily.

Add badge, note, and remark

The badge, note, and remark are shown on the paper card (in a tiny scrollable window). Badges are little icons illustrating the status/properties of this paper:

code icon
skimmed 🪫
read 🔋
seminal 💡
important 📌
work-well 👍
widely-used 🔧
insightful 🧠

_P.S. The code-icon pairs can be edited by revising the bib_badge2str() function in obsidian-setup/lens/paperthread.js_.

Note and remark are used to present brief summary of the major takeaways/innovations of the paper.

bib_badge:
  - read
  - insightful
bib_note: 
  - footprint to pressure pred
  - simple mlp outperforms cnn
bib_remark: 
  - patching to increase data samples

img

P.S. The same paper card appears in the thread pages.

P.S. To the right of the badge icons is the citation number of the paper.

Add alias

You can add alias to the paper note to make it more accessible. For example, I usually add the model name as the alias to the machine learning papers.

Tag paper to a thread

To tag a paper to a thread, just add the thread note's tag to the paper note.

You can even add this paper to a sub thread by using a multi-layer tag, e.g. the tag Thread/AI/Application/Medical is shown as a sub-thread under Thread/AI in the thread page:

img

P.S. By default, the threads branches from top to bottom. However, a subthread name in the format pre-* will make the branching direction from bottom to top. e.g. Thread/AI/pre-Tool.

Link paper to a paper

You can link a paper to a paper. For example, RumelhartDavid1986 is used in the ZhangLiying2024 paper. So in ZhangLiying2024, I edit the bib_link field as:

bib_link:
  - "[[RumelhartDavid1986#MLP]]"

The linked paper will be shown in both RumelhartDavid1986 and ZhangLiying2024:

img

Setup from scratch

If you don't want to use the example vault, you can set it up from scratch following these steps.

Create an Obsidian vault

Download and install Obsidian. Create a new vault.

Clone this repository:

git clone https://github.com/liu-qilong/obsidian-setup.git

P.S. Or click the Code button on this repository and click the Download ZIP option to download the files.

It should be a folder named obsidian-setup. Place this folder to directly under your vault folder.

Folder structure

Create a container, a content, and a journal folder, then:

Theme

My customized templates and scripts work best with the Things theme. To use it, open Settings > Appearance > Themes, click Managem and search for Things. Click into it and click Install and use.

Plugins

Open Settings > Community plugins and then click Turn on community plugins. Click Browse and search for these plugins and install them. Remember to click Enable after installing them:

Again, *remember to click Enable after installing each of these plugins.**

Dataview and CustomJS settings

Open Settings > Dataview, and turn on Enable JavaScript queries. Change the Refresh interval to 25000.

Open Settings > CustomJS, and fill Folder with obsidian-setup/lens.

Templater settings

Open Settings > Templater, turn on Trigger Templater on new file creation. Then scroll down to the Folder Templates section, add these folder - template pairs one by one:

Folder Template
container/institute obsidian-setup/templates/institute page.md
container/people obsidian-setup/templates/people page.md
container/project obsidian-setup/templates/project page.md
container/thread obsidian-setup/templates/thread page.md
container/topic obsidian-setup/templates/topic page.md
content/book obsidian-setup/templates/book page.md
content/course obsidian-setup/templates/course page.md
content/note obsidian-setup/templates/note page.md
content/paper obsidian-setup/templates/paper page.md
journal/quarter obsidian-setup/templates/quarter page.md

Whenever you right-click a folder and click New note, it will create a new note with the corresponding template.

Daily notes and Calendar settings

Open Settings > Daily notes:

P.S. If you can't find Settings > Daily notes, open Settings > Core plugins and confirm that the Daily notes core plugin is enabled.

Open Settings > Calendar: