/wiki

Here in my GitHub, just brought this... uh... muh new wiki here. Fun to write up here in the atmosphere. But you know what I like more about writing random things? GNAWLEDGE!

Primary LanguageOrg

foo-dogsquared’s wiki

Keep taking notes and stop worrying about file organization!

Muh wiki. This documents the "infrastructure" of my notes because I like documenting and I always forget things. It primarily uses the Zettelkasten note-taking method which means all of my notes are scattered in just one location. Fun.

Slowly, this is turning into a monorepo for whatever findings I could find. Ehh, I mean why not? ¯\_(ツ)_/¯

Note

On another note, this supersedes my personal notes. I’m not going to import them because I want to start on a clean slate.

Also, not everything on this Git repo is here (at least yet). Some of them are private files and so I want them to not appear anywhere else. Fortunately for me, most of the private files are connected with each other (a separate org-roam instance would be better in this case).

Why set up like this?

We need to focus on why did I need to make the structure like this. In other words, what is the purpose?

  • I want ideas to be searched and woven so easily with the rest.

  • I want to accumulate my reading effectively.

  • I’m not an expert so I still need the "basic" way of taking structured notes, summarizing them until I gain a bigger picture of the things I’m curious about.

  • I want to easily integrate spaced repetition and randomness to encourage improvement on my notes.

This project is the result of that with org-roam, Anki, and eventually more (preferably less) tools to stick around and gain ideas from. In a way, THIS is my zettelkasten, digital garden, whatever-thingamajig-you-want-to-call-it.

Getting started

Interested in copying my setup? Here’s my IKEA-esque manual for you.

Prerequisites

It needs the following list of software. All of them are required unless noted otherwise.

  • GNU Emacs because org-mode.

    • Uses Doom Emacs as the preferred Emacs distro with the org module enabled. This is optional and you can use your own Emacs config.

    • org-roam v2, the star of the show, is installed.

  • Nix package manager because org-babel. You can fully replicate the environment without Nix by looking at the dependencies at ./shell.nix and install them with your package manager (or anything else, you do you) but I recommend to do so because I say so.

  • direnv (optional, by the way) because automatic shell environment. [1]

Setting up

This wiki uses org-roam v2 as the main note-taking system. As of 2021-05-04, it is yet to reach v2 but it is underway with its first alpha release. The notes should’ve been adapted for v2 by now. Though, you have to configure it in line with the major redesign.

If you want to fully reproduce the config, refer to my Doom Emacs configuration.

Now with the pieces complete and assuming you’ve already have my wiki in your folder, fire up Emacs, open the wiki folder, and do your thing. This project has a local Emacs config (see related section). It also has a project-specific functions and variables in ./config.el. You can load it in your init.el, just make sure you included it somewhere. If you’ve set enable-local-variables to :safe or any value that makes Emacs to ignore them, you may want to configure related variables for it to work.

If you have direnv installed, you can also enable automatic shell environments by allowing it to set it up for you. Just run direnv allow!

If you have lorri installed, you’re better to go with the faster startup when setting up the environment.

Project structure

Here’s the current project structure.

wiki
├── assets/
├── cards/
├── daily/
├── notebooks/
├── config.el
├── Makefile
├── README.adoc
├── references.bib
└── shell.nix

For full details, see Conventions. But for summary:

  • Separate notes by purpose. Separate as may be, they can freely link other notes.

  • My notes are in ./notebook/ where all of my evergreen and hierarchical notes are there.

  • Each type of note has an asset folder where all of the stuff linked from the note.

Conventions

  • There are certain times to use custom Org mode blocks inspired from Asciidoctor.

    • Abstract — e.g., #+begin_abstract.

    • Appendix — e.g., #+begin_appendix.

    • Admonition blocks — e.g., #+begin_important, #+begin_tip, #+begin_warning.

  • Labels are freely used for my notes as an easy way to refer to various Org mode elements. They are mainly inspired from how I used to label objects in LaTeX.

    • lst for source code blocks.

    • itm for enumerated list items.

    • eqn for equations.

    • fig for pictures and graphics.

    • subfig for parts of figures.

    • tab for tables.

  • All of my notes (in a normal sense) are in ./notebook. Mainly uses the convention of note categories found in zk.zettel.page. But in practice, the separation is a bit blurry so feel free to combine them in some way.

    • However, my fleeting notes are in ./daily/. The fleeting notes are ignored since they’re meant to processed on the daily so having them in the worktree will make a messy history. It is basically my inbox for various things: my random realizations, ideas, and whatnot.

    • My "traditional" notes is at ./notebook/. Practically, this is your 2D system of notes — the hierarchical notebook. All notes here are named with the safe version of the filename (in kebab-case). The filename is also just the normal path name except with the directory separator replaced with the dot (e.g., cookbook/introduction-to-builder-pattern.org will be cookbook.introduction-to-builder-pattern.org). This allows to make a directory of flat files while representing the schema of your notes. Pretty handy.

    • Literature notes are in my notebook, too. The file name are prefixed with literature. These are notes from a specific resource (e.g., an article, talk, video, post, tweet) intended for recording the key ideas from it. Eventually, the ideas will be added to the evergreen notes. Furthermore, they shouldn’t be referenced anywhere. Naming them is the same as the one in my traditional notes.

    • My evergreen notes, essentially a ripoff from Andy Matuschak’s notes. These are essentially like my Zettelkasten, a bunch of my own ideas (that I have processed and realized myself, anyways). The file name are just timestamps for convenience. [2]

    • For challenges and answers to problem sets, they are set in my hierarchical notebook with the prefix challenges. The conventions are each question are its own section and are copied verbatim (as much as possible) with my solution as a subsection. I may also make some additional comments and subsections with my findings after peeking at the solution.

    • Additional types of notes can be put in a separate folder (e.g., cards, microposts). There is not set hierarchy but be sure to create a new type by purpose.

  • The above structure makes it easier for retrieval. If you want to search all of the fleeting notes, just search in daily/, etc.

    • For searching tools, prefer desktop search tools such as Recoll or DocFetcher.

    • Quick search tools such as grep or ripgrep are also nice.

  • Uses timestamp (at localtime) as the filename, it is unique enough (for personal purposes) and doesn’t need to change. [3] The format for the filename is equivalent to $(date +%F-%H-%M-%S).org.

  • Since org-roam v2, an ID is now required to be recognized by the software. File-level notes should have a top-level property drawer with an ID set while certain entries have local property drawers. That said, be selective when to assigning IDs for the local headlines.

  • Uses plain org-mode tags for consistency. It also happens to be the only supported tag format starting from org-roam v2 so hoorah for me. :)

  • A list of references are stored at ./references.bib for org-ref-styled workflows. It is managed with Zotero with the better-bibtex Zotero extension but you can replace however you manage and generate the Bibtex file.

  • A creation datetime and a modification datetime is a cruicial part of my notes. It lets me know how up-to-date my notes are without relying on the filesystem metadata because I copy them carelessly, not to mention how various tools deal with them differently. The modification datetime is handled with timestamps automatically.

    Just see my Doom Emacs config in my dotfiles.

    (after! org
      (setq
       time-stamp-start "date_modified:[ 	]+\\\\?"
       time-stamp-end "\\\\?[ ]*$"
       time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"))
    
    ; Automate updating timestamps on save.
    (add-hook 'before-save-hook 'time-stamp)
  • The related assets are stored in the ./assets/. It contains anything that a document should attach. In certain cases where the document has tangled files and the appropriate assets folder is not located at the project root, it should be put in a separate folder with the filename of the org-mode document — e.g., ./notebook/2021-04-06-15-04-11.org should have an asset folder in ./notebook/assets/2021-04-06-15-04-11/.

    • If one of the files is being linked from more than one note, you can move the file out in the top-level of the asset folder.

    • I sometimes draw a visual aid just to strengthen my learning as well as an excuse to use my graphics tablet and I want to store them in a reasonable location without dumping it like in a landfill. Unfortunately, this means having to scour the assets folder like a clueless babboon holding a hammer because all of it is named after a timestamp but I can deal with it.

    • org-mode can also generate files including text and graphics. I’m lazy and I fear conflicting asset filenames so I’ll just put them in separate folders instead alongside opening a can of worms. [4]

    • For my hand-drawn visual aids, I usually name with a prefix (e.g., fds-visual-${WHAT_THE_GRAPHICS_IS_ABOUT}.webp). As a side effect, this mitigates against overwriting of generated assets from org-mode if I remember to not name it fds-visual-*.

    • If you enable local variables (recommended to query it) and are OK with prompts every time you open up a note, then this should be no problem for you.

Static site export

While the wiki is exclusively used with Emacs, there is an exported website with Next.js and uniorg deployed using GitHub Actions (at ./.github/workflows/). The source code of the site is at ./site/.

Here’s the image summarizing the workflow.

workflow

Future tasks

This also means expect the following changes if you’re watching this repo for some reason. Keep in mind all of the details are still under consideration.

  • Make the site prettier.

  • Try out Neuron. I’ve used it on and off and even tried to support both org-roam and Neuron because I like the static site generated and also because org-roam doesn’t have a killer HTML exporter yet (in my opinion). It is simple and nice but I can deviate from that with org-publish or any supported static site generators like Hugo. Once org-mode is reimplemented in Neuron v2, it’s a 100% addition to my workflow.

  • Support graphing features. org-roam has org-roam-server plugin but as of 2021-05-07, it doesn’t v2. Not a necessity, necessarily, but it is a good visual way to quickly glance how my notes are doing in the bigger picture. Also, the ultimate procastination tool.

  • Add/replace Nix with Guix. Maybe add a file intended for setting up a Guix environment. I like both Nix and Guix, all right.


1. You can enable the direnv module from the Doom Emacs config.
2. Not necessarily original but just some of them being developed and processed, with/out a Eureka moment.
3. If you use the title as the basis, that’ll depend if you have tolerance for the misaligning relation between the filename and the title.
4. This includes trying to name an asset that doesn’t exist already to not overwrite the file that one note needed. It’s also a lot more subtle when trying to build it altogether or if the notes get any bigger.