Commit Graph

5412 Commits

Author SHA1 Message Date
Chris Krycho
fb718b3822 Merge main into async-edits 2024-08-19 07:22:33 -06:00
Carol (Nichols || Goulding)
e7d217be2a Snapshot changes to ch 12 to consider sending to nostarch 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
084b0e3a5e Snapshot changes to generated ch12 that SHOULDN'T be sent to nostarch 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
b988be3cb9 Instead of special casing square brackets in code, don't support md links without something after them 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
d189d7b4af Make all search word arguments italics 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
bffbeb1102 Reword to avoid a/an where pronunciation is unclear 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
8880eacd33 Backported edits of ch12 from print to src 2024-08-13 21:19:47 -04:00
Carol (Nichols || Goulding)
48a3c173c1 Upstream changes to ch7 to consider sending to nostarch 2024-08-13 13:40:00 -04:00
Carol (Nichols || Goulding)
75bc555105 Updates to ch7 snapshot, not to send to nostarch 2024-08-13 13:40:00 -04:00
Carol (Nichols || Goulding)
fa655f207f Fix unfancy quotes 2024-08-13 13:40:00 -04:00
Carol (Nichols || Goulding)
edc572723c Remove redundant sentence. Send to nostarch
Fixes #3994.
2024-08-13 13:10:48 -04:00
Vox Dai
79bce29cd7 Fix: typo
Fix a typo in ch03-05-control-flow.md
2024-08-13 12:51:00 -04:00
Chris Krycho
04bc1396bb Merge pull request #3995 from ehuss/elided_lifetimes_in_paths
mdbook-trpl-listing: Add missing elided lifetimes
2024-07-31 07:19:44 -06:00
Chris Krycho
506a35a539 Merge pull request #3998 from rust-lang/robots-infra-rest
infra: include ghp-import and git push in generate-preview script
2024-07-31 07:18:50 -06:00
Chris Krycho
df78a37109 infra: include ghp-import and git push in generate-preview script 2024-07-31 07:16:56 -06:00
Chris Krycho
d303172723 Merge pull request #3997 from rust-lang/robots-infra
infra: add robots.txt for GH Pages previews
2024-07-31 07:08:44 -06:00
Chris Krycho
de6e35c52f infra: add robots.txt for GH Pages previews
Block *everything*. We do not want any of this to be indexed, because we
*only* use it for previews, and do not want its content to be cached or
(especially!) surfaced to readers, since it may have a variety of issues
ranging from pedagogical missteps to outright errors!
2024-07-31 07:05:42 -06:00
Eric Huss
d179c23616 mdbook-trpl-listing: Add missing elided lifetimes 2024-07-29 11:32:29 -07:00
Chris Krycho
472f152eae Ch. 17: fix diagrams and embed them in the text
- Swap the ordering to match the order in the text (concurrent is first,
  at least for now).
- Make them go left-to-right instead of top-to-bottom for compactness in
  the text.
- Fix rendering issues resulting from the VS Code extension doing things
  that normal `dot` does not, for who knows what reasons.
2024-07-26 13:39:07 -06:00
Chris Krycho
cfaf187bbc Ch. 17: diagrams for concurrent and parallel execution 2024-07-25 15:29:40 -06:00
Chris Krycho
eb41efb333 Ch. 17§00: rework the introduction based on initial reviews
- Drop the history lesson and comparisons to other approaches. Focus on
  what async gives us instead.
- Simplify and clarify the 
- Talk about “the network” instead of “network sockets” and simplify the
  example code to match.
2024-07-24 12:01:22 -06:00
Chris Krycho
4044534e4f Ch. 16: avoid slightly-dismissive language in transition
Use the original transitional paragraph and structure, adding to it
instead of rewriting it entirely.

HT @timClicks (Tim McNamara <paperless@timmcnamara.co.nz>) for pointing
out how my rephrasing here made it worse!
2024-07-24 10:50:24 -06:00
Chris Krycho
133bb617d7 Ch. 17§00: phrasing/wording-level improvements
Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: Will Crichton <crichton.will@gmail.com>
Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
2024-07-23 17:28:19 -06:00
Chris Krycho
e6692504c6 Ch. 17§00: phrasing/wording-level improvements
Co-authored-by: Tim McNamara <paperless@timmcnamara.co.nz>
Co-authored-by: James Munns <james@onevariable.com>
2024-07-23 16:05:48 -06:00
Chris Krycho
b2a21337d6 Merge main into async-edits 2024-07-23 13:32:50 -06:00
Chris Krycho
98dd2c1d7f Merge pull request #3870 from rust-lang/fix-2980
Clarify function definitions vs. expressions
2024-07-23 08:12:54 -06:00
Chris Krycho
e2a5258f83 Clarify function definitions vs. expressions
Fixes #2980.
2024-07-23 07:49:51 -06:00
Chris Krycho
743d2e20fa Merge pull request #3988 from rust-lang/fix-ci-shellcheck-issues
infra: fix some shellcheck issues in CI config
2024-07-22 11:47:02 -07:00
Chris Krycho
90994ca7ab infra: fix some shellcheck issues in CI config 2024-07-22 12:38:17 -06:00
Chris Krycho
644dbab3d6 Ch. 17: fix an internal link reference 2024-07-22 12:17:39 -06:00
Chris Krycho
79fd5e2dd1 Merge main into async-edits 2024-07-22 12:06:26 -06:00
Chris Krycho
463b819a75 Ch. 17: fix internal links with new ch. order
Note: this does *not* include all fixes for the text, only for the links
themselves. For the text, we will also need to search for references to
chapters 17-20. This catches a few of those along the way, but there are
no doubt others.
2024-07-22 12:05:26 -06:00
Chris Krycho
45f163588d Ch. 17: fix spelling issues 2024-07-22 10:39:18 -06:00
Chris Krycho
a7c750c15e Merge pull request #3982 from rust-lang/preprocessors-support-test-renderer
infra: support test renderer in mdbook preprocessors
2024-07-17 16:03:05 -06:00
Chris Krycho
d10039ff03 infra: support test renderer in mdbook preprocessors
This does not change the actual behavior of `mdbook test`, but it does
get rid of a warning about the test renderer being unsupported!
2024-07-17 15:58:42 -06:00
Chris Krycho
5099e5fb55 Ch. 17§06: Make code listing pass tests and add a caption 2024-07-17 15:43:53 -06:00
Chris Krycho
40bdda77f8 Ch. 17§05: Make code/listings pass tests
- Rewrite the `StreamExt` definition to be more correct, and extract it
  to a standalone “no-listing listing” so we can make sure its
  definition at least type checks.
- Update all the listings in the chapter to use `extern crate` since
 `mdbook test` does not understand Rust 2018. Alas.
- Ignore the listings (inline or otherwise!) which are *intended* not to
  compile, so mdbook does not try to test them.
- Clarify some of the text around the *actual* Tokio definition of the
  `StreamExt::next` method.
2024-07-17 15:43:53 -06:00
Chris Krycho
0aacb80bf2 Ch. 17§04: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since
 `mdbook test` does not understand Rust 2018. Alas.
- Ignore a listing which has a missing body apurpose.
2024-07-17 15:21:25 -06:00
Chris Krycho
6a0d07280a Ch. 17§03: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since
  `mdbook test` does not understand Rust 2018. Alas.
- Fix one listing which had gotten out of sync somewhere along the way.
  (This also fixes a comment flagged up by a reviewer!)
2024-07-17 15:14:54 -06:00
Chris Krycho
deefe4d518 Ch. 17§02: Make code/listings pass tests
- Update all the listings in the chapter to use `extern crate` since
  `mdbook test` does not understand Rust 2018. Alas.
- Ignore two of the listings because they never stop.
2024-07-17 14:56:25 -06:00
Chris Krycho
24ed6e4c11 Ch. 17§01: Make code/listings pass tests
- Update the contents of the code in the chapter so it is correct, and
  update the text to match. Given this is about `Future`, this may also
  warrant moving/simplifying that whole chunk of code, too.

- Update the listing to use `extern crate` since it does not otherwise
  work correctly with `mdbook test`. Alas.
2024-07-17 14:54:36 -06:00
Chris Krycho
bb9cdbb087 Ch. 17: Update CI config to support testing the book with trpl
mdBook does not currently have particularly good support for “external”
crates. To make the test suite work correctly with `trpl`, we must first
build `trpl` itself (`mdbook` will not do it), and then explicitly pass
its `deps` path as a library search path for `mdbook test`. That will
make sure all the crates can be resolved when running the tests.


.github/workflows/main.yml
2024-07-17 14:41:24 -06:00
Chris Krycho
dc8d7e870c Merge main into async-edits 2024-07-17 13:29:42 -06:00
Chris Krycho
130e6d09a4 Ch. 17: correct wrapping for a Note 2024-07-16 17:39:39 -06:00
Chris Krycho
58fff3cc48 Ch. 17§03: fix typo
htypes! What are htypes? No one will ever know.

Co-authored-by: James Munns <james@onevariable.com>
2024-07-16 16:57:45 -06:00
Chris Krycho
9c974f1ae0 Merge pull request #3975 from rust-lang/chriskrycho/improved-listings-support
Improve handling of `<Listing>`s
2024-07-16 12:18:38 -06:00
Chris Krycho
22b04c1385 infra: prepare trpl crate for 0.1.0 release trpl-v0.1.0 2024-07-16 09:00:23 -06:00
Chris Krycho
c3c88e4b4f Ch. 17 §03: restore accidentally-removed Listing 17-14 2024-07-15 17:30:49 -06:00
Chris Krycho
7bd97c9688 infra: support HTML in listing caption body
XML does not allow more XML to appear in the body of an attribute, but
this is not XML! It is *HTML*, since Markdown allows embedding HTML, and
HTML *does* allow embedding further `<` and `>` characters within the
attributes on the element. Accordingly, switch to `html_parser`, add a
test covering this behavior, and update `ListingBuilder` to take the
number, caption, and file name types as owned rather than as references,
since that is what `html_parser` supplies.

Additionally, refactor the guts a bit so it is easy to see the overall
logic of `rewrite_listing`, with the gnarly bits around opening and
closing the rewritten listings pushed into a method on the `State`
struct, itself renamed to `ListingState` and its `current_listing` field
renamed to `current`. This also clarifies the semantics of each part of
the rewrite operation, e.g. `ListingState::open_listing` is fallible;
`ListingState::close_listing` is not.
2024-07-15 17:07:20 -06:00
Chris Krycho
4d357442af infra: support non-numbered and no-caption listings
When I originally built this, I thought *all* “listings” had numbers and
captions, but it turns out that there are a number of places in the book
where having the overall `figure`-driven output, i.e. with a file name,
is desirable even though there is no number or caption.

A potential enhancement later would be to require a caption if a number
is present, since that seems to be what the book actually does.
2024-07-15 17:07:20 -06:00