Skip to content

Conversation

@BrewingWeasel
Copy link
Contributor

This PR adds support for footnotes.
Due to the way footnotes work in Djot, I had to restructure parts of the existing code to add support for parsing footnote definition blocks and incrementing the footnote number for each reference in the generated html.

Copy link
Owner

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thank you!

I've left a question inline. I think the code would benefit from some documentation comments as it has got more complex- there's a good deal more abstraction being applied after this patch than the previous design had. This can be OK, but it makes the code harder to understand and modify in future, so we need to make it as clear as possible.

Thank you.

P.S. You sentence mining project looks really cool! Maybe one day I'll figure you how to use it for learning Irish Gaeilge :)

@BrewingWeasel
Copy link
Contributor Author

Thanks for the review!

I was able to factor out some of the abstraction because it turns out you can nest definitions (which I thought I had already checked but I guess not 🤷).
I also added some more comments and renamed some functions, so hopefully everything is more clear.

Additionally, I noticed a niche case that wouldn't be handled correctly, so I fixed that and added a test for it.

Also, best of luck with your Irish Gaeilge learning!

Copy link
Owner

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!! Fab work!

@lpil lpil merged commit ba95288 into lpil:main Jan 8, 2025
1 check passed
@BrewingWeasel BrewingWeasel deleted the add-footnote-support branch January 9, 2025 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants