Skip to content

Adding functions#2

Merged
douden merged 2 commits into
mainfrom
adding_functions
Jun 25, 2026
Merged

Adding functions#2
douden merged 2 commits into
mainfrom
adding_functions

Conversation

@douden

@douden douden commented Jun 25, 2026

Copy link
Copy Markdown
Member

This pull request updates the documentation in README.md to clarify the extension's behavior and configuration options, especially regarding how terms and titles are indexed from various admonition types. It also adds details about sorting and handling of footnotes in index terms.

Key documentation improvements:

  • Clarified that index entries are generated from terms in prf:definition admonitions and their titles, correcting minor typos in the introduction.
  • Added explanations about how duplicate terms are handled, how multiple references are sorted, and how footnotes in terms are removed before indexing.
  • Noted that the sorting behavior assumes the use of the Sphinx-external-toc extension and that the extension patches Sphinx's native index sorting.

Configuration option updates:

  • Expanded the sphinx_indexed_defs_index_theorems option to include prf:notation admonitions, both for inclusion and exclusion of titles in the index.
  • Introduced a new option, sphinx_indexed_defs_index_theorems_terms, to control whether terms from theorem-like admonitions (including prf:notation) are added to the index.

douden added 2 commits June 24, 2026 14:50
Introduce a new config option sphinx_indexed_defs_index_theorems_terms (default false) and update directive handlers to support indexing: only titles, only terms, or both. Add parse_only_terms and parse_title_and_terms helpers and track titles_to_index to avoid duplicate entries and prevent titles from being bolded when force_main is applied to terms. Fix directive registration for lemmas, add Notation to the list of indexable theorem types, and ensure directives return modified nodes. Minor README fixes: typo corrections, note about duplicate-term behavior, and documentation for the new config option. Also add a logger and related imports.
Remove footnotes from indexed titles and terms and add deterministic index ordering based on the external TOC and anchor positions. The extension now strips [^...] footnote markers from directive titles and removes footnote_reference nodes from term strings before indexing. A new patch_index hook is connected on builder-inited that monkeypatches IndexEntries.create_index to sort index references by document order (from Sphinx-external-toc/_toc.yml or external_toc_path) and by anchor position (preferring numeric index anchors). Helper functions build_doc_order and build_anchor_positions compute the sort keys; yaml, os and PurePosixPath imports were added. README updated with warnings about the sorting behavior and a small typo fix.
@douden douden merged commit bfced19 into main Jun 25, 2026
3 checks passed
@douden douden deleted the adding_functions branch June 25, 2026 12:18
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.

1 participant