1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-14 21:35:00 +02:00
Commit Graph

7 Commits

Author SHA1 Message Date
5f7e0c3f64 Allow the 'unused' category of lints (#2571)
These sort of warnings can be distracting when commenting out a few
lines of code or demonstrating some other concept. They can be
re-enabled for a code block with `warnunused`.

I filed https://github.com/rust-lang/mdBook/issues/2527 to get behavior
like this upstream.
2025-01-20 12:47:50 -05:00
999490fae4 book.js: early return if response error (#2520)
It used to have a ugly error message shows that "Playground
Communication: Cannot read properties of undefined (reading 'trim')",
which is due to the fact that the response lacks stdout attr.

Issue: #2477

Signed-off-by: Alx-Lai <alexabc722@gmail.com>
2024-12-16 09:42:52 -05:00
5f2248bb92 Add "Execution: Add stderr block" again (#2503)
Reverts google/comprehensive-rust#2479, which is a revert of #2397.

I think the problem was not related to @Alx-Lai's change, the
[Playground was
slow](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/playground.20incident.202024-12-03)
for everyone.
2024-12-06 14:21:44 +01:00
7d2bde6163 Revert "Execution: Add stderr block" (#2479)
Reverts google/comprehensive-rust#2397

I'm seeing

```
POST https://play.rust-lang.org/execute 500 (Internal Server Error)
```

on every request when trying to run code in the Playground. I'm not sure
why, but we need to revert this ASAP if others see the same.
2024-11-28 16:40:12 +01:00
beacea74ea Execution: Add stderr block (#2397)
Add a stderr block.
Pros:
  - we can make use of dbg macro in our code Cons:
  - there's a limitation that the compile message also shows

Applies patches from rust-lang/mdBook#1315 since the original change was
not merged by rust-lang.

Issue: #531

Signed-off-by: Alx-Lai <alexabc722@gmail.com>
2024-11-28 15:01:08 +01:00
e2c59ddbb5 Test translations using same source as for publish (#1492)
Before we would run `mdbook test` using the current Markdown sources.
This is subtly wrong: we publish the course using back-dated sources,
so we should therefore also run the tests using the same sources (this
ensures that the code snippets actually work).

After this commit, all translatable content lives in exactly two
directories:

- `src/`
- `third_party/`

We need to restore both directories when testing and when publishing.
This ensures consistency in the Markdown text and in the included
source code.

A new `.github/workflows/build.sh` script takes care of preparing the
two directories according to the date in the PO file (if any).

To ensure we can restore all of `third_party/` to an old commit, the
non-changing `third_party/mdbook/book.js` file has been moved to
`theme/book.js`. The file is generated by `mdbook init --theme`,
making it suitable for modification by the user (us). Symlinks have
been added to `third_party/mdbook/` to indicate that the files
ultimately came from upstream.
2024-01-04 17:04:44 +01:00
2a2f8ec94e Add book.js generated with mdbook init --theme
This allows us to customize the JavaScript used on the page.
2023-03-01 13:14:42 +01:00