Skip to content

Add sticky headings and optimize preprocessor performance#17

Merged
samuelduchesne merged 3 commits into
feature/charming-matsumotofrom
claude/feature/charming-matsumoto-fcopl
Feb 27, 2026
Merged

Add sticky headings and optimize preprocessor performance#17
samuelduchesne merged 3 commits into
feature/charming-matsumotofrom
claude/feature/charming-matsumoto-fcopl

Conversation

@samuelduchesne
Copy link
Copy Markdown
Contributor

This pull request introduces improvements to the documentation site's object navigation and performance optimizations in the LaTeX preprocessor. The most significant changes are the addition of visual separators and sticky headings for IDF objects in the rendered documentation, and a more efficient approach to expanding bracket macros in the LaTeX preprocessor.

Documentation UI/UX improvements:

  • Added a visual <hr class="idf-object-separator"> separator between consecutive IDF objects in the generated markdown to visually segment long group pages. [1] [2]
  • Introduced new CSS rules in idf-fields.css to style the object separators and make object headings (h2/h3 after a separator) sticky while scrolling, improving navigation within long documentation pages.

Performance and code improvements:

  • Optimized the _expand_all_bracket_macros function in latex_preprocessor.py to use regular expressions for locating macros, significantly improving performance on large files and ensuring correct handling of nested macros.

Development tooling:

  • Added pyinstrument as a development dependency for profiling Python code.

… bottleneck

Visual: inject <hr class="idf-object-separator"> between IDF objects on IO
Reference group pages so long pages have clear visual breaks.  The heading
immediately after each separator becomes position:sticky, staying visible
while scrolling through that object's fields.

Performance: rewrite _expand_all_bracket_macros() to use regex search
instead of character-by-character scanning.  The old code created a
substring slice on every iteration (`text[i:].startswith(…)`), making it
O(n²) for large LaTeX files.  The new version jumps directly to the next
macro via re.search(), reducing single-version conversion from ~632 s to
~86 s (7.3× faster).

Also adds pyinstrument as a dev dependency for future profiling.

https://claude.ai/code/session_01BFFEpg2Hxz1hHr8JDZ1P6Y
Ignore downloaded binary packages (e.g. pandoc .deb from pypandoc).

https://claude.ai/code/session_01BFFEpg2Hxz1hHr8JDZ1P6Y
@samuelduchesne samuelduchesne merged commit 51a04f3 into feature/charming-matsumoto Feb 27, 2026
3 of 4 checks passed
@samuelduchesne samuelduchesne deleted the claude/feature/charming-matsumoto-fcopl branch February 27, 2026 11:42
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