1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-26 18:51:00 +02:00
Commit Graph

1015 Commits

Author SHA1 Message Date
529d4bf20c Speaker note tweaks for compound types 2023-01-19 10:51:35 +00:00
7a2ffda266 Mention ADT and zero-cost abstractions among modern features 2023-01-19 10:51:35 +00:00
48ec773052 Add support for translations
This implements a translation pipeline using the industry-standard
Gettext[1] system.

I picked Gettext for the reasons described in [2] and [3]:

* It’s widely used in open source software. This means that there are
  graphical editors which will help you in editing the `.po` files. An
  example is Poedit[4], which is available for all major platforms.

  There are also many online systems for doing translations. An
  example is Pontoon[5], which is used for the Rust website itself. We
  can consider setting up such an instance ourselves.

* It is a light-weight yet structured format. This means that nothing
  changes with regards to how you update the original English text. We
  can still accept fixes and PRs like normal.

  The structure means that translators can see exactly which part of
  the course they need to update after a change. This is completely
  lost if you simply copy over the original text and translate it
  in-place in the Markdown files.

The code here only adds support for translations. They are not yet
tested, published or used for anything. Next steps will be:

* Add support for switching languages via a bit of JavaScript on each
  page.

* Update the speaker notes feature to support translations (right now
  “Speaker Notes” is hard-coded into the generated HTML). I think we
  should turn it into a mdbook preprocessor instead.

* Add testing: We should test that the `.po` files are well-formed. We
  should also run `mdbook test` on each language since the
  translations can alter the embedded code.

Fixes #115.

[1]: https://www.gnu.org/software/gettext/manual/html_node/index.html
[2]: https://github.com/rust-lang/mdBook/pull/1864
[3]:
https://github.com/rust-lang/mdBook/issues/5#issuecomment-1144887806
[4]: https://poedit.net/
[5]: https://pontoon.rust-lang.org/
2023-01-18 16:12:53 +01:00
8e3941d2e6 Fix close tag on keyboard shortcut page (#179) 2023-01-18 10:57:31 +00:00
0324cd2b27 Merge pull request #176 from google/testing
Fix Rustdoc comment.
2023-01-17 17:32:39 +01:00
8f6dcf35f5 Fix Rustdoc. 2023-01-17 16:07:10 +00:00
51ad97a8df Fix typo (#173) 2023-01-17 11:42:31 +00:00
13da3112e9 Ownership speaker notes (#172)
* ownership speaker notes

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-01-17 08:09:14 +00:00
1c7ce1cac6 Use a consistent order in memory layout of trait objects example. 2023-01-16 16:11:31 +00:00
5cbb8d4c27 Add speaker notes about closures. 2023-01-16 16:11:31 +00:00
a1861ef900 Add speaker notes for impl Trait. 2023-01-16 16:11:31 +00:00
832c7e9963 Add speaker notes for Iterator, and an example using FromIterator. 2023-01-16 16:11:31 +00:00
93b20be600 Hint towards making library mut
Follow up to https://github.com/google/comprehensive-rust/pull/137
Gives the student a hint that it's okay to edit variables within main.
2023-01-16 11:06:40 +01:00
4c8d85dc88 Fix typo in rust.md 2023-01-16 11:06:40 +01:00
71c68a6996 Adds speaker notes for 6.4.1. String vs str
Adds speaker notes including:
-Brief explanation of &str, String type
-String::from and String::new
-push_str method
2023-01-16 11:06:40 +01:00
35893e2bc6 Update src/ownership/lifetimes-data-structures.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-13 12:47:15 +01:00
53706056e3 Update src/ownership/lifetimes-data-structures.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-13 12:47:01 +01:00
77f24ffab7 Add speaker notes for lifetimes-data-structures.md 2023-01-12 19:36:40 +01:00
9c652d06aa Add speaker notes for moves-function-calls.md 2023-01-12 18:23:57 +01:00
67b65c5ee8 Simplify language in speaker notes 2023-01-12 17:13:46 +01:00
d85643d5ac Update src/basic-syntax/slices.md
Co-authored-by: Martin Geisler <martin@geisler.net>
2023-01-12 16:11:46 +00:00
f4b651456c Speaker notes to 6.4 Slices
Brief digest of the slice type, including mentions of borrowing, range syntax and lifetimes.
2023-01-12 15:53:16 +00:00
3dd03bbd65 Re-add link that is still in use 2023-01-12 12:33:03 +01:00
92dafcb676 Merge pull request #158 from brandonpollack23/stackheap
Add speaker notes to stack and heap pages
2023-01-12 11:53:54 +01:00
45e57e9359 Capitalization in stack.md 2023-01-12 11:51:37 +01:00
7203bb8a65 Capitalization in src/memory-management/rust.md 2023-01-12 11:50:28 +01:00
e8ed8cb5de Clean up playground link in borrowing.md 2023-01-12 11:32:11 +01:00
83cd7ab67b Fix typo in borrowing.md 2023-01-12 11:27:57 +01:00
a3ec024fba Fix formatting in compound-types.md 2023-01-12 11:26:48 +01:00
acdf00ae6e Add speaker notes about error examples 2023-01-11 18:14:58 -08:00
f750f75db6 stackheap notes 2023-01-12 11:12:53 +09:00
a8fb8ad2b6 Merge pull request #120 from google/running-the-course
Add instructions about how to run the course
2023-01-11 18:28:22 +01:00
0b7b69df10 Merge pull request #152 from google/solution-speaker-notes
Add speaker notes to exercise pages
2023-01-11 16:46:55 +01:00
d037d7b5c7 Merge pull request #133 from rastringer/patch-1
Adds speaker notes to Compound Types section
2023-01-11 15:51:53 +01:00
b6bec18875 Clarify that "fixed" means "compile-time constant" 2023-01-11 15:49:10 +01:00
41bb8acf3f Removes out of bounds checks for simplicity
Removes the out of bounds checks to keep the notes simple.
2023-01-11 14:35:20 +00:00
6019a946d9 Merge pull request #154 from fbornhofen/speaker-notes
Speaker notes for box.md, rc.md, option-result.md
2023-01-11 14:49:03 +01:00
6b8ee3c979 Fix typo 2023-01-11 14:47:34 +01:00
02e1f4b879 Add speaker notes for option-result.md 2023-01-11 14:19:21 +01:00
dd194f07c9 Add speaker notes for rc.md 2023-01-11 14:04:30 +01:00
5256d9c3fd Add speaker notes for box.md 2023-01-11 13:29:43 +01:00
de9d67205e Fix typo on Luhn exercise 2023-01-11 12:11:06 +00:00
1085e9c20b Add speaker notes to exercise pages
The notes link to the corresponding solutions.
2023-01-11 12:49:59 +01:00
587645db6c Clarify default vs debug output. 2023-01-11 10:49:21 +01:00
d1422e93c2 Merge pull request #149 from fbornhofen/speaker-notes-string
Add speaker notes for string.md
2023-01-10 19:55:59 +01:00
da81dfa07f Simplify char count 2023-01-10 19:54:48 +01:00
08af7574bb Add instructions about how to run the course
I think we need a chapter “before the course” which gives people some
background information about how to run the course. This is the start
of this chapter, we might expand it in the future as we find more
things to communicate here.
2023-01-10 19:12:57 +01:00
b2b11257f5 Add speaker notes for string.md 2023-01-10 19:06:06 +01:00
4e746482f2 Merge pull request #148 from fbornhofen/speaker-notes-if-let
Add speaker notes for if-let-expressions.md
2023-01-10 18:58:53 +01:00
1b3eaec5e7 Merge pull request #141 from brandonpollack23/static_const
Added notes, runtime constant eval, and footnoes to static-and-const.md
2023-01-10 18:53:46 +01:00