sylvainjule / kirby-footnotes Goto Github PK
View Code? Open in Web Editor NEWFootnotes plugin for Kirby 3 and 4
License: MIT License
Footnotes plugin for Kirby 3 and 4
License: MIT License
Thanks for this great plugin!
I was just giving it a try with the new blocks. And while I can get it to work within one block like so
<?php foreach ($page->thesis()->toBlocks() as $block): ?>
<?php if ($block->type() == "text" || $block->type() == "markdown"): ?>
<?= $block->text()->footnotes() ?>
<?php else: ?>
<?= $block ?>
<?php endif ?>
<?php endforeach ?>
it restarts the numbering of the footnotes with each block anew. That means I will have a footnote numbering like 1, 2, 3, 1, 2, 1, 2
etc. when I use more than one block.
It would be nice, if there would be an easy way to continue the numbering from the previous block.
Output is blank when text has no notes
First of all: Thank you for this wonderful plugin! And the fix to use it within blocks!
Now: Having square brackets [
inside a footnote breaks the footnote. Which makes sense, because the regex looking out for footnotes found a ]
and thus ends the footnote.
On the other hand: It is not unusual to have square brackets inside a footnote, e.g. [...]
or to indicate that the editor changed the exact wording of some source, resulting in something like [^Footnote [...] text]
.
I think, the regex that looks out for [^
should only end a footnote, when it finds a ]
AND in the meantime has found as many closing brackets as opening brackets it might have found in between. So after [^...[
the footnote only ends on the second ]
it finds...
Thank you four considering.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.