Skip to content

v0.3.0

Compare
Choose a tag to compare
@tdemin tdemin released this 03 Sep 17:05
· 33 commits to master since this release
v0.3.0
bcc3d8b

This release brings a number of major improvements and bug fixes to the renderer, making it much more predictable. The renderer now supports footnotes, links-only lists, preformatted text comments, definition lists, horizontal rules, and subscript / superscript (the last three being a lossy conversion into plaintext). It will now recursively detect and render links in any block, including blockquotes, paragraphs, lists, footnotes, and tables.

A number of tweaks has also been made to how the renderer processes text:

  • gmnhg will now split links blocks into three distinct blocks: footnotes, images, and links, the three separated by a single newline. This groups distinct content entities, helping readability of the resulting text.
  • Blocks of distinct types coming right after another block with no preceding newline will now get parsed as new blocks, and not continuations of the preceding blocks (the latter being gomarkdown default). This allows you to put a Markdown list right after a paragraph with no extra newline, and have it treated as a list. Despite the lack of newline, gmnhg will still insert one.
  • Bits of formatting supported by Markdown but unsupported in Gemtext will now be rendered in plain text (for instance, bold text will be enclosed in double asterisks, and footnotes will be displayed as [^1] and etc). While they will get disregarded by most Gemini clients, they allow the reader to still have the stylistic context that would have been otherwise lost.
  • gmnhg will now render plain text in various contexts the exact same way, differing only in newline usage. This also fixes some minor bugs like panicking on links in headings.

gmnhg now supports sprig v3 tags in templates, making them more useful overall, and adds two new tags:

  • sort, which sorts anything implementing sort.Sort (including lists of posts) in ascending order;
  • sortRev, which works like sort, but in reverse order.

The older function sortPosts is now an alias to sortRev.

gmnhg from now on also supports Hugo page bundles (essentially directories of pages and related resources). For details on what these are and how to use them, see 1.

The library itself has changed the numeric values of the configurable renderer flags bitmask to make the Go compiler automatically calculate flag values. While this shouldn't be an issue to the correct code utilizing gmnhg as a library, this is still a breaking change.