Skip to content

glossary: single-source glossary entries#656

Open
PLeVasseur wants to merge 51 commits intorust-lang:mainfrom
PLeVasseur:glossary-single-source-phase1
Open

glossary: single-source glossary entries#656
PLeVasseur wants to merge 51 commits intorust-lang:mainfrom
PLeVasseur:glossary-single-source-phase1

Conversation

@PLeVasseur
Copy link
Contributor

@PLeVasseur PLeVasseur commented Feb 5, 2026

Summary

  • Add glossary-entry/glossary-include directives and a generator so chapter + glossary definitions share one source of truth.
  • Integrate glossary generation into make.py/CI and add HTML diff verification for parity checks.
  • Migrate glossary content to the new directive format and document the workflow.

Closes #655

Guiding tenets

  • The generated build/generated.glossary.rst must be identical to today's glossary.rst, byte-for-byte
  • We would still commit glossary.rst to have a stable record in the repo
    • The glossary generation and commit would occur on changes to things which warranted a glossary change
    • This will be automated
  • There is a verification script I'm running during this migration
    • generated build/html must be identical, byte-for-byte
    • generated paragraph-ids.json must be identical, once accounting for ordering (as I found the build process is not deterministic in how this is generated)
  • Migrate 20 terms at a time, sanity check them, then proceed
  • Perform a final set of holistic checks

Reference alignment

  • Not applicable (workflow/tooling change).

Testing

  • Some careful checks and tests were done incrementally along the way to ensure that the build/generated.glossary.rst is identical to the src/glossary.rst.

Examples

Before (glossary-only entry in src/glossary.rst.inc):

.. _fls_f3ferow5ugp:

associated item
^^^^^^^^^^^^^^^

:dp:`fls_o5ysjk7l91ni`
An :dt:`associated item` is an :t:`item` that appears within an
:t:`implementation` or a :t:`trait`.

:dp:`fls_44vtqu7tvhi2`
See :s:`AssociatedItem`.

After (single-source entry in src/associated-items.rst):

.. glossary-entry:: associated item
   :glossary-dp: fls_f3ferow5ugp

   :glossary:
     :dp:`fls_o5ysjk7l91ni`
     An :dt:`associated item` is an :t:`item` that appears within an
     :t:`implementation` or a :t:`trait`.

     :dp:`fls_44vtqu7tvhi2`
     See :s:`AssociatedItem`.
   :chapter:
     :dp:`fls_ckzd25qd213t`
     An :t:`associated item` is an :t:`item` that appears within an
     :t:`implementation` or a :t:`trait`.

Before (glossary-only entry in src/glossary.rst.inc):

.. _fls_j44ow2k5va3s:

incomplete associated constant
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_bq48gl84bul0`
An :dt:`incomplete associated constant` is an :t:`associated constant` without
a :t:`constant initializer`.

After (glossary-only entry placed near related chapter content in
src/associated-items.rst):

.. glossary-entry:: incomplete associated constant
   :glossary-dp: fls_j44ow2k5va3s

   :glossary:
     :dp:`fls_bq48gl84bul0`
     An :dt:`incomplete associated constant` is an :t:`associated constant` without
     a :t:`constant initializer`.

Keep the static glossary in sync with generated output and verify it in CI.
Continue the phase 2 glossary migration batch.
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.

[Change]: Have a single source of truth for glossary and chapter entries of terms

1 participant