Repository navigation
Add a pure-Rust makeindex engine and run it in the processing pipeline - #1404
Draft
yuhuishi-convect wants to merge 4 commits into
Draft
yuhuishi-convect wants to merge 4 commits into
yuhuishi-convect wants to merge 4 commits into
Conversation
Avoid cloning generated index bytes when storing them, tighten the nomencl assertion, and keep the driver changes split into reviewable commits.
yuhuishi-convect
force-pushed
the
makeindex-support
branch
from
October 18, 2026 06:43
a31de8b to
aa4b2a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an initial, clean-room implementation of
makeindexas a new Tectonic engine crate, plus driver integration. It addresses the lack of index support discussed in #115, and provides the external index pass that #704 (glossaries) and #875 (nomencl) currently work around manually.The implementation is written from the documented makeindex input/output formats and the makeindex manual. It does not copy the MakeIndex C source or the unlicensed c2rust port, so it can be distributed under Tectonic's MIT license.
Review guide
The branch is intentionally split into reviewable commits:
.idx→.indonly..nlo,.glo,.acnmapping.If the full change is too large for one PR, I'm happy to split it into stacked PRs: engine crate first, then
.idxintegration, then nomencl/glossaries.What it does
crates/engine_makeindex(tectonic_engine_makeindex), a pure-Rust.idx→.indprocessor..istfiles, including the directives used bynomencl.istand the style files generated byglossaries.\indexentry{...}{...}and configurable keywords@actual/sort keys,!subitems (3 levels), quote/escape characters\textbf{...},see{...}, explicit|(/|)ranges)headings_flag,lethead_*) and theitem_01/item_x1/item_12/item_x2transitionsProcessingSession::default_pass:.idx→.ind.nlo→.nlswithnomencl.ist.glo→.glsand.acn→.acrwith the generated<jobname>.ist.ind/.nls/.gls/.acras intermediates, and.ilgas a logValidation
cargo test -p tectonic_engine_makeindex— 9 tests covering nested entries, transition commands, page ranges, encapsulators, style escapes, nomencl and glossaries styles.cargo test -p tectonic --lib makeindex_tests— extension mapping.\makeindex/\printindex: index appears in the PDFnomencl: nomenclature appears in the PDFglossaries: glossary appears in the PDFcargo fmt --all -- --checkpasses.cargo clippy -p tectonic_engine_makeindex --all-targetsis clean.Current scope / follow-ups
This is deliberately a first step, not full makeindex parity:
-gGerman ordering,-lletter ordering, locale collationline_max/indent_space)-pstarting page numbers and.mstdefault-style lookupmakeglossaries/bib2glsthemselves (this PR only runs makeindex-style processing; bib2gls is a separate Java tool)Happy to split this up, adjust the engine API, or extend any of the above. Since CONTRIBUTING asks for design discussion before substantial changes, I'm opening this as a draft for feedback.
Fixes #115.