1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-13 21:55:20 +02:00
Commit Graph

29 Commits

Author SHA1 Message Date
Manichand Kondapaka
b7a6e3b46d
Saving playground code state (#1917)
The embedded Playground's code reset when you navigate between slides.
This has caused problems: if people navigate away from a slide to look
something up, they've suddenly lost their work.
2024-03-22 12:15:54 -04:00
Manichand Kondapaka
0761f936ca
Add a dev theme to help with slide aspect ratio (#1842)
Added a dev theme to help with slide aspect ratio while updating content
or for reviewing PRs.

Fixes #1796.

---------

Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
Co-authored-by: Martin Geisler <martin@geisler.net>
2024-03-05 10:33:42 +00:00
Martin Geisler
0e8d3e77c2
Update mdbook and mdbook-i18n-helpers (#1658)
This also ports over the `mdbook` theme changes between version 0.4.35
and 0.4.36.
2024-01-05 15:56:18 +01:00
Martin Geisler
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
Pavel Roskin
30f8e50b43
Fix typos (#1608) 2023-12-20 18:21:54 +00:00
Dustin J. Mitchell
6d19292f16
Comprehensive Rust v2 (#1073)
I've taken some work by @fw-immunant and others on the new organization
of the course and condensed it into a form amenable to a text editor and
some computational analysis. You can see the inputs in `course.py` but
the interesting bits are the output: `outline.md` and `slides.md`.

The idea is to break the course into more, smaller segments with
exercises at the ends and breaks in between. So `outline.md` lists the
segments, their duration, and sums those durations up per-day. It shows
we're about an hour too long right now! There are more details of the
segments in `slides.md`, or you can see mostly the same stuff in
`course.py`.

This now contains all of the content from the v1 course, ensuring both
that we've covered everything and that we'll have somewhere to redirect
every page.

Fixes #1082.
Fixes #1465.

---------

Co-authored-by: Nicole LeGare <dlegare.1001@gmail.com>
Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-11-29 16:39:24 +01:00
Elliot Brandwein
6624c5874f
Reset state to inline-open when speaker note popup is closed (#1441)
Partially addresses #182.

---------

Co-authored-by: Elliot Brandwein <ebrandwein@google.com>
2023-11-16 11:49:24 +00:00
Amin Sharifi
7cec167840
Fix SVG renders in RTL contents (#1454)
Part of:
#671 
#1433
## Issue:
When we render SVG tags in persian ( `<html dir="rtl" ...>`) make
confiliect:


![svg-rtl-issue](https://github.com/google/comprehensive-rust/assets/11869014/ce825736-4367-41fa-acd3-6e395926d7c7)
originally: *[7.2 Arrays and for
Loops](https://google.github.io/comprehensive-rust/exercises/day-1/for-loops.html#arrays-and-for-loops)*

![svg-rtl-issue-2](https://github.com/google/comprehensive-rust/assets/11869014/0a494392-2407-47ec-91f1-0098414b83d3)

originally: *[16.2 Moved Strings in
Rust](https://google.github.io/comprehensive-rust/ownership/moved-strings-rust.html)*

## Proposed method:

as we talked in #1433, again in there adding 
```
[dir="rtl"] svg {
  direction: ltr;
}
```
fix issue like:


![svg-rtl-issue-fix](https://github.com/google/comprehensive-rust/assets/11869014/5d82c413-709a-42dd-b24b-1ff2c8be55ba)


![svg-rtl-issue-2-fixture](https://github.com/google/comprehensive-rust/assets/11869014/da2bf319-212e-4edd-9135-82f51e5e0381)
2023-11-08 17:49:07 +03:30
Amin Sharifi
8f42baf968
Fixture code and footer content tags in rtl content (#1433)
Part of #671 
and #1413

In the code part of content which always is in english and must be
`text-align: left` but with `<html ... dir=rtl >` cuz conflict.

---------

Co-authored-by: Kaveh <hamidrkp@riseup.net>
2023-10-31 07:37:04 +01:00
Henri F
ce27799096
Fixes drop-down link to the correct zh-TW translation (#1416) 2023-10-23 19:34:50 +02:00
Henri F
88edcd02e7
Adds Chinese Traditional to the language drop-down (#1411)
Graduates the Chinese Traditional translation to the language drop-down
selector.
Part of Chinese (Traditional) translation #684.

File stats (Rust Fundamentals):

```
msggrep -v --location=src/{exercises/,}{android,bare-metal,concurrency,async}{.md,"/*","/*/*","/*/*/*"} po/zh-CN.po | msgfmt -o /dev/null --statistics -

1315 translated messages, 146 fuzzy translations, 149 untranslated messages.
```
2023-10-23 09:20:15 -07:00
Martin Geisler
5fafa4842c
Update mdbook to version 0.4.35 (#1302)
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.
2023-10-13 16:40:40 +02:00
Henri F
c2e9a45d49
Adds Chinese Simplified to the language drop-down (#1357)
Graduates the Chinese Simplified translation to the language drop-down
selector. Part of #324
2023-10-13 09:15:00 +02:00
Martin Geisler
42541fc401
Automatically format YAML, CSS, and JS files (#1272)
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>
2023-10-02 14:48:00 +09:00
Hatim Nalawala
cc0a78ed9a
Move CSS files into theme/ folder (#1229)
Hi all,
This PR fixes https://github.com/google/comprehensive-rust/issues/1226:

* Moved CSS files to `theme/css`
* Moved speaker-notes.js to `theme/`
* Updated paths in book.toml
2023-09-21 11:00:27 +02:00
Martin Geisler
0d566ce042
Move JavaScript code to head template (#1210)
This will simplify our mdbook updates since there will be fewer
customizations to copy over when a new mdbook version has changes to the
`index.hbs` template.
2023-09-15 09:52:22 +00:00
Henri Fontana
19f679f8a7
Standardize language menu format and adds Spanish (#1196)
Spanish translation #284
2023-09-11 09:45:20 -04:00
Martin Geisler
09d1265cbb
Add support for right-to-left languages (#1165)
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.
2023-09-07 09:50:44 +02:00
Martin Geisler
8b1bed7db9
Insert <link rel="canonical"> elements (#1140)
This prevents duplicate search results in case copies of the material is
being left visible on the web. See the Search Central
documentation[1] for details.

The implementation here should mostly go away when
https://github.com/google/mdbook-i18n-helpers/issues/70 is implemented.

[1]: https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
2023-08-30 22:28:34 +02:00
Martin Geisler
2e92da7acd
Update mdbook to 0.4.34 (#1066)
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.
2023-08-11 15:40:01 +02:00
Martin Geisler
5d71f8a326
Open GitHub edit links in new tabs (#856)
I find this nicer since you don't lose your location in the book then.
2023-06-22 09:50:20 -04:00
Martin Geisler
66247b698e
Fix language selector on unpublished languages (#695)
The Danish translation is not yet linked in the language selector
since it is very incomplete. This means that `selectedLang` is `null`
in this case and thus we should not call any methods on it.
2023-05-26 16:23:57 +02:00
Martin Geisler
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
Jiyong Park
eb57ba9e51
Publish Korean translation (#428)
* Publish Korean translation

* 한국어 -> 한국어 (Korean)

* Add translator names for the Korean translation
2023-02-17 17:58:33 +09:00
Martin Geisler
14b5e86579
Fix links in language picker (#417)
When the current page is not `en`, we need to add an additional `../`
to the path to reach the top of the site.
2023-02-15 18:59:58 +01:00
Martin Geisler
3b7123d21a
Add language picker menu (#411)
The picker is a drop-down menu using the same design as the theme
picker in the top-left.

There doesn’t seem to be an easy way to pass in a list of languages
and descriptions, so for now we’ll have to expand the menu by hand as
we add new languages. A comment has been added to `publish.yml` to
remind us of this.
2023-02-15 15:10:16 +01:00
Martin Geisler
be5263010a
Use .po file as target for edit link on translations (#394) 2023-02-13 17:42:45 +01:00
Martin Geisler
4409f330c5
Move GA code directly into main page (#289)
This replaces a bit of code with the equivalent HTML code.

We also load the script async, which means that the browser won’t
block rendering while waiting for the scripts.
2023-01-27 14:37:17 +01:00
Martin Geisler
438c16607d
Add theme generated with mdbook init --theme (#189)
This will allow us to customize the appearance more easily: we can
move the GA logic into the theme (to reduce load times and to simplify
the JS injection logic). We can also add new elements, which is what I
will do next.

The mdbook theme can be added incrementally: if we don’t add a file to
our theme folder, we will get the corresponding file from mdbook.
2023-01-25 21:31:22 +01:00