Improve docs and add install script
This commit is contained in:
parent
db0b922e11
commit
c87debfbae
3
Makefile
3
Makefile
|
@ -5,5 +5,8 @@ calathea: calathea.c
|
||||||
fi
|
fi
|
||||||
gcc -Wall -Wextra -pedantic -lm -lcmark calathea.c -o build/calathea
|
gcc -Wall -Wextra -pedantic -lm -lcmark calathea.c -o build/calathea
|
||||||
|
|
||||||
|
install:
|
||||||
|
cp ./build/calathea /usr/bin/calathea
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm build/*
|
rm build/*
|
||||||
|
|
24
README.md
24
README.md
|
@ -1,4 +1,4 @@
|
||||||
# calathea v0.1
|
# calathea v1.0-beta
|
||||||
|
|
||||||
calathea is a small C program used to generate static wikis. It takes a
|
calathea is a small C program used to generate static wikis. It takes a
|
||||||
directory of Common Markdown pages with `[[wikilinks]]` and renders them to
|
directory of Common Markdown pages with `[[wikilinks]]` and renders them to
|
||||||
|
@ -10,7 +10,7 @@ proved to be a serious trial by fire in learning how to effectively work with
|
||||||
zero-terminated strings. There will likely be memoryleaks and comments that
|
zero-terminated strings. There will likely be memoryleaks and comments that
|
||||||
over explain every line of code.
|
over explain every line of code.
|
||||||
|
|
||||||
## Features
|
## features
|
||||||
- Rendering wikilinks
|
- Rendering wikilinks
|
||||||
- Ability to keep track of incoming links
|
- Ability to keep track of incoming links
|
||||||
- Named wikilinks (i.e. `[[link title|actual page]]`)
|
- Named wikilinks (i.e. `[[link title|actual page]]`)
|
||||||
|
@ -21,6 +21,7 @@ installed. Once that's set up, clone the repository and run:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ make
|
$ make
|
||||||
|
$ make install
|
||||||
```
|
```
|
||||||
|
|
||||||
If GCC complains it can't find cmark, then try running `ldconfig`. If it
|
If GCC complains it can't find cmark, then try running `ldconfig`. If it
|
||||||
|
@ -33,3 +34,22 @@ $ export $LD_LIBRARY_PATH=/usr/local/lib64
|
||||||
|
|
||||||
Or wherever it got installed as per the output of running `make install` for
|
Or wherever it got installed as per the output of running `make install` for
|
||||||
cmark.
|
cmark.
|
||||||
|
|
||||||
|
## usage
|
||||||
|
To see a list of options, run:
|
||||||
|
```
|
||||||
|
$ calathea --help
|
||||||
|
```
|
||||||
|
|
||||||
|
Running calathea builds pages (by default, any filies in `./pages`) to HTML files outputted in the specified output directory (by default, `./build`). To do this, it renders the pages and inserts them into your template file (by default, `./template.html`).
|
||||||
|
|
||||||
|
When building the files, calathea will look for two pseudo-Moustache templates: `{{content}}` and `{{incoming}}`. `{{content}}` will be replaced with the page content and `{{incoming}}` will be replaced with an HTML `ul` list of links to all pages that link to the given page.
|
||||||
|
|
||||||
|
The first line of every file in your pages directory should just be the title of the page. For example:
|
||||||
|
|
||||||
|
```
|
||||||
|
Page Title
|
||||||
|
Here is some page content
|
||||||
|
```
|
||||||
|
|
||||||
|
The content of the above page will be "Here is some page content" and the page title will be "Page Title". You can then link to it from other pages with `[[page title]]`.
|
||||||
|
|
Loading…
Reference in New Issue