Commit graph

4 commits

Author SHA1 Message Date
Timur Demin
fc76187e13
Implement renderer test suite
This implements a Markdown / Gemtext suite, testing the entire renderer
at complex Markdown documents, containing the entirety of current
Markdown features accessible with gmnhg. The test suite can be expanded
by adding a pair of .md/.gmi files.

Minor bug fixes in JSON/Org metadata parsing where bugs were detected
with the test suite are also included in this patch.

Fixes #13.
2021-09-30 18:01:46 +05:00
Timur Demin
7e19930b1b
Add missing copyright headers 2021-09-17 22:37:10 +05:00
Timur Demin
9778ada128
Parse metadata in all Hugo formats
This makes gmnhg parse TOML/YAML/JSON/org-mode front matter in Hugo posts.

This also makes the library no longer render metadata in posts, removing
the API to do so. The metadata parsing code itself moves to
internal/gmnhg.

As the library no longer has a preset to include metadata in rendered
document, md2gmn will from now on silently discard front matter if it
encounters any.

Fixes #28. Unblocks #13.
2021-09-17 22:34:03 +05:00
Timur Demin
b4ae1981d6
Implement sort / sortRev in templates
This adds generic sort / sortRev functions for use in gmnhg templates
which use sort.Sort to sort anything that implements sort.Interface
(which includes lists of posts).

The existing sortPosts function that used to sort posts in reverse order
becomes an alias to sortRev for backwards compatibility.
2021-08-22 17:52:19 +03:00