Copyright | (c) 2024 Sena |
---|---|
License | GPL-3.0-or-later |
Maintainer | contact@sena.pink |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Gemoire.Gemlog.Post
Description
Minimal gemlog post parser/formatter and default templates
For posts, the template components are also usable, following the same
syntax described in Template
. Variables available to the post will
be applied while parsing like in templates.
The variables available in a post may change depending on what function parses
them. Unless doing heavy customization, see Gemlog
for the variables
available in the intended use. Otherwise, see each function below.
Additionally, variables can also be set (or overridden) in the post like so, assuming a single variable per line:
{= variable value =}
Parsers
Parses a GemText post into a map of Values
to use in templates.
The post content will be evaluated and formatted using template
and
format
before creating the map.
Some special variables are also generated while parsing. Those are:
title
- The first heading in the document if it existspost
- The post content (non-overrideable by the post text)
Reads and parses a GemText post file into a map of Values
to use in templates.
See parsePost
for how this function works. Everything there applies here as well.
This function adds some additional formatting variables, which are:
path
- The given file pathfname
- The file name without the extension and the directoriesmodified
- File modification date and time (yyyy-mm-ddThh:mm:ss[.ss]±hh:mm
)modified_date
- File modification date (yyyy-mm-dd
)
These variables are not overrideable by the post text.