-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render footnotes #90
base: main
Are you sure you want to change the base?
Render footnotes #90
Conversation
Thank you for your PR(s). I've merged all the prerequisites to land footnote support in Zine, but for this last integration step I want to move in a different direction compared to what this PR does. More specifically, direct integration forces the renderer to make too many decisions about how the HTML should look like. We should strive to minimize the amount of hardcoded IDs, classes and data attributes we generate. I've put my design idea and suggestions in #92. Feel free to update this PR towards that design or to start a new one as you see fit. If you do open a new PR, please close this one first. If you decide to continue working on this, I'm happy to answer questions in both the aforementioned Issue and Discord as well. |
I haven't tested docgen yet, but rendering works. |
Docgen is working correctly now. I compared the output with the original, and the only differences are the additions of
|
Fixed for real. This time I checked the docgen output and tested the |
We can't render footnote definitions by calling
cmark_render_html
on each node separately, because that function relies upon counting footnotes definitions as it writes them. Instead, I mostly duplicated cmark-gfm's rendering logic; the only (intentional) differences are that I did not escapehref
attributes in footnote links (though this should probably be done eventually), and I didn't bother putting in all the whitespace around elements that cmark-gfm does.This depends upon kristoff-it/supermd#9, and build.zig.zon will need to be updated once that is merged.