This plugin extends Kirby with some basic and extremely easy footnote functionalities. The syntax is simple to understand and if the plugin is removed the remaining text still makes sense (docs are referring to versions 1.0.0+)
Usage
Use the footnotes method on the field: $page->text()->footnotes() or $page->text()->ft(). Adding footnotes to your Kirbytext field is simple. Just type them inline in your post in square brackets like this:
[^This is a footnote.]
For example:
“In a deterritorialized context, the conventional one-to-one
relationship between state and territory is increasingly
questioned and challenged” [^Wong, L. (2002): Home away from
home? Abingdon: Routledge. Seite 171]
Always loving academic support - this seems pretty close to the existing integration of footnotes in Markdown Extra which Kirby supports out-of-the-box though – are there any added pros on using the plugin?
I think there are quite a few advantages, apart from the easier markup it also provides a method and a lot more features, but checkout the readme on GitHub: https://github.com/distantnative/footnotes
To be fair: I came up with this before being aware of the Markdown Extra footnotes. And it started mainly as a transfer of a wordpress plugin. But looking at it now, I still prefer this markup as it keeps the information right at the point where they belong in plain text and still convert them to footnotes through the plugin.
Plus methods to remove footnotes altogether (e.g. in a excerpt), to whitelist and blacklist footnotes depending on templates and (just recently added) to merge identical footnotes automatically.
If you have further ideas/suggestions, let me now!
For the stated reasons. Of course, everyone should use what they prefer and what matches their taste best. I like it this way and thought it’d be nice to share the code instead keeping it too myself. Feel free to use or not use it
The new Multimarkdown (as of release 4.3.1)syntax offers a pretty similar inline approach (docs on inline footnotes); I’m not sure if Parsedown already supports this, though – stumbled on this by accident in the Marked2 doc and thought, I’d put it up here for reference.
Thanks for sharing. I’ll see if Parsedown is supporting this in any way.
If not at all, I might consider changing the plugin to feature a similar syntax:
Also, is there a way to include the numbers within the footnotes themselves? I’d like to have a numbered list. Another suggestion would be a headline for the footnotes.
Is there a way to print the footnotes on a different div outside of the one I am using to print the body-text?
I mean, is there a way to only output the footnotes portion of a text field?
And, how do I de-activate the kirby-native footnotes if I am using your plugin? At the moment, they are being merged with the footnotes plugin, but the <ol> list is being printed.
I have a problem with the spacing of the footnotes list:
I might have messed up my css and cannot find it out why but, how can I control those spaces (margin/padding) between each ol li?
The only quick solution I found is to set a negative margin, but I would prefer not to do that.
(added borders around each ol li for easier visualisation)
Using your browser’s developer tools (Right click > Inspect element, in most browsers) should help you see what HTML elements are there and what styles are applied to them (and from where).
If your markup is just <li>Some text</li><li>Next item</li>, then it’s most likely margins applied on the li elements, or perhaps margins applied to those specific li elements.
If your markup looks like <li><p>Some text</p></li><li><p>Next item</p></li> (another common pattern), then it might be margins applied to the p elements too.