~tagglink/notes

Generates a browsable HTML website from Markdown notes

a5936e2 append forward-slashes to paths

~tagglink pushed to ~tagglink/notes git

1 year, 29 days ago

3c7e6fd new repo for sourcehut, initial commit

~tagglink pushed to ~tagglink/notes git

1 year, 29 days ago

#Notes

A fast and minimal knowledge-management system written in C and rendered in HTML.

It was inspired by memex engine Oscean and is powered by the markdown parser MD4C.

Features:

  • Parsing of notes in markdown format.
  • Tag-based note organization.
  • Sort the note order however you like before running.
  • Only notes marked public are also copied to a remote directory.
  • Generates in less than a second.

https://tagg.link/notes/

#Build

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.

#Use

Example invocation: 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. The -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).

Example head.html:

<!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>

Example foot.html:

</main>
  <footer>
    <a href="https://sr.ht/~MeOnSourcehut/"><img src="/res/sourcehut.svg"></a>
    <span>My Name</span>
  </footer>
</body>
</html>

#Dependencies

Notes uses MD4C for parsing Markdown (very, very quickly!).

#Contributing

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.

#Improvements

  • Provide the choice of generating only public notes as a command line option