View your notes as a static HTML site.
Go to file
2021-08-24 15:36:42 +01:00
templates Add p to tell user about enter to open 2021-08-24 15:36:42 +01:00
.gitignore add .gitignore 2021-06-29 14:11:30 +01:00
.notes2web.conf add development config 2021-05-01 13:05:22 +01:00
fuse.js searching! 2021-08-19 14:43:42 +01:00
Makefile explicitly use pip3 2021-08-19 14:44:41 +01:00
notes2web.py Fix syntax error 2021-08-24 14:39:30 +01:00
readme.md add new switches to cli usage 2021-08-21 03:22:51 +01:00
requirements.txt tags! 2021-08-15 20:40:13 +01:00
screenshot.png add yq depencency, screenshot 2021-05-01 12:04:45 +01:00
search.js Open link article in new tab if user presses shift+enter 2021-08-24 15:36:03 +01:00
styles.css Add p to tell user about enter to open 2021-08-24 15:36:42 +01:00

notes2web

View your notes as a static html site.

Why?

I want to be able to view my notes in a more convenient way. I was already writing them in Pandoc markdown and could view them as PDFs but that wasn't quite doing it for me:

  • It was inconvenient to flick through multiple files of notes to find the right PDF
  • It was annoying to sync to my phone
  • PDFs do not scale so they were hard to read on smaller screens
  • Probably more reasons I can't think of right now

Install

  1. Install Pandoc and Pip

    On arch:

    # pacman -S pandoc python-pip
    
  2. Run make install as root

Things to Remember Whilst Writing Notes

  • notes2web reads the following YAML frontmatter variable:

      - `author` --- The person(s) who wrote the article
      - `tags` --- A YAML list of tags which the article relates to - this is used for browsing and also searching
      - `title` --- The title of the article
    
  • notes2web indexes ATX-style headings for searching

  • notes2web attempts to display file history through the git log command

CLI Usage

$ notes2web.py notes_directory

Output of notes2web.py --help:

usage: notes2web.py [-h] [-o OUTPUT_DIR] [-t TEMPLATE] [-H TEMPLATE_TEXT_HEAD]
                    [-f TEMPLATE_TEXT_FOOT] [-i TEMPLATE_INDEX_HEAD]
                    [-I TEMPLATE_INDEX_FOOT] [-s STYLESHEET]
                    [--home_index HOME_INDEX] [-e EXTRA_INDEX_CONTENT]
                    [-n INDEX_ARTICLE_NAMES] [-F] [--fuse FUSE]
                    [--searchjs SEARCHJS]
                    notes

positional arguments:
  notes

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
  -t TEMPLATE, --template TEMPLATE
  -H TEMPLATE_TEXT_HEAD, --template-text-head TEMPLATE_TEXT_HEAD
  -f TEMPLATE_TEXT_FOOT, --template-text-foot TEMPLATE_TEXT_FOOT
  -i TEMPLATE_INDEX_HEAD, --template-index-head TEMPLATE_INDEX_HEAD
  -I TEMPLATE_INDEX_FOOT, --template-index-foot TEMPLATE_INDEX_FOOT
  -s STYLESHEET, --stylesheet STYLESHEET
  --home_index HOME_INDEX
  -e EXTRA_INDEX_CONTENT, --extra-index-content EXTRA_INDEX_CONTENT
  -n INDEX_ARTICLE_NAMES, --index-article-names INDEX_ARTICLE_NAMES
  -F, --force           Generate new output html even if source file was
                        modified before output html
  --fuse FUSE
  --searchjs SEARCHJS

The command will generate a website in the output-dir directory (./web by default). It will then generate a list of all note files and put it in index.html.

Then you just have to point a webserver at output-dir.

Uninstall

# make uninstall