A fast and minimal knowledge-management system written in C and rendered in HTML.
clang notes.c md_renderer.c md4c/md4c.c helpers.c
Clang is the most accessible C compiler for windows users and the one I use, but it should compile with any C compiler that supports C99.
notes -h head.html -f foot.html -p ../remote/ -l ../local/ note1.md [note2.md ...]
The file passed as the
-h argument will be appended to the beginning of every resulting HTML file, and the
-f file to the end.
-h file must contain two occurrences of
%s, where the first will be replaced by the note's title, and the second with the note's nav. Different navs are generated depending on whether the file being generated is a note, a tag index, or the root index.
Two static websites in two different directories are always generated, where the directory given to
-p contains only the notes that specify
public: yes in their metadata, and the
-l directory contains all notes.
The arguments have the following defaults if not specified:
-h head.html -f foot.html -p ../remote/ -l ../local/
After those options, specify any number of paths to note files. The note files should specify
title¨: <note title>,
tags: <comma-separated tags> and
public: <yes/no> in their first three lines (most likely breaks at the use of UTF byte order marks in the beginning of parsed files).
<!DOCTYPE html> <html> <head> <meta charset='UTF-8' /> <title>%s - notes</title> <link rel="stylesheet" href="/css/style.css" /> <link rel="icon" href="/res/icon-128x128.png" type="image/png" sizes="128x128" /> <link rel="icon" href="/res/icon-64x64.png" type="image/png" sizes="64x64" /> <link rel="icon" href="/res/icon-32x32.png" type="image/png" sizes="32x32" /> <link rel="icon" href="/res/icon-16x16.png" type="image/png" sizes="16x16" /> </head> <body> <header> <a href="/index.html">node</a> </header> <nav><ul>%s</ul></nav> <main>
</main> <footer> <a href="https://sr.ht/~MeOnSourcehut/"><img src="/res/sourcehut.svg"></a> <span>My Name</span> </footer> </body> </html>
Notes uses MD4C for parsing Markdown (very, very quickly!).
You are more than welcome to contribute, but as this is a quite personal project, if your contribution does not align with my personal vision, the contribution will not be accepted.
I highly encourage you to only make changes to this program that are useful to you, regardless if I choose to accept them or not.