Discourse footnote

The discourse footnote plugin allows you to create markdown footnotes in your posts.



Add the following line to your container, in the plugin install section

  - cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://github.com/discourse/discourse-footnote


Footnotes have been discussed as an optional CommonMark extension for a while:

The general consensus is that the extension should allow for syntax such as:

some deep thought who needs a reference[^1]

[^1]: Here's the reference. 

Discourse footnote re-packages the footnote markdown.it extension by @Vitaly as a Discourse plugin.

It supports both, single line and multi paragraph footnotes.

So, for example, this works.

We are our choices. [^sartre]

A lot of interesting words

He really said it. [^sartre]

[^sartre]: We are our choices.
Sartre, some time
some day
in the past

Site Settings

In a multi site environment each site can enable or disable the extension with the enable_markdown_footnotes setting.

Additionally you can either enable or disable “inline” expansion with display_footnotes_inline


This is how stuff looks without inline expansion:


This is how stuff looks with inline expansion:


Inline expansion is “quote” friendly and mobile friendly.


minor note: I saw that GitHub - discourse/discourse-footnote: footnotes for posts in Discourse isn’t marked with the discourse-plugin topic in GitHub, that should be fixed



When this plugin was active the “Remove Bookmarks” button in the /activity/bookmarks page didn’t work. Removing it made the button work again.

I talked about this here: Cannot Remove Bookmarked Posts



Great catch :heart_decoration:

This has been a bug that has plagued us for quite a while, I can in fact see a bunch of spots that worked around it.

I fixed it properly in core Discourse per:

In the past a plugin could ask to decorate posts and get bad callbacks on the user stream pages.


I don’t understand this statement. Isn’t the non-inline version of footnotes also quote friendly?

Request: a better combination of in-line and true footnote style

I’m not sure the exact solution, but I wish there were some option different than the two this plugin has now.

  • I like inline expansion
  • I like not having a footnote section always taking up a lot of space
    • I think ideal would be to have the footnote section expand like “more details” does, and have it auto-expand when one visits a direct link to a footnote.
  • I dislike being unable to link directly to a footnote when inline-expansion is on.

Would it be possible to add the content of the footnote as a tooltip when the mouse is over the footnote number in the text?


While I don’t really oppose that, I prefer (and this is much better for mobile) that it take an actual click rather than auto-show upon hovering.

I’d also like (as I said above), the option to have footnotes sections be collapsed and only visible with expanding or when visited as a direct link.

Core point being that the inline-expansion option removes the possibility for linking to a footnote.


That would mean that the link would no longer go to the bottom where the footnote is, but I guess it would be fine too since you don’t really need to jump to the bottom if you get the info in the tooltip (or whatever it would be called then).

One might wonder, what is the difference to current inline expansion. I’m looking at this mainly from the perspective of academic uses of footnotes, i.e. where people expect to find the footnotes at the bottom. So the existing format (without inline expansion) is fine. Except that it would be more convenient to be able to look at the footnote without having to jump back and forth. Also, I’m afraid that the ellipsis shown instead of the footnote number with inline expansion turned on will not be intuitively understood by many of my less digitally savvy colleagues.

I figured that adding a tooltip on mouse-over might be easy to achieve, perhaps even via CSS.

1 Like

To clarify: I like the existing academic-style format, I just would like the footnote area to be collapsed by default. Ideally, links to footnotes would automatically expand it (i.e. expand the true bottom footnote area) in addition to a plain expand triangle to see all the footnotes together.

I’m not in favor of the no-numbers ellipsis per se. What I want is essentially the non-inline-expansion without having the whole footnote area actually taking up space when the readers aren’t choosing to see it.

I agree that tooltip is likely an easy implementation (I’ve seen that elsewhere). If built, it should certainly be able to be turned off.

1 Like

A small error if there is a link.

v2.1.0.beta2 +75

C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2017 as ISO/IEC 14882:2017 (informally known as C++17). [^1]

[^1]: ["ISO/IEC 14882:2017"](https://www.iso.org/standard/68564.html). International Organization for Standardization.


I reverted the change which caused this, thanks.


Everything works. Thank you! :+1:


I just attempted to hide a whole block of stuff that included footnotes within a “Hide Details” block.

The result was the block being collapsed but the footnotes still present (given the normal show-at-the-end setting for the footnotes plugin).

It would be nice if footnotes within Hide Details would stay within that block.

I admit this is a quirky interaction that won’t be used in most cases.

Just installed and tried using. Like @Stranik above, this is broken for me.

Looks like the inline footnotes and separated footnotes are tied up together in the CSS and set to display: none;. Need to be separated out with appropriate display style for each. display: contents; works for separate, but breaks inline.

Hi there,
I’m trying to build up a discussion platform that will be mostly used by academics, so footnotes are crucial. Would it be possible to see the inline citations in APA style (names, not numbers), or have the (AuthorName, Year) or the whole content of the footnote show up as a tooltip, as suggested by @tophee.

Regarding the preferences of @wolftune

Wouldn’t it be possible to make this a theme component, so that on mobile you have to click to see the footnote, but on desktop you can see it on hovering?

I also agree with the footnotes being collapsible to save some space, because academic reference lists get quite big rather quickly.

Wouldn’t this also be possible with a theme component?


This discussion brought up academic footnotes. It might be interesting to see some kind of Zotero integration.

I’m not sure the footnote plugin is the right place for this, but otherwise, good idea!

Fully agreed! Right now I do custom formatting for all my Zotero citations in Discourse, but something requiring less fiddling would be lovely!

Does Zotero provide a url for each individual reference? If so, a special Zotero onebox could be a first step…

If you mean for the online collection, yes. Each reference has it’s own URL, with a weird Zotero folder name at the end similar to the Folder names on Desktop (though the folders are called differently online vs. offline). And each of the values seems to have their own class.

I’m not sure, how a one-box would help here though? Could you maybe explain how you imagine this would work or look like (screenshots are welcome :slightly_smiling_face:).

PS: Maybe we should move this discussion back to here :point_down: as you suggested @tophee