Show HN: A new way to do footnotes(try.scroll.pub)
https://try.scroll.pub/#scroll%0A%20%23%20Footnotes%20beta%20test%0A%20%0A%20*%20This%20demo%20shows%20a%20new%20idea%20for%20how%20to%20do%20footnotes%20in%20Scroll%5Escroll.%0A%20%0A%20%5Escroll%20Scroll%20is%20a%20new%20language%20and%20static%20site%20publishing%20tool.%20It%20is%20an%20extensible%20alternative%20to%20markdown.%0A%20%20https%3A%2F%2Fscroll.pub%20Scroll%0A%20%0A%20*%20Scroll%20was%20started%20by%20a%20kid%20from%20Brockton%20which%20is%20a%20city%20in%20Massachusetts%5Estate.%20Brockton%20was%20incorporated%20in%201881%5Einc.%20%0A%20%20https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FBrockton%2C_Massachusetts%20Brockton%0A%20%0A%20%5Estate%20A%20state%20in%20the%20United%20States.%0A%20%0A%20%5Einc%20Brockton%20was%20incorporated%20as%20a%20city%20in%201881%2C%20but%20as%20a%20town%20in%201821.%20Wikipedia.%0A%20%20https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FBrockton%2C_Massachusetts%20Wikipedia%0A%20%0A%20%23%23%20Footnotes%0A%20%0A%20notes
38 comments
Dirk Eddelbuettel and Jonathan Gilligan have an R package (https://cran.r-project.org/web/packages/tint/vignettes/tintH...) that shows footnotes and many other objects in the sidetones. I like that format as well. But it is static and doesn't't change dynamically like this one in the French website you have linked to.
Some nice things:
* The footnotes are off to the side, so it's closer to the text that mentions it and it doesn't interrupt the flow of the main text.
* It uses colors, so it's pretty fast to visually jump to the right one.
* We keep the numbers too, for colorblind folks (and those using blue-light filters like f.lux)
* It works without javascript!
Our markdown->html renderer makes this happen by slicing up the page horizontally, one slice per header. Each slice then has a wide left column for the main text, and a narrow right column for the footnotes. Then if the user happens have javascript enabled, it position:absolute's the footnotes and lines them up a little more precisely with where they're mentioned.
I think the colors idea is good too. Some stuff for us to play with in the future.
Thanks for sharing!
[1]: https://www.markdownguide.org/extended-syntax/
This made me laugh. I appreciate you.
> but with a harder to parse grammar
Grammar is actually quite simple once you've mastered the Grammar language (https://pldb.com/languages/grammar.html) which has almost no documentation and is full of bugs.
> what is the advantage of this over the existing Markdown syntax for footnotes[1]
I can't speak definitively yet. I think it will be better but I need to use it for a few months to be sure. There are some subtle things I think will be important.
In case I came across as overly negative: I think the overall syntax and project here are very cool. I’ll be following your work!
This is some text with a footnote.[^1]
[^1]: And that's the footnote.
[0] https://gohugo.io/
https://htmlpreview.github.io/?https://github.com/jgm/djot/b...
https://djot.net
Here's the same sample as OP in Markdown Footnotes syntax. There is a link to the rendered page [2].
https://gist.githubusercontent.com/richsuca/f5a14ed9cb76e7ad...
[1] https://python-markdown.github.io/extensions/footnotes/ [2] https://gist.github.com/richsuca/f5a14ed9cb76e7ad2f4f6b11361...
I think I'll copy some of the style from yours. I really like the smaller font size for the notes, the different font color, and in particular the link back to where the note was used! Double linked list, I love it!
Stylistically I like the more minimal look of (the lack of brackets, and I think n may change link color to black): https://ab1908.github.io/2021/08/24/footnotes-in-web-content...
https://github.com/breck7/tryscroll/issues/3
[Error] SyntaxError: Unexpected token '='. Expected an opening '(' before a method's parameter list. (anonymous function) (libs.js:16558)
[Error] ReferenceError: Can't find variable: AbstractTreeComponent Global Code (app.js:4)
[Error] ReferenceError: Cannot access uninitialized variable. (anonymous function) (try.scroll.pub:17)
This makes perfect sense, because notes semantically really are links from one piece of content to another.
My URLs must always be delimited in angle brackets <…>, and links can be either <url> or [contents <url>]. (I haven’t settled on a syntax I like for reference-style links.) This fits in very nicely with caret starting note references. You can have [spanned notes <^…>] and spanless notes<^…>. (I also reckon on the identifier being optional, so that <^> would be valid, just using the next note body.) This syntax is generically useful for sidenotes, footnotes, endnotes and other presentations of notes—in general, I reckon note presentation should be a presentational rather than a content concern.
(Aside: what people on the web call “footnotes” are almost always actually endnotes. Endnotes are typically ergonomically poor in both print and screen media. Something along the lines of proper footnotes or inline-expandable notes mostly requires JavaScript, though with effort, restrictions about whether the content can contain blocks, and perhaps careful tip-toeing around HTML parser implementation details (or deliberately using XML syntax if you’re bold enough) and a mild disregard for nominal validity, you can do it even semantically reasonably without JavaScript.)
I reckon most notes should be spanned. To demonstrate what I mean, https://chrismorgan.info/blog/rust-ownership-the-hard-way/ shows three types of sidenotes: spanned with an inline source marker, unspanned with an inline source marker, and full block asides which are unspanned. To see my vision most clearly you’ll need a large enough viewport; on small viewports, I currently have the notes inline, with the third type aside, and I’m not happy with the in-flow placement of the asides, which is mostly a paragraph or so above the ideal place, but wanted it to all be pure CSS.
Then I started wondering, how many potentially viable characters are there like this, that can’t appear at the start of properly-serialised URLs? Could they be purpose for something else? You start with all Unicode scalar values, then remove (a) all URL code points <https://url.spec.whatwg.org/#url-code-points>, because they’re valid in URLs; (b) C0 and C1 control codes because non-printables is an extremely terrible idea for normal people; (c) `#`, as it’s used to begin fragments; (d) `%`, as it’s used for percent-encoding bytes. This leaves: "<>[\]^`{|} and space. Most of them would be a bad idea for various reasons, even if they’d work; ^ and | are the only two that seem reasonable to me.
So, ^ for notes. Haven’t thought of anything that fits similarly that pipe could certainly be used for. Could possibly use it for reference-style links, but that’d still be clunky (I would like to support […] matching, not needing [… <|refname>)).