slweb

Slweb is a static website generator which aims at being simplistic. It transforms custom Markdown-like syntax into HTML.

Prerequisites

Aside from the obvious (a C compiler, by default GNU C), slweb requires realpath(1) to determine paths in local links and groff(1) and gzip(1) to create and compress documentation. git(1) is, aside from cloning the repository, required to use the directive {git-log}. KaTeX\KaTeX (https://katex.org) is optionally used for math mode.

Install

$ git clone https://github.com/Strahinja/slweb.git
$ cd slweb
$ su

Then, if you have apenwarr/redo:

# redo install

if you don't:

# ./do install

You can specify any compiler which uses -Wall, -c, -g and -o like GNU C, most notably tcc(1), by setting the SLWEB_CC environment variable. For example:

$ SLWEB_CC=tcc redo -j10

In the case of tcc, the tradeoff is that the debug information is limited compared to gcc, but the compilation time is significantly shorter.

Examples

See the examples/ directory in this repository.

Given the file index.slw in the current directory:

---
site-name: Test website
site-desc: My first website in slweb
---

{main}
# Hello world

This is an _example_ of a statically generated HTML.

{/main}

after using the command:

$ slweb index.slw > index.html

file index.html contains:

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Test website</title>
    <meta charset="utf8" />
    <meta name="description" content="My first website in slweb" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="generator" content="slweb" />
</head>
<body>

<main>
<h1>Hello world</h1>

<p>This is an <em>example</em> of a statically generated HTML.</p>

</main>
</body>
</html>

TODO (checklist)

See the file TODO for more information.

Bugs and limitations

Bugs can be reported using the Github issue tracker. See the manpage (man slweb) after installing slweb for more information.

License

slweb - Simple static website generator.
Copyright (C) 2020, 2021 Страхиња Радић

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Previous commit: index.slw 1ad4667 2021-02-22 16:08:15 +0100 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD)
Generated by slweb © 2020, 2021 Strahinya Radich.