Skip to content

Commit

Permalink
Add heading attribute to glossary.md (#1829)
Browse files Browse the repository at this point in the history
Add heading attributes[1] to avoid ID changes in translation.

[1]: https://rust-lang.github.io/mdBook/format/markdown.html#heading-attributes

Related: #1825

---------

Co-authored-by: Martin Geisler <[email protected]>
  • Loading branch information
mobyw and mgeisler authored Feb 20, 2024
1 parent f600b96 commit 6b80523
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/glossary.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# Glossary
<!-- i18n:comment Please keep { #glossary } untranslated. -->

# Glossary { #glossary }

The following is a glossary which aims to give a short definition of many Rust
terms. For translations, this also serves to connect the term back to the
English original.

<style>
h1 ~ ul {
h1#glossary ~ ul {
list-style: none;
padding-inline-start: 0;
}

h1 ~ ul > li {
h1#glossary ~ ul > li {
/* Simplify with "text-indent: 2em hanging" when supported:
https://caniuse.com/mdn-css_properties_text-indent_hanging */
padding-left: 2em;
text-indent: -2em;
}

h1 ~ ul > li:first-line {
h1#glossary ~ ul > li:first-line {
font-weight: bold;
}
</style>
Expand Down

0 comments on commit 6b80523

Please sign in to comment.