Commit graph

15 commits

Author SHA1 Message Date
mntn
3a86f0f7e6
Support Hugo headless page bundle leaf nodes
With Hugo, a page bundle can be skipped from rendering if
it specifies headless = true in its front matter. This makes
gmnhg properly skip these pages from rendering.

Fixes #11.
2021-09-01 00:06:23 +05:00
Timur Demin
ea62886fca
Implement footnotes support
This adds footnotes support, with rendering their text
after their parent paragraph. Footnotes are limited to
just one line by gomarkdown.

Fixes #16.
2021-08-31 10:12:39 +05:00
Timur Demin
688d88d72b
Make the Go compiler calculate renderer flags
This makes the Go compiler automatically calculate renderer
flags bitmask values by putting 1 << iota as the first meaningful flag.
This has a downside of having the first flag always meaning 2, and not
1, whereas WithMetadata already meaned 1, therefore this is a breaking
change.
2021-08-22 23:05:49 +03:00
Timur Demin
c872e012e2
Enable gomarkdown's NoEmptyLineBeforeBlock rule
This changes gomarkdown parser behavior to allow code blocks, lists, etc
to come after other blocks (like paragraphs) and get processed as
independent blocks without a separate newline (putting gomarkdown in
charge to decide whether a new block is started).

This is a breaking change as this affects how some existing Markdown
source might get rendered. Nonetheless, this is probably the expected
default by most users. This has no configurable switch yet.

See #14.
2021-08-22 22:51:52 +03:00
Timur Demin
66b2f83a88
Migrate to GitHub 2021-08-01 04:11:04 +05:00
Timur Demin
7eaf6b7c8a
Fix #8
This fixes trailing newlines at the end of Gemtext being left.
2020-12-12 16:30:25 +05:00
Timur Demin
d89c4b5e50
Reword RenderMarkdown docstring 2020-12-12 14:06:22 +05:00
Timur Demin
47e056f253
Refactor RenderMarkdown signature
This makes the function accept a bitmask instead of a single flag. This
is a breaking change.
2020-12-12 14:03:29 +05:00
Timur Demin
1a0e61dc3f
Implement gmnhg
gmnhg is the new program that generates a Gemini site from Hugo site
content. It reads its input from content/, static/, and layouts/gmnhg/.
Its output by default goes to output/.

More doc is available in the program doc header.
2020-11-18 22:23:31 +05:00
Timur Demin
8226a20880
Change API for simpler use by gmnhg 2020-11-11 23:21:18 +05:00
Timur Demin
637ff4b71b
Rid of an unneeded check
RenderMarkdown doesn't really need an extra check on whether or not the
Markdown content size is more than a specific amount.
2020-11-11 23:21:17 +05:00
Timur Demin
9ea608670f
Clarify the subset of front matter data rendered 2020-11-11 23:21:17 +05:00
Timur Demin
b181afc5f1
Add YAML front matter parsing support
Fixes #1. Only a subset of Hugo front matter props are supported, namely
title/date.
2020-11-11 23:21:17 +05:00
Timur Demin
32ec381d73
Add README and license code under GPLv3 2020-11-11 23:21:16 +05:00
Timur Demin
4d80d36f00
Provide a public API
This also introduces a simple program, md2gmn, that is meant for testing
the renderer on Markdown files. Nonetheless, it can be used as
a standalone tool as well.
2020-11-11 23:20:52 +05:00