Juha-Matti Santala
Community Builder. Dreamer. Adventurer.

Obsidian

Since October 2023, I've used Obsidian as my main note-taking tool. I want to collect my customizations and workflows on this document to keep track of them myself and hopefully help others.

Community Plugins

The plugin system in Obsidian is great. While I haven't yet made any of my own (knowing my tendency to build plugins and extensions for everything, that day will soon come), here's the most valuable ones I use daily.

Visual enhancements

No strikethrough for checked items

To make checklists more readable after completing items, this CSS snippet removes the strikethrough. Store it in [YOUR_VAULT]/.obsidian/snippets/checkboxes.css and enable it from Settings -> Appearance -> CSS Snippets.

/* These two affect preview mode */
.markdown-preview-view ul > li.task-list-item.is-checked {
  text-decoration: none;
  color: var(--text-normal);
}

.markdown-preview-view ol > li.task-list-item.is-checked {
  text-decoration: none;
  color: var(--text-normal);
}

/* This affects edit mode */
.markdown-source-view.mod-cm6
  .HyperMD-task-line[data-task]:not([data-task=" "]) {
  text-decoration: none;
  color: var(--text-normal);
}

Unresolved links showed with dashed underline

This makes [[internal links]] in edit mode show up in dashed underline to make it easier to notice which items have notes and which don't (or which are mistyped).

Store it in [YOUR_VAULT]/.obsidian/snippets/links.css and enable it from Settings -> Appearance -> CSS Snippets.

.markdown-source-view.mod-cm6 .is-unresolved {
  text-decoration-style: dashed;
  text-decoration-line: underline;
}

Workflow changes

Daily and weekly notes in year/month/day structure

In Settings -> Daily Notes, I've set up the Daily Note template as YYYY/YYYY-MM/YYYY-MM-DD so notes are stored in folders first by year and then by month:

2023/
	11/
		2023-11-29
		2023-11-30
	12/
		2023-12-01
		2023-12-02
		2023-12-03
		...

This helps a lot especially when I want to filter out certain years or only accept input from current year in querie.

For Periodic Notes -> Weekly Notes, I use format gggg/gggg-[W]ww to achieve similar result:

2023/
	2023-W49
	2023-W50
	2023-W51
	...

I only recently learned if I define anything (file patterns, new file names etc) with a forward slash inside them, it automatically translates into a folder structure.

Learning notes

When I make notes of things, I like to leave a note for myself to check out or learn something new. I selected an emoji I otherwise wouldn't use (in my case, 👨🏻‍🎓) and put that on a line with such note.

I then made another note with

```query
👨🏻‍🎓
```

that renders a list of all the lines that emoji's been used on. So I can always keep an eye on items that I've once decided are worth learning more:

Screenshot of an Obsidian note that has rendered three items that start with an emoji 👨🏻‍🎓

Bookmarklet to copy current web page as Markdown link

Inspired by Joona Keskitalo's blog post, I adjusted his code into a bookmarklet that allows me to copy the current website's title and URL in Markdown format of [title](URL) to my clipboard so it's easier to paste to Obsidian. Then, based on Timo's idea, I added a functionality that captures the current selection in the page as a blockquote on top.

(() => {
  const copy = (title, url, selection) => {
    const textArea = document.createElement("textarea");
    let text = "";
    if (selection && selection != "") {
      text = `> ${selection}\n`;
    }
    text += `[${title}](${url})`;
    textArea.value = text;
    textArea.style.top = "0";
    textArea.style.left = "0";
    textArea.style.position = "fixed";
    document.body.appendChild(textArea);
    textArea.focus();
    textArea.select();
    try {
      document.execCommand("copy");
    } catch (err) {
      console.error("Copying err", err);
    }

    document.body.removeChild(textArea);
  };

  copy(document.title, window.location.href, window.getSelection());
})();

(and as minified bookmarklet:)

javascript:(function()%7B(()%20%3D%3E%20%7B%0A%20%20const%20copy%20%3D%20(title%2C%20url%2C%20selection)%20%3D%3E%20%7B%0A%20%20%20%20const%20textArea%20%3D%20document.createElement(%22textarea%22)%3B%0A%20%20%20%20let%20text%20%3D%20%22%22%3B%0A%20%20%20%20if(selection%20%26%26%20selection%20!%3D%20%22%22)%20%7B%0A%20%20%20%20%20%20text%20%3D%20%60%3E%20%24%7Bselection%7D%5Cn%60%3B%0A%20%20%20%20%7D%0A%20%20%20%20text%20%2B%3D%20%60%5B%24%7Btitle%7D%5D(%24%7Burl%7D)%60%3B%0A%20%20%20%20textArea.value%20%3D%20text%3B%0A%20%20%20%20textArea.style.top%20%3D%20%220%22%3B%0A%20%20%20%20textArea.style.left%20%3D%20%220%22%3B%0A%20%20%20%20textArea.style.position%20%3D%20%22fixed%22%3B%0A%20%20%20%20document.body.appendChild(textArea)%3B%0A%20%20%20%20textArea.focus()%3B%0A%20%20%20%20textArea.select()%3B%0A%20%20%20%20try%20%7B%0A%20%20%20%20%20%20document.execCommand(%22copy%22)%3B%0A%20%20%20%20%7D%20catch%20(err)%20%7B%0A%20%20%20%20%20%20console.error(%22Copying%20err%22%2C%20err)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20document.body.removeChild(textArea)%3B%0A%20%20%7D%3B%0A%0A%20%20copy(document.title%2C%20window.location.href%2C%20window.getSelection())%3B%0A%7D)()%3B%7D)()%3B