Skip to content
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

Add footnotes #1832

Merged
merged 40 commits into from
Apr 28, 2024
Merged

Add footnotes #1832

merged 40 commits into from
Apr 28, 2024

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Apr 25, 2024

Summary:

This PR adds support for footnotes. It uses a [footnote:key] shortcode where the footnote marker is added, and where key is a unique key. The footnote text is defined by a comment line on the format: %Footnote.key: Footnote text. The footnote text must be placed in the same document.

The footnote key is generated when a footnote is inserted from the menu. There are 810000 possible keys with the implemented algorithm, and it will look for collisions in active documents. However, documents in Trash and Archive are not indexed, so it is possible to have collisions. The unique keys between documents are mostly to help avoiding collisions when merging documents with footnotes.

Footnotes are currently exported to ODT, HTML and Markdown.

In addition, this PR:

  • Allows formatting in comments, including regular comments. These were previously not allowed, but are needed in footnotes.
  • Adds syntax highlighting for formatting in comments.

ToDo:

  • Ensure that the footnotes are not polluted between documents, even if the key is unique.
  • Make sure synopsis and short comments have the formatting stripped in the index.
  • Look into adding a different highlight colour for comment text for special comments.
  • Add test coverage of new code.

Related Issue(s):

Closes #342

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.5 Beta 1 milestone Apr 25, 2024
@vkbo vkbo merged commit 8beb746 into main Apr 28, 2024
8 checks passed
@vkbo vkbo deleted the features/footnotes branch April 28, 2024 17:40
@vkbo vkbo mentioned this pull request Apr 28, 2024
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.

Footnotes
1 participant