1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-21 06:36:31 +02:00

16 Commits

Author SHA1 Message Date
Võ Hoàng Long
30ae1f4f0d
Add "associated type" to glossary (#2331)
# Why
For example, while reading [this
line](3269cb9e4c/src/std-traits/operators.md (L39)),
a user may want to quickly look up what an "associated type" is.

This also helps with translations. In Vietnamese, there isn't a good
translation for this term, so keeping the original term and providing a
description of it in the glossary would be very helpful.
2024-09-02 15:32:48 +00:00
Jonathan Daniel
1c964f6fe3
Fix a broken link and check internal links (#2195)
In #2153 I aimed to fix a link but broke it.
In this PR, I fix it and add
[`mdbook-linkcheck`](https://github.com/Michael-F-Bryan/mdbook-linkcheck)
to avoid future cases.

Some past fixes that could have been prevented, in addition to mine in
this PR:
* #811
* #2064
* #2146

Note:  
`mdbook-linkcheck` may also check external links with a configuration
change.
It can be beneficial to check also external links from time to time. I
ran it here and found 3 broken links.

Maintainers - sorry for the lack of a preceding issue. We can discuss it
here.
Some remaining work is to fix the outdated internal links in the
translations, not done here.
Let me know what you think about the proposed contribution.

This PR completes #1502.
2024-07-22 11:37:19 +00:00
Dustin J. Mitchell
7c48cacf82
Fix dead link in glossary (#2114)
Fixes #2110. I think `references/strings.html` is a better choice as it
covers both String and &str.
2024-06-05 10:21:32 -04:00
Henri F
847e1a038e
Fix definition of Rust Fundamentals in glossary.md (#1844)
Small nitpick: Days 1 to **4** are Rust Fundamentals
2024-02-23 10:06:44 +01:00
Martin Geisler
8670d2f9d9
Add translation comment to glossary (#1831)
With https://github.com/google/mdbook-i18n-helpers/pull/107 merged, we
can begin adding comments for the translators to our Markdown files.
2024-02-22 15:10:01 +01:00
mobyw
6b805230c7
Add heading attribute to glossary.md (#1829)
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 <martin@geisler.net>
2024-02-20 10:00:59 +00:00
mobyw
f600b9629b
Fix style in glossary.md (#1825)
`id` of `h1` title in the translated version will be changed to the
translated text.
Fixed `id` configured here will not take effect in the translated
version.

Correct style: https://google.github.io/comprehensive-rust/glossary.html
Wrong style (zh-CN): https://google.github.io/comprehensive-rust/zh-CN/glossary.html
2024-02-19 17:17:41 +01:00
Pavel Roskin
23ba2aa42f
Glossary: add tuple, unit type, improve definition of enumeration (#1686)
Co-authored-by: Dustin J. Mitchell <dustin@v.igoro.us>
2024-01-12 14:52:26 +00:00
Martin Geisler
c9f66fd425
Format all Markdown files with dprint (#1157)
This is the result of running `dprint fmt` after removing `src/` from
the list of excluded directories.

This also reformats the Rust code: we might want to tweak this a bit in
the future since some of the changes removes the hand-formatting. Of
course, this formatting can be seen as a mis-feature, so maybe this is
good overall.

Thanks to mdbook-i18n-helpers 0.2, the POT file is nearly unchanged
after this, meaning that all existing translations remain valid! A few
messages were changed because of stray whitespace characters:

     msgid ""
     "Slices always borrow from another object. In this example, `a` has to remain "
    -"'alive' (in scope) for at least as long as our slice. "
    +"'alive' (in scope) for at least as long as our slice."
     msgstr ""

The formatting is enforced in CI and we will have to see how annoying
this is in practice for the many contributors. If it becomes annoying,
we should look into fixing dprint/check#11 so that `dprint` can annotate
the lines that need fixing directly, then I think we can consider more
strict formatting checks.

I added more customization to `rustfmt.toml`. This is to better emulate
the dense style used in the course:

- `max_width = 85` allows lines to take up the full width available in
our code blocks (when taking margins and the line numbers into account).
- `wrap_comments = true` ensures that we don't show very long comments
in the code examples. I edited some comments to shorten them and avoid
unnecessary line breaks — please trim other unnecessarily long comments
when you see them! Remember we're writing code for slides 😄
- `use_small_heuristics = "Max"` allows for things like struct literals
and if-statements to take up the full line width configured above.

The formatting settings apply to all our Rust code right now — I think
we could improve this with https://github.com/dprint/dprint/issues/711
which lets us add per-directory `dprint` configuration files. However,
the `inherit: true` setting is not yet implemented (as far as I can
tell), so a nested configuration file will have to copy most or all of
the top-level file.
2023-12-31 00:15:07 +01:00
Kanta Yamaoka (山岡幹太)
d62f2c4583
Add trait bounds to glossary (#1569)
Hi, this is a tiny MR to add glossary entry for "trait bound". Could you
someone review it? I'm open to suggeston, too. Thank you!
Context:
https://github.com/google/comprehensive-rust/pull/1436#discussion_r1394298992
2023-12-10 17:05:11 +01:00
Adrian Taylor
7f469fb2c7
Add Chromium section (#1479)
This is a contribution of a Chromium section for Comprehensive Rust.

---------

Co-authored-by: Nicole L <dlegare.1001@gmail.com>
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-11-27 18:21:19 +00:00
Anurag Sisodiya
5ffcac5bfd
Filled missing glossary terms with their explanations (#1473)
Changes Made
This Pull Request addresses issue #1466 and includes the following
changes:
Added Glossary Terms: Filled in missing glossary terms with their
respective explanations.

Context
The glossary is a crucial reference for understanding key terms in the
project. This PR enhances its completeness and readability by adding
missing terms and improving the overall formatting.

Related Issues

Fixes #1466.
2023-11-15 09:23:51 +00:00
Martin Geisler
b7832d7856
Update glossary.md (#1455)
Expand a few random entries of the glossary. This is just to remind
people that the glossary exists and that we should work on making it
complete.

Part of #1466.
2023-11-10 14:15:32 +00:00
Martin Geisler
65f6dbcd85
Fix and expand Bare-metal Rust entry in glossary (#1325)
The entry lacked the forced line-break of the other entries.
2023-10-09 11:29:14 +02:00
Martin Geisler
a7f7afa4a2
Format the glossary using a Markdown list (#1307)
This format has two advantages:

- is easier to maintain in the Markdown file. Tables cannot be wrapped
in Markdown, which would severely limit what we can write for each term.
- it can be styled better. The layout now looks more like what you find
in a dictionary.

Before:


![image](https://github.com/google/comprehensive-rust/assets/89623/26bdc39e-4c1d-4f33-90d5-a1637712bcb8)

After:


![image](https://github.com/google/comprehensive-rust/assets/89623/38c1b329-4a80-4771-b415-425a537a0388)


Followup to #1277.
2023-10-06 14:26:52 +02:00
Martin Geisler
5760e99e22
Introduce a glossary (#1277)
The goal of this is twofold: give translators a place to document how
certain terms are translated as well as giving people a place to quickly
find a definition of a term. The slides might not always give a quick
definition the same way a glossary can.
2023-10-05 07:17:24 +02:00