Discourse footnote

official

(Sam Saffron) #1

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

image

Installation

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

About

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

Screenshots

This is how stuff looks without inline expansion:

image

This is how stuff looks with inline expansion:

image

Inline expansion is “quote” friendly and mobile friendly.


Discourse for Academic Use Features (Done and to be Done)
Repackaging a markdown.it extension as a Discourse plugin
Abbreviations and acronyms plugin
Discourse CommonMark text highlighting?
Meta annotation sidepost for bots?
Cannot Remove Bookmarked Posts
Tiles Image Gallery
(Wolftune) #2

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


#3

Hey,

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

Thanks


(Sam Saffron) #5

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.


Cannot Remove Bookmarked Posts
(Wolftune) #6

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.

(Christoph) #7

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?


(Wolftune) #8

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.


(Christoph) #9

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.


(Wolftune) #10

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.


(Evgeny) #11

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.


(Joffrey Jaffeux) #12

I reverted the change which caused this, thanks.


(Evgeny) #15

Everything works. Thank you! :+1:


(Wolftune) #16

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.


(James Hahn II) #17

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.