footnotes: background on the feature
The best explanation I’ve seen on why-not and what-next for foot notes is Matt’s summary here: Footnote (it’s also the most updated per this recent comment and my forum search)
[The excerpt/read-more feature] simply truncates the post and renders the markdown
on the initial excerpt. To fix [the lack of footnotes], we’ll need to render the markdown based
on the entire post, truncate it at the<!--more-->
tag, and make sure the footnotes
option in thewriteas/saturday
library is enabled.
goal: outline detail for development
The goal of this thread is just want to expand[^1] on Matt’s thread - hopefully get Matt’s input - on what exactly is needed, maybe even with code pointers.
As a bonus, since this has been unimplemented so long, it might be helpful to add its status to the end-user documentation (there’s both a howto
site and a guides
site - not sure which).
details expanded
-
Q1: where does the platform’s markdown logic begin in write.as codebase?
-
A: I think at this
blackfriday.Markdown(...)
call? - From the post above, I’m guessing we eventually need to pass
EXTENSION_FOOTNOTES
const into this list.
-
A: I think at this
-
Q2: where does the conflicting feature (“excerpt/more”) begin in write.as codebase?
- A: TBD
-
Q3(TBD): how to handle above-the-fold footnotes.
I could be mistaken - feel free to correct me. I’m guessing rendering footnotes as-is for excerpt mode would cause link bugs. Seems we’d cause a bug where we’d expose an anchor tag (say from the list view of a blog) with
#fn-1
, that doesn’t actually have a corresponding destination ont hat page (the list-view of the blog).-
A1: (guessing this is easier) in the “excerpt” rendering, strip the anchor tag from around the super-script of the footnotes.
-
maybe just render twice instead of truncating?
This approach makes me think Matt’s initial algorithm outline is maybe not what he’d want to go with (why hackily strip out footnotes when you can just render the post twice: once for truncated view, once for full view - the former with the flag not passed in, the latter where the flag is passed in)
-
maybe just render twice instead of truncating?
-
A2: (guessing this is harder) in the “excerpt” rendering, transform the
href
of the anchor tag to be absolute (eg: instead of being a link like#fn-1
it should behttps://full-blog.domain/...#fn-1
).-
questionable value.
Not only is this probably more work, but I’m guessing it’s of minimal value, as following a footnote from excerpt-rendering means you’re not fully engaged in the content yet. so my gut say this isn’t the right choice.
-
questionable value.
-
A1: (guessing this is easier) in the “excerpt” rendering, strip the anchor tag from around the super-script of the footnotes.
Hopefully this’ll be a helpful post. I’ll come back when I have time. Anyone should feel free to implement though I’m not claiming I will just yet.
[^1]: I’m thinking if I ran into such clear instructions, I’d maybe just try to implement it real quick and send the pull request. Maybe this thread will move the ball forward one roll, and let someone else do that.
(Discussion moved from writefreely#338)