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.
Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/labeler/releases">actions/labeler's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<h2>What's Changed</h2>
<p>This release contains the following breaking changes:</p>
<ol>
<li>
<p>The ability to apply labels based on the names of base and/or head
branches was added (<a
href="https://redirect.github.com/actions/labeler/issues/186">#186</a>
and <a
href="https://redirect.github.com/actions/labeler/issues/54">#54</a>).
The match object for changed files was expanded with new combinations in
order to make it more intuitive and flexible (<a
href="https://redirect.github.com/actions/labeler/issues/423">#423</a>
and <a
href="https://redirect.github.com/actions/labeler/issues/101">#101</a>).
As a result, the configuration file structure was significantly
redesigned and is not compatible with the structure of the previous
version. Please read the <a
href="https://github.com/actions/labeler/tree/main#pull-request-labeler">action
documentation</a> to find out how to adapt your configuration files for
use with the new action version.</p>
</li>
<li>
<p>The bug related to the <code>sync-labels</code> input was fixed (<a
href="https://redirect.github.com/actions/labeler/issues/112">#112</a>).
Now the input value is read correctly.</p>
</li>
<li>
<p>By default, <code>dot</code> input is set to <code>true</code>. Now,
paths starting with a dot (e.g. <code>.github</code>) are matched by
default.</p>
</li>
<li>
<p>Version 5 of this action updated the <a
href="https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions">runtime
to Node.js 20</a>. All scripts are now run with Node.js 20 instead of
Node.js 16 and are affected by any breaking changes between Node.js 16
and 20.</p>
</li>
</ol>
<p>For more information, please read the <a
href="https://github.com/actions/labeler/tree/main#pull-request-labeler">action
documentation</a>.</p>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/joshdales"><code>@joshdales</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/labeler/pull/203">actions/labeler#203</a></li>
<li><a
href="https://github.com/dusan-trickovic"><code>@dusan-trickovic</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/labeler/pull/626">actions/labeler#626</a></li>
<li><a href="https://github.com/sungh0lim"><code>@sungh0lim</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/labeler/pull/630">actions/labeler#630</a></li>
<li><a
href="https://github.com/TrianguloY"><code>@TrianguloY</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/labeler/pull/629">actions/labeler#629</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/labeler/compare/v4...v5.0.0">https://github.com/actions/labeler/compare/v4...v5.0.0</a></p>
<h2>v5.0.0-beta.1</h2>
<h2>What's Changed</h2>
<p>In scope of this beta release, the structure of the configuration
file (<code>.github/labeler.yml</code>) was changed from</p>
<pre lang="yml"><code>LabelName:
- any:
- changed-files: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
- all:
- changed-files: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
</code></pre>
<p>to</p>
<pre lang="yml"><code>LabelName:
- any:
- changed-files:
- AnyGlobToAnyFile: ['list', 'of', 'globs']
- AnyGlobToAllFiles: ['list', 'of', 'globs']
- AllGlobsToAnyFile: ['list', 'of', 'globs']
- AllGlobsToAllFiles: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
- all:
- changed-files:
- AnyGlobToAnyFile: ['list', 'of', 'globs']
- AnyGlobToAllFiles: ['list', 'of', 'globs']
- AllGlobsToAnyFile: ['list', 'of', 'globs']
</tr></table>
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8558fd7429"><code>8558fd7</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/labeler/issues/709">#709</a>
from actions/v5.0.0-beta</li>
<li><a
href="000ca75fe6"><code>000ca75</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/labeler/issues/700">#700</a>
from MaksimZhukov/apply-suggestions-and-update-docume...</li>
<li><a
href="cb66c2f078"><code>cb66c2f</code></a>
Update dist</li>
<li><a
href="9181355e36"><code>9181355</code></a>
Apply suggestions for the beta vesrion and update the documentation</li>
<li><a
href="efe4c1c90e"><code>efe4c1c</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/labeler/issues/699">#699</a>
from MaksimZhukov/update-node-runtime-and-dependencies</li>
<li><a
href="c0957ad7c3"><code>c0957ad</code></a>
Run Prettier</li>
<li><a
href="8dc8d1842f"><code>8dc8d18</code></a>
Update Node.js version in reusable workflows</li>
<li><a
href="d0d0bbebfb"><code>d0d0bbe</code></a>
Update documentation</li>
<li><a
href="1375c42512"><code>1375c42</code></a>
5.0.0</li>
<li><a
href="ab7411ec21"><code>ab7411e</code></a>
Change version of Node.js runtime to node20</li>
<li>Additional commits viewable in <a
href="https://github.com/actions/labeler/compare/v4...v5">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/labeler&package-manager=github_actions&previous-version=4&new-version=5)](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>
Co-authored-by: Martin Geisler <martin@geisler.net>
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.9 to
1.16.26.
<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.16.26</h2>
<h2>[1.16.26] - 2023-12-27</h2>
<h3>Fixes</h3>
<ul>
<li>Apply <code>extend-ignore-re</code> to file names in addition to
file content</li>
</ul>
<h2>v1.16.25</h2>
<h2>[1.16.25] - 2023-12-13</h2>
<h3>Fixes</h3>
<ul>
<li>Have correction in <code>extend-words</code> match the original
word's case</li>
</ul>
<h2>v1.16.24</h2>
<h2>[1.16.24] - 2023-12-08</h2>
<h3>Fixes</h3>
<ul>
<li>Don't silently ignore config when there is an error in a field</li>
</ul>
<h2>v1.16.23</h2>
<h2>[1.16.23] - 2023-11-06</h2>
<h3>Fixes</h3>
<ul>
<li>Ensure <code>--force-exclude</code> handles simple patterns like
<code>some-dir</code></li>
</ul>
<h2>v1.16.22</h2>
<h2>[1.16.22] - 2023-11-01</h2>
<h3>Fixes</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/843">October
2023</a> changes</li>
</ul>
<h2>v1.16.21</h2>
<h2>[1.16.21] - 2023-10-27</h2>
<h3>Fixes</h3>
<ul>
<li>Improve colored output</li>
<li>Don't correct <code>SHTTP</code> to <code>HTTPS</code></li>
<li>Associate <code>.jl</code> with the <code>jl</code> language type,
rather than <code>lisp</code></li>
<li>Add Julia-specific allowed words</li>
</ul>
<h2>v1.16.20</h2>
<h2>[1.16.20] - 2023-10-16</h2>
<h3>Features</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</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.16.26] - 2023-12-27</h2>
<h3>Fixes</h3>
<ul>
<li>Apply <code>extend-ignore-re</code> to file names in addition to
file content</li>
</ul>
<h2>[1.16.25] - 2023-12-13</h2>
<h3>Fixes</h3>
<ul>
<li>Have correction in <code>extend-words</code> match the original
word's case</li>
</ul>
<h2>[1.16.24] - 2023-12-08</h2>
<h3>Fixes</h3>
<ul>
<li>Don't silently ignore config when there is an error in a field</li>
</ul>
<h2>[1.16.23] - 2023-11-06</h2>
<h3>Fixes</h3>
<ul>
<li>Ensure <code>--force-exclude</code> handles simple patterns like
<code>some-dir</code></li>
</ul>
<h2>[1.16.22] - 2023-11-01</h2>
<h3>Fixes</h3>
<ul>
<li>Updated the dictionary with the <a
href="https://redirect.github.com/crate-ci/typos/issues/843">October
2023</a> changes</li>
</ul>
<h2>[1.16.21] - 2023-10-27</h2>
<h3>Fixes</h3>
<ul>
<li>Improve colored output</li>
<li>Don't correct <code>SHTTP</code> to <code>HTTPS</code></li>
<li>Associate <code>.jl</code> with the <code>jl</code> language type,
rather than <code>lisp</code></li>
<li>Add Julia-specific allowed words</li>
</ul>
<h2>[1.16.20] - 2023-10-16</h2>
<h3>Features</h3>
<ul>
<li><em>(config)</em> <code>extend-ignore-words-re</code> field for
defining all classes of words</li>
</ul>
<h2>[1.16.19] - 2023-10-12</h2>
<h3>Features</h3>
<ul>
<li><code>--file-list <PATH></code> for accepting files to check
from a file or stdin (<code>-</code>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="45a880d9f8"><code>45a880d</code></a>
chore: Release</li>
<li><a
href="1e55ede61c"><code>1e55ede</code></a>
docs: Update changelog</li>
<li><a
href="e32ec882ea"><code>e32ec88</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/886">#886</a>
from epage/olt</li>
<li><a
href="bf66cbd0b6"><code>bf66cbd</code></a>
fix(config): Apply extend-ignore-re to file names</li>
<li><a
href="a9afeef275"><code>a9afeef</code></a>
test(cli): Show extend-ignore on file names</li>
<li><a
href="5bd389de71"><code>5bd389d</code></a>
chore: Release</li>
<li><a
href="8dbecf3e45"><code>8dbecf3</code></a>
docs: Update changelog</li>
<li><a
href="f8f8c6edf1"><code>f8f8c6e</code></a>
Merge pull request <a
href="https://redirect.github.com/crate-ci/typos/issues/884">#884</a>
from epage/custom</li>
<li><a
href="55d802d0ef"><code>55d802d</code></a>
fix(dict): Mirror original case for custom dict</li>
<li><a
href="86c4c9fb4a"><code>86c4c9f</code></a>
test(cli): Add reproduction case</li>
<li>Additional commits viewable in <a
href="https://github.com/crate-ci/typos/compare/v1.16.9...v1.16.26">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.16.9&new-version=1.16.26)](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>
This reverts #1490 due to errors seen in
https://github.com/google/comprehensive-rust/actions/runs/7188648811/job/19590765217.
The error says
Get:23 http://azure.archive.ubuntu.com/ubuntu jammy/main amd64
libc6-dev-arm64-cross all 2.35-0ubuntu1cross3 [1546 kB]
Fetched 41.7 MB in 1s (46.1 MB/s)
E: Failed to fetch
mirror+file:/etc/apt/apt-mirrors.txt/pool/main/b/binutils/binutils-aarch64-linux-gnu_2.38-4ubuntu2.3_amd64.deb
404 Not Found [IP: 52.147.219.192 80]
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?
Error: Process completed with exit code 100.
This seems less transient than the error which made us remove the `apt
update` calls in #1490.
There must have been a merge conflict at some point which resulted in a
malformed table. The result was that most redirects were blindly ignored
by `mdbook`.
I noticed it for
https://google.github.io/comprehensive-rust/enums.html which stopped
working because of this.
I took out the memory management redirect since we already have a file
where redirect would be (`mdbook` helpfully emits an error in this
case).
We are currently getting an error when we run “apt update”:
Reading package lists...
E: Repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy
InRelease' changed its 'Origin' value from 'microsoft-ubuntu-jammy-prod
jammy' to 'Pulp 3'
E: Repository 'https://packages.microsoft.com/ubuntu/22.04/prod jammy
InRelease' changed its 'Label' value from 'microsoft-ubuntu-jammy-prod
jammy' to ''
Error: Process completed with exit code 100.
I’m not sure why we get this, but updating should not be necessary in
the first place: the Ubuntu images already come with an up-to-date list
of packages.
This adds myself to CODEOWNERS. My main focus is translation, but I'd
like to add me for the future maintenance within the projcect, such as
github actions and tools. Thanks!
This version has much improved support for the translation of code
blocks. See https://github.com/google/mdbook-i18n-helpers/issues/95 for
details.
Most PO files won’t need any update since most of them don’t translate
the comments in the code blocks. Those that do, can run
`mdbook-i18n-normalize` when they feel like it.
This adds a check that `mdbook-xgettext` can always extract the strings
of the course. Without this, it’s possible to merge a change which will
make `mdbook-xgettext` error out the next time a translator tries to
refresh their translation.
Hello,
This list is still a Draft, will be ready in a day or two.
---------
Co-authored-by: Hamid R. K. Pisghadam <kaveh@riseup.net>
Co-authored-by: Henri F <henrif75@users.noreply.github.com>
The focus of the action is to check and validate changes to the `msgid`
fields, not to totally prevent such changes.
This also makes the `paths` a little more precise: we only care about
changes to `po/*.po`.
This enforces a consistent formatting for the PO files. The goal of this
is to avoid large diffs due to random and unnecessary reformatting.
We use the format of `msgcat`: this is also waht `msgmerge` produces and
it’s easy to replicate for people by installing Gettext and running
`dprint fmt`.
This is a follow-up to #1351 which started enforcing that the `msgid`
fields don’t change due to reformatting in a PR.
If this turns out to be cumbersome, then we can disable it again.
This also ports over the latest changes to `book.js` and `index.hbs`.
We probably need to come up with a more systematic way of doing this,
e.g., we could store our changes in a patch and automatically attempt to
apply it onto the latest upstream files.
Initially, I also formatted the templates in `theme/`, but this triggers
https://github.com/prettier/prettier/issues/11834. So I exclude them for
now.
---------
Co-authored-by: Ming-Ying Chung <mych@chromium.org>
Before, we always used the latest English source files when
publishing. This means that translations become outdated as soon as
anything is changed in the source.
This PR changes will instead freeze translations in place: they will
keep using the same English source files until a new POT file is
merged into the translation. We do this by relying on the
POT-Creation-Date field in the PO files.
We still use up-to-date versions of all other files: this allows us to
fix things in the theme, for example. So the assumption here is that
never versions of our infrastructure remains compatible with old
versions of the Markdown files.
This approach has a problem: when files are moved, the English
translation will link to the new name. This name will not exist in the
old translations. We might be able to disable these links somehow.
Part of google/mdbook-i18n-helpers#16. The
logic here should eventually be moved to somewhere in
mdbook-i18n-helpers, most likely to the renderer that @sakex is
building in google/mdbook-i18n-helpers#84.
In v2 of the course, I'd like to include an estimate of the time to be
spent on each segment in the Markdown file. I think a good place for
such metadata is in the frontmatter.
For review purposes, though, I just want to display that information.
So, this is a start at a new mdbook preprocessor that just separates out
the frontmatter and includes it in a `<pre>` block. Eventually, I'd like
to parse it and put the time in the speaker notes.
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
This updates our `mdbook` version to the latest version in Git. I copied
the `index.hbs` file from that version and back-ported our changes into
it. I checked English and Danish locally and they both look fine.
The new version has support for right-to-left languages:
https://github.com/rust-lang/mdBook/pull/1641.
We have an in-progress Persian translation. Download the `fa.zip`
artifact after building the PR to check how it looks. I checked Persian
locally and it looks mirrored like I expect (but we will need someone
who can read Persian to actually verify this).
Fixes#1164.
Hi all!
This CL fixes#1093:
* Avoids including current false-positives in the checking of typos
* Excludes localization-related files, as `typos` works with
English words
* Fixes existing typos caught in the repo
Tested this in CI with a typo and it showed up in the list of actions!
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
I have created PRs to normalize all PO files to the new version of
mdbook-i18n-helpers. Simultaneously, we need to update the version used
to publish the course.
This is indirectly part of #330.
I also updated `book.js` and `index.hbs` to the latest versions while
keeping our local modifications.
I tested this locally with `mdbook serve` for both English and
Brazilian Portuguese and everything seems to work fine.