See invitation here:
https://github.com/google/comprehensive-rust/pull/1971#issuecomment-2061199545
Also note that @enes1313 is marked as a code owner, but they are *not* a
collaborator on the repository so the code owner features are
non-functional and this is considered an error by the GH parser.
Obviously there are two possible resolutions to that...
Reverts google/comprehensive-rust#1975
Using `mdbook-pandoc` requires more than just installing the `mdbook`
plugin: it requires
- A whole LaTeX installation
- A Pandoc installation
- Some fonts
This is essentially why the output is configured as optional in
`book.toml`: the assumption is that people won't have `mdbook-pandoc`
installed without the necessary supporting tools.
@henrif75, I assume you added this because you didn't like the warning
`mdbook build` prints:
```
% mdbook build
2024-04-16 10:45:56 [WARN] (mdbook::book): The output.html.curly-quotes field has been renamed to output.html.smart-punctuation.
Use the new name in book.toml to remove this warning.
2024-04-16 10:45:56 [INFO] (mdbook::book): Book building has started
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the exerciser backend
2024-04-16 10:45:57 [INFO] (mdbook::renderer): Invoking the "exerciser" renderer
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the html backend
2024-04-16 10:45:58 [INFO] (mdbook::book): Running the pandoc backend
2024-04-16 10:45:58 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
2024-04-16 10:45:58 [WARN] (mdbook::renderer): The command `mdbook-pandoc` for backend `pandoc` was not found, but was marked as optional.
```
I don't have the necessary dependencies on my local system and this is
what I get after installing `mdbook-pandoc`:
```
2024-04-16 10:47:30 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
Unable to run `pandoc -v`: No such file or directory (os error 2)
2024-04-16 10:47:30 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-04-16 10:47:30 [ERROR] (mdbook::utils): Error: Rendering failed
2024-04-16 10:47:30 [ERROR] (mdbook::utils): Caused By: The "pandoc" renderer failed
```
This also means that `mdbook serve` doesn't work unless all dependencies
are installed.
As an alternative, we could remove the `output.pandoc` settings from the
`book.toml` file and use a small shell script to add them when needed.
We actually have the same problem for the `mdbook-xgettext` output
format which generates the POT files: we only want to run this
occasionally. This is currently done by overriding `output` from the
command line using the `MDBOOK_OUTPUT` environment variable:
```shell
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' \
mdbook build -d po
```
It's a bit ugly and it results in people missing/forgetting some of the
configuration options we want them to use (the `granularity` setting).
So I would like to move this configuration to the `book.toml` file — but
I'm reluctant since I don't think we need to generate POT files on every
build (it takes ~1 second and would slow down `mdbook serve`).
Cc @max-heller in case you have ideas here.
* Add translations for the new extracted messages related to Day 1and
Day 2 chapters;
* Fix numbering in translation of Day 4 titles;
* Use PO file translator comments for notes and reasons why one or
another choice was made, mention alternatives;
* Do not translate type and trait names;
* Rename: Поток управления -> Управляющие конструкции;
* Rename: Перечисления и сопоставление с образцом. -> Деструктуризация;
* Rename: Ссылки -> Заимствование;
* Rename: Висячие ссылки -> Изменяемые ссылки;
* Rename: Вторая половина дня -> После обеда;
* Rename: Поток управления -> `Let` в потоке управления (src: Let
Control Flow);
* Rename: Функции -> Обобщённые функции (src: Generic Functions);
* Rename: Обобщения (generics). -> Обобщённые типажи (src: Generic
Traits);
* Cannot translate `Slices: &[T]` - possible bug
#326
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).
Updates `nrf52833-hal` from 0.16.1 to 0.17.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.91 to 1.0.94
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The trait bounds aren't needed on the struct definition, only the impl
block. I think it'd be useful to show the difference here in order to
show students how trait bounds for collection types are usually on the
impl blocks rather than the type itself.
While it's generally better in Rust code to use `String` as the key type
for a `HashMap` than `&str`, for the purposes of our examples having the
extra `to_string` calls makes the example more verbose and confusing for
students. The simple example will work as-is without the `to_string`
calls, so I think it's better to just remove them.
I find that `if let` makes the most sense to use when you don't have an
`else` case, otherwise it's generally clearer to express the same thing
with a `match`. This changes the `if let` example to be (arguably) a bit
more idiomatic and less verbose.
As discovered during #1961, fixed byte offsets tend to break
translations because the translated strings can end up having a
character on the boundary where we slice.
When a PR restores the cache, it will find the most recent cache from
the `main` branch. This cache should be mostly up to date.
We are constantly at the 10 GB limit for our CI caches, so removing the
extra caches from the many PR branches should ensure that we always have
space for the `main` branch caches.
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.90 to 1.0.91
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.0.90 to 1.0.91
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I made a small mistake during the refactor in #1492: I removed the
`MDBOOK_BOOK__LANGUAGE` environment variable, which means that we ended
up testing the original Rust code snippets again and again.
This commit also fixes the few typos that have sneaked into the
translations due to the lack of testing.
* Build `messages.pot` (untracked) using `gettext` with granularity=0;
* Update `ru.po` with `msgmerge --update`;
* Make it easier to review consequent translation-centric pull requests;
#326
The translation of *Welcome to Comprehensive Rust:
(1) Running the Course*.
I have followed the [Contributing
Guidelines](b38d429e49/CONTRIBUTING.md):
- [x] Edited by Poedit
- [x] Formatted by `dprint fmt`
- [x] Submitted to the CLA
Bumps the minor group in /src/exercises/bare-metal/rtc with 1 update:
[bitflags](https://github.com/bitflags/bitflags).
Updates `bitflags` from 2.4.2 to 2.5.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the minor group with 1 update:
[reqwest](https://github.com/seanmonstar/reqwest).
Updates `reqwest` from 0.11.26 to 0.12.1
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the minor group in /src/bare-metal/aps/examples with 1 update:
[bitflags](https://github.com/bitflags/bitflags).
Updates `bitflags` from 2.4.2 to 2.5.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>