A Way to Compare Hugo's Markup Languages (featuring inline footnotes)
Updated  2022-January-14

Page contents

News

2021-August-2  Published this evolving⁠[1] article.

Introduction

Thanks to Hugo’s RenderString function, which was introduced in Hugo v0.62.0, it is possible to use more than one of Hugo’s markup languages in the source of a single page. This means you can test features of Hugo’s markup languages without creating a separate file for each markup language.

 

Markdown tests: Inline footnotes in different Markdown flavors

To learn about Markdown footnotes, see the Footnotes👣 section of Infinite Ink’s Ordinary and Extraordinary Markdown. Some (not all) Markdown flavors support the following syntax for inline footnotes:

some text^[This is an inline footnote.]

In the source of the first three tests below, I use Infinite Ink’s renderas shortcode to test this syntax in three of Hugo’s markup languages.

 

Test 1: Blackfriday-flavored Markdown

Source fragment

{{< renderas blackfriday >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote. [return]

 


Test 2: Goldmark-flavored Markdown

Source fragment

{{< renderas goldmark >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text^[This is an inline footnote.]

 


Test 3: Pandoc-flavored Markdown

Source fragment

{{< renderas pandoc >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote.↩︎

 


Markdown conclusion

  • Blackfriday- and Pandoc-⁠flavored Markdown support this inline footnote syntax.

  • Goldmark-flavored Markdown does not support this inline footnote syntax. It’s possible — but probably not likely — inline footnotes will be supported in a future version of Goldmark.

 

As of Hugo v0.87.0, which was released 2021-August-3, Hugo’s built-in Blackfriday renderer is deprecated.

 

More tests: Inline footnotes in AsciiDoc and Org-⁠mode

Test 4: AsciiDoc

 

Source fragment

{{< renderas adoc >}}

some textfootnote:[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text[1]


1. This is an inline footnote.

 

💡
Test 4’s renderas argument can be ad, adoc, or asciidocext (but not asciidoc, which probably is a bug).

 


Test 5: Org-mode

To learn about Org-mode footnotes, see orgmode.org/manual/Creating-Footnotes.html.

 

Source fragment

{{< renderas org >}}

some text[fn:: This is an inline footnote.]


{{< /renderas >}}

 

Rendered in your web browser

some text1


1

This is an inline footnote.

 

Overall conclusion

Four of the five markup languages tested above support inline footnotes.⁠👍

 

See also

Endnote


1. Many Infinite Ink articles, including this one, are evergreen and regularly updated.

Comments and questions 📝 👍 👎 🤔

Your public comment or question might immediately improve this page or help me to (eventually) improve this page.