Footer can be any length
readme changes
readme changes
Node is a tool that allows anyone to write a website in simple Markdown. Node automatically generates a <nav>
that allows users to navigate your content easily and intuitively.
My own site is generated with node.
The layout of the website is described in a .tree file.
My Node index.md
<Projects projects.md
<<BMP2CHR bmp2chr.md
<Blog blog.md
<<Awesome Blog Post awesome.md
<Now now.md
When Node is run, it parses the .md file at the end of each line and produces a HTML document with a nav for each one. The <nav>
for "Awesome Blog Post" would look like this:
<nav>
<ul>
<li><a href="projects.html">Projects</a></li>
<li><a href="blog.html">Blog</a></li>
<ul>
<li><a href="awesome.html">Awesome Blog Post</a></li>
</ul>
</ul>
</nav>
<main> ... content generated from awesome.md ... </main>
clang src/main.c src/md4c/md4c.c -std=c99
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.
node tree-file.tree -h head.html -f foot.html -c path/to/md/content -o path/to/html/output
Each line in the tree file is parsed in the following way:
<
characters at the beginning of the line is the depth of the nav entry.<
character is the start of the Title of the nav entry.The file entry will be interpreted as one of two things:
.md
, the file is parsed as Markdown and the resulting HTML file is the href
target for this nav entry.href
target for this nav entry.The file given to -h
must contain two occurrences of %s
, where the first will be replaced by the note's title, and the second with the site's nav.
Example head.html
:
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<title>%s - node</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>
Node 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.