index notes

---

██╗███╗   ██╗██████╗ ███████╗██╗  ██╗
██║████╗  ██║██╔══██╗██╔════╝╚██╗██╔╝
██║██╔██╗ ██║██║  ██║█████╗   ╚███╔╝ 
██║██║╚██╗██║██║  ██║██╔══╝   ██╔██╗ 
██║██║ ╚████║██████╔╝███████╗██╔╝ ██╗
╚═╝╚═╝  ╚═══╝╚═════╝ ╚══════╝╚═╝  ╚═╝

Visualization

Also see tag index .

@index go to an index note on some topic

@idea idea for a draft, e.g. for a blog post

All files ( tree -f -I "images*|*.pdf|*.py|*.html" ).

TODO : Command for only listing directories.

Produce website from notes

Each note its own page (assuming you are in home folder):

for f in Zettelkasten/*.md; do pandoc -s --toc --number-sections --section-divs --lua-filter=filters/md_to_html.lua --css=https://www.edwinwenink.xyz/css/twocolumn.css --mathml $f -o site/${f%.md}.html; done

One page website:

pandoc --toc --metadata title="Archive Fever" --metadata author="Edwin Wenink" --number-sections --section-divs --css twocolumn.css ./**/*.md -o archivefever.html

With link to my website:

pandoc --toc --metadata title="<a href=https://www.edwinwenink.xyz/>Archive Fever</a>" --metadata author="<a href=https://www.edwinwenink.xyz/~ejw>Edwin Wenink</a>" --number-sections --section-divs --css twocolumn.css ./**/*.md -o archivefever.html

Does NOT work anymore in new pandoc version, unfortunately. So:

  1. remove explicit html in metadata
  2. add -s standalone flag; css does not load anymore otherwise.
pandoc -s --toc --metadata title="Archive Fever" --metadata author="Edwin Wenink" --number-sections --section-divs --css twocolumn.css ./**/*.md -o archivefever.html

Now let's start adding a lua filter:

```` pandoc -s --toc --metadata title="Archive Fever" --metadata author="Edwin Wenink" --number-sections --section-divs --css twocolumn.css --lua-filter fix-links.lua ./**/*.md -o archivefever.html


I got stuck.

The problem is that the section ID I want the backlink to point to is derived from the \#header, whereas the backlink points to the filename on disk.

Idea:

1. When parsing the link
2. Open filename on disk
3. Parse it's header
4. Convert that to its section-id
5. Make that the link target.

Alternatively, do not do a one-page website.
In that case, I need:

1. Something to produce the overal TOC (probably hard)
2. Add a link on every page pointing back
3. Adjust makefile to find the css file... from subdirectories.

## Visualize backlinks.json

Call `py visualize_backlinks.py` (assuming you have `backlinks.json`) and then run:

dot -K sfdp backlinks.gv -Tpdf -O ```

  • K-flag selects algorithm
    • fdp and sfdp seem to work well, everything stays readable. Probably best if the graphs get more complex.
    • twopi is nice and compact; overlapping circles show a tight connection
  • T-flag sets output format
  • O-flag automatically sets the output name based on the input name. So output will be backlinks.gz.pdf

Instructions for creating index

Linux

Make a tree with:

tree -f -I "images*|*.pdf|*.py|*.html"

The -f option keeps full relative path listings, which is necessary for gf The -I option excludes everything matching the given pattern. Aim to keep .md and perhaps the occasional .org

Windows

On Windows, run dir /s /b | findstr .md and then :%s/C:\\Users\\Edwin Wenink\\Documents\\Notes\\//g

Copy with yy:

.!dir /s /b | findstr .md

Then paste in command line with ".

Search and replace:

:%s/C:\Users\Edwin Wenink\Documents\Notes\//g

A quick way to deal with spaces is to visually select the whole line before doing gf.

Making a nice tree is a bitch on Windows due to annoying formatted PITA output.