1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-01 23:29:38 +02:00

224 Commits

Author SHA1 Message Date
michael-kerscher
53f7660e9b
Evaluate slide size and block if they grow above a certain treshold (with exemption mechanism) (#2693)
This enables a test for the width and height of slides (excluding some
special cases completely).
The mechanism has an exemption mechanism to temporarily exempt slides
from the rules.
Even exempted slides are checked for the rule violation and once the
slides are compliant they must be removed from the exemption list to
avoid future regression (the check fails in the CI if compliant slides
are exempted!)

This also provides a good opportunity to always have an up-to-date list
of overlong slides in
[slide-exemptions.list.ts](tests/src/slides/slide-exemptions.list.ts)
that can be worked on.

The slide list is always autogenerated in the CI environment. If you want to
enable this for your local dev environment it has to be created manually.
This avoids a time consuming local test if it is not necessary.

On the CLI it can be locally used with `npm run test --
--spec=src/slide-size.test.ts` (after creating the list with
`./src/slides/create-slide.list.sh ../book/html/`).
The CI environment specifies the env var `TEST_BOOK_DIR` that is used to
specifiy the html directory so it can create the list of slides
on-the-fly, check against hardcoded exemptions and evaluate.

This is a new solution for #1464 within the new test framework. This is
related to #2234 and makes the mdbook-slide-evaluator from #2258
obsolete and should be removed as this is a not so powerful nor flexible
framework.
2025-03-18 12:50:46 +01:00
Eric Githinji
91f6de64df
Xtask (#2688)
### Background
Comprehensive Rust requires a number of tools to be installed (e.g.
mdbook and mdbook-course). As mentioned in #2509 (and discussed in
#2469) it would be nice to have a cross platform command for installing
these dependencies. Currently these are installed using a shell script
(`install-mdbook.sh`) but this isn't truly cross platform e.g. for
Windows users.

### Xtask

[xtask](https://github.com/matklad/cargo-xtask) outlines an approach for
automating tasks in a Rust project. It involves using cargo's aliasing
feature to allow us to run commands like `cargo xtask <some task>` to
perform adhoc tasks via a Rust binary that we might otherwise need a
shell script for.

In this PR we add support for a `cargo xtask install-tools` command that
will replace the `install-mdbook.sh` script and install the dependent
tools. We can potentially extend it to support for other tasks e.g.
`cargo xtask fmt`.

---------

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-03-14 12:24:08 +01:00
명이
9d7ae61322
Correct incorrect title of Korean translation (#2599)
I fixed some wrong titles in the Korean translation
2025-03-07 12:04:50 +01:00
dependabot[bot]
c48b9ec3be
Bump crate-ci/typos from 1.29.5 to 1.29.10 (#2686)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.29.5 to
1.29.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/releases">crate-ci/typos's
releases</a>.</em></p>
<blockquote>
<h2>v1.29.10</h2>
<h2>[1.29.10] - 2025-02-25</h2>
<h3>Fixes</h3>
<ul>
<li>Also correct <code>contaminent</code> as
<code>contaminant</code></li>
</ul>
<h2>v1.29.9</h2>
<h2>[1.29.9] - 2025-02-20</h2>
<h3>Fixes</h3>
<ul>
<li><em>(action)</em> Correctly get binary for some aarch64 systems</li>
</ul>
<h2>v1.29.8</h2>
<h2>[1.29.8] - 2025-02-19</h2>
<h3>Features</h3>
<ul>
<li>Attempt to build Linux aarch64 binaries</li>
</ul>
<h2>v1.29.7</h2>
<h2>[1.29.7] - 2025-02-13</h2>
<h3>Fixes</h3>
<ul>
<li>Don't correct <code>implementors</code></li>
</ul>
<h2>v1.29.6</h2>
<h2>[1.29.6] - 2025-02-13</h2>
<h3>Features</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/1200">January
2025</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/crate-ci/typos/blob/master/CHANGELOG.md">crate-ci/typos's
changelog</a>.</em></p>
<blockquote>
<h2>[1.29.10] - 2025-02-25</h2>
<h3>Fixes</h3>
<ul>
<li>Also correct <code>contaminent</code> as
<code>contaminant</code></li>
</ul>
<h2>[1.29.9] - 2025-02-20</h2>
<h3>Fixes</h3>
<ul>
<li><em>(action)</em> Correctly get binary for some aarch64 systems</li>
</ul>
<h2>[1.29.8] - 2025-02-19</h2>
<h3>Features</h3>
<ul>
<li>Attempt to build Linux aarch64 binaries</li>
</ul>
<h2>[1.29.7] - 2025-02-13</h2>
<h3>Fixes</h3>
<ul>
<li>Don't correct <code>implementors</code></li>
</ul>
<h2>[1.29.6] - 2025-02-13</h2>
<h3>Features</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/1200">January
2025</a> changes</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="db35ee91e8"><code>db35ee9</code></a>
chore: Release</li>
<li><a
href="9f43c4dbd2"><code>9f43c4d</code></a>
docs: Update changelog</li>
<li><a
href="a1da2ce137"><code>a1da2ce</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/1244">#1244</a>
from epage/containment</li>
<li><a
href="d74d5fd5ad"><code>d74d5fd</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/1243">#1243</a>
from epage/dict</li>
<li><a
href="fa6122604f"><code>fa61226</code></a>
refactor(dict): Drop a dict</li>
<li><a
href="6276d585f7"><code>6276d58</code></a>
fix(dict): Correct contaminents to another spelling</li>
<li><a
href="07c9e1f6fa"><code>07c9e1f</code></a>
chore(deps): Update Rust Stable to v1.85 (<a
href="https://redirect.github.com/crate-ci/typos/issues/1241">#1241</a>)</li>
<li><a
href="71643b1191"><code>71643b1</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/1240">#1240</a>
from szepeviktor/patch-1</li>
<li><a
href="931a5804a4"><code>931a580</code></a>
Fix typo in README</li>
<li><a
href="c5137fd6aa"><code>c5137fd</code></a>
refactor(action): Isolate unique parts</li>
<li>Additional commits viewable in <a
href="https://github.com/crate-ci/typos/compare/v1.29.5...v1.29.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crate-ci/typos&package-manager=github_actions&previous-version=1.29.5&new-version=1.29.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 13:19:01 +01:00
michael-kerscher
715a23e7a8
Create install-mdbook.sh and lock to the current versions used in the CI (#2626)
Move mdbook installation into a script and use exact versions from the
CI.
Update README.md to instruct developers to use the same versions as the
CI to sync both environments.
This is related to #2620 and it fixes #2588
2025-02-05 15:33:28 +01:00
dependabot[bot]
9821e811f4
Bump crate-ci/typos from 1.29.0 to 1.29.5 (#2612)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.29.0 to
1.29.5.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-01 18:13:54 +00:00
Max Heller
bcbe6b0876
Fix incorrectly hidden lines in Rust code blocks in PDFs (#2565)
Upgrades `mdbook-pandoc` to pull in a fix relating to hidden lines in
Rust code blocks. The bug was causing lines like `#[test]` to be hidden
when they should not have been.

## HTML
<img width="500" alt="Screenshot 2025-01-18 at 12 50 26 PM"
src="https://github.com/user-attachments/assets/c3363696-6ab6-4537-8285-fad047cb384f"
/>

## PDF (before)
<img width="500" alt="Screenshot 2025-01-18 at 12 51 25 PM"
src="https://github.com/user-attachments/assets/19539a9b-db24-41c5-98be-87d5a6228423"
/>

## PDF (after)
<img width="500" alt="Screenshot 2025-01-18 at 12 52 25 PM"
src="https://github.com/user-attachments/assets/b19f1e6c-d717-449e-8799-c56d9b5401ca"
/>
2025-01-19 01:45:22 -05:00
Max Heller
9493a8deb7
Fix missing images and Arabic fonts in course PDFs (#2544)
Let's give #2531 another try
- Fixes missing images in PDFs (those specified as <img> elements)
- Configures Arabic fonts

[The
fix](https://github.com/max-heller/mdbook-pandoc/pull/144/files#diff-b17b0f99aa22ee1ccf99778ca74c3c7a27af87f41544194cc95f82c012e8a507)
for the Persian translation issue, if you're curious.
2025-01-14 17:23:30 +01:00
kweber
0c91136396
de: synchronize the German translation (#2543)
I want to contribute to German translation, so i set up the complete
toolchain and git project for proper operation. This is my initial
commit to verify, that all is correct and i can continue.
2025-01-14 11:00:30 +01:00
michael-kerscher
34920c76e6
tests: hello world playground run with success and failure tests (#2513)
Implement two tests for the rust playground:
- successful run of the hello world example with the hello world message
in stdout and a hidden stderr
- on purpose compilation error is shown in stderr and "No output" in
stdout
2025-01-14 10:44:23 +01:00
Martin Geisler
76e2cfe53e
Revert "Upgrade mdbook-pandoc to fix missing images in PDFs" (#2540)
Reverts google/comprehensive-rust#2531

This accidentally broke the build because the Persian translation
doesn't build with this version.
2025-01-05 11:15:20 -05:00
Max Heller
d4cc29ff0e
Upgrade mdbook-pandoc to fix missing images in PDFs (#2531)
[`mdbook-pandoc`
0.8](https://github.com/max-heller/mdbook-pandoc/releases/tag/v0.8.0)
now supports `<img>` elements in raw HTML, fixing a few missing images
in the PDF versions of the course.
2025-01-02 08:52:42 +00:00
dependabot[bot]
3ffd55ca52
Bump crate-ci/typos from 1.28.1 to 1.29.0 (#2536)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.28.1 to
1.29.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:34:59 +01:00
michael-kerscher
48b2b5c312
Add a test framework to test the JS part of the course (#2471)
This is a first draft for a test framework for testing the JS part of
the book that is discussed in #2462

It is using [webdriverIO](https://webdriver.io/) and the webdriverIO
[Expect API](https://webdriver.io/docs/api/expect-webdriverio/) in
combination with [Mocha](https://mochajs.org/). WebdriverIO is taking
care of accessing the webpage with a real browser and can access the
state of the page so behavior can be asserted.

Currently only a small test for the speaker-notes implementation demos
the functionality.

The [Static Server
Service](https://webdriver.io/docs/static-server-service/) is used to
serve the book in a way that the test runner can access it.

A CI integration can look like https://webdriver.io/docs/githubactions/
and is implemented with a headless setup. In CI it uses the language
variable to set environment variable that configures where the built
book should be mounted from

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-12-04 09:06:58 +00:00
dependabot[bot]
bf8e642bcf
build(deps): bump crate-ci/typos from 1.26.8 to 1.28.1 (#2485)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.26.8 to
1.28.1.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 20:41:39 +00:00
Martin Geisler
7f59978a0a
Update Rust before setting up the cache (#2460)
The cache is keyed on the Rust version used, so we should update Rust
before setting up the cache.

This is a small update to #2449.
2024-11-12 10:26:42 +01:00
dependabot[bot]
5a57631911
build(deps): bump crate-ci/typos from 1.24.6 to 1.26.8 (#2451)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.24.6 to
1.26.8.
2024-11-01 13:54:06 +00:00
Andrew Walbran
f8882190f3
Updates for Rust 1.82 (#2449)
Rust 1.82 adds `&raw` expressions, and marks some attributes as unsafe.
2024-11-01 08:39:56 +01:00
dependabot[bot]
259220ba88
build(deps): bump crate-ci/typos from 1.24.3 to 1.24.6 (#2389)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.24.3 to
1.24.6.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 14:00:39 +01:00
Martin Geisler
a1e7f728c4
Lower dependabot frequency to monthly (#2329)
We are not super dependent on using the latest patch releases of every
crate, so a monthly update frequency should be more than enough.

Note that we still get PRs if/when there is a [security
update](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#scheduleinterval).
2024-09-02 17:21:02 +02:00
dependabot[bot]
5f51537c3e
build(deps): bump crate-ci/typos from 1.24.1 to 1.24.3 (#2342)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.24.1 to
1.24.3.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 10:06:33 +01:00
dependabot[bot]
a360ee6820
build(deps): bump crate-ci/typos from 1.23.6 to 1.24.1 (#2315)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.23.6 to
1.24.1.
2024-08-26 09:41:33 -04:00
Dustin J. Mitchell
cae5cb05e8
Remove course-schedule workflows (#2268)
These are complicated and not especially useful.
2024-08-08 16:07:03 -04:00
dependabot[bot]
240132eabd
build(deps): bump crate-ci/typos from 1.23.5 to 1.23.6 (#2264)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.23.5 to
1.23.6.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 11:30:54 +01:00
Alix
655b553abd
[fa] day 1 (#2252)
https://github.com/google/comprehensive-rust/pull/2238 CLA fix
2024-07-30 22:31:04 +03:30
dependabot[bot]
b3bbf6ceda
Bump crate-ci/typos from 1.23.2 to 1.23.5 (#2255)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.23.2 to
1.23.5.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 09:41:10 +00:00
Jonathan Daniel
4c28a9253b
Set Rust caching key per language group (#2250)
Fixes #2247 (a follow-up from #2195).

* Add a workflow dispatch manual trigger to the tests workflow.
* Move the link-checked languages JSON list to the build job's env.
* Set a caching key per language group to avoid extra `mdbook-linkcheck`
installation on non-link-checked translations.
  For the meaning of this key, see:
https://github.com/Swatinem/rust-cache?tab=readme-ov-file#example-usage
* Fix newly broken web link in 8a3ed21  

I tested it on my fork, and it looks good:
https://github.com/jond01/comprehensive-rust/actions/workflows/build.yml
https://github.com/jond01/comprehensive-rust/actions/caches
2024-07-29 10:28:12 +01: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
Andrew Walbran
92de96f066
Fix direction of translation diff. (#2235)
It was showing the diff from new to old, rather than old to new.
2024-07-19 15:28:34 +00:00
Max Heller
df2076b111
Upgrade mdbook-pandoc and disable it except during CI workflows (#2212)
Implements the approach summarized in
https://github.com/google/mdbook-i18n-helpers/issues/200#issuecomment-2220035461
to disable running `mdbook-pandoc` even if it is available to avoid
dependency-related issues during local rendering.

Should address https://github.com/google/comprehensive-rust/issues/1911
since `mdbook-pandoc` will no longer run locally.
2024-07-18 13:01:25 +02:00
dependabot[bot]
054169992e
build(deps): bump crate-ci/typos from 1.23.1 to 1.23.2 (#2230)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.23.1 to
1.23.2.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 10:33:11 +01:00
Andrew Walbran
d1b82a8e5c
Diff translations on every PR (#2214)
This uses a new mode of `i18n-report` to summarise the differences in
translations as an action on each PR.
2024-07-13 12:26:16 +01:00
Henri F
538f6eb680
Prune CODEOWNERS file (#2210)
Removed users without access to the repository.
#2050
2024-07-10 08:59:49 +02:00
Andrew Walbran
b68f563e45
Martin prefers hyphens to underscores (#2207) 2024-07-09 09:19:16 -04:00
Andrew Walbran
82b9f6950b
Fix publish workflow for synced translation report (#2203)
Building the synced translation report requires gettext for `msgmerge.`
2024-07-08 15:31:20 +00:00
Andrew Walbran
c39b6b01d7
Publish report of translation status. (#2190) 2024-07-08 10:51:14 -04:00
dependabot[bot]
da7d40a553
build(deps): bump crate-ci/typos from 1.22.9 to 1.23.1 (#2202)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.22.9 to
1.23.1.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:56:52 +01:00
Henri F
5899752873
Add workflow support for Arabic translation (#2194)
Part of : #445, #2193
2024-07-08 08:51:52 +01:00
Younies Mahmoud
a976603da5
First step in Arabic Translation (#2193)
Part of : #445
2024-07-05 22:40:03 -07:00
Andrew Walbran
5db15cccb6
Publish all languages. (#2189) 2024-07-05 11:11:12 -07:00
Andrew Walbran
2de95fa2de
Fix publish workflow (#2171)
Need to `apt-get update` before `apt-get install`.
2024-06-25 09:42:16 -04:00
dependabot[bot]
c7425f91c4
build(deps): bump crate-ci/typos from 1.22.7 to 1.22.9 (#2162)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.22.7 to
1.22.9.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:48:20 +01:00
dependabot[bot]
a89a4d70ca
build(deps): bump crate-ci/typos from 1.22.3 to 1.22.7 (#2149)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.22.3 to
1.22.7.
2024-06-17 09:10:02 -04:00
dependabot[bot]
53daee6993
build(deps): bump crate-ci/typos from 1.21.0 to 1.22.3 (#2134)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.21.0 to
1.22.3.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:06 +01:00
Darkhan Kubigenov
f337c0f70d
Upgrade dependencies in github actions (#2101) 2024-05-28 10:49:12 +02:00
Alexandra Imbrisca
3d999663ac
Add @AlexandraImbrisca to CODEOWNERS (#2091)
Co-authored-by: Martin Geisler <martin@geisler.net>
2024-05-22 11:17:25 +02:00
Razvan Musaloiu-E
23c5f66758
Add razvanm CODEOWNERS for ro.po (#2090) 2024-05-22 11:15:40 +02:00
Henri F
6b1b024a47
Update CODEOWNERS with new vi.po reviewer (#2051)
Ignored unrelated failing tests.
2024-05-21 20:30:17 -07:00
Martin Geisler
3d99e1badf
Retire @suetfei as zh-CN reviewer (#2059)
I talked with Suet-fei and she told me that she does not have time to
review the translation.

Thanks for the help!
2024-05-06 09:13:30 -07:00
dependabot[bot]
43f910aa41
build(deps): bump crate-ci/typos from 1.20.10 to 1.21.0 (#2055)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.10
to 1.21.0.
2024-05-06 09:34:29 -04:00