Commit Graph
5143 Commits
Author SHA1 Message Date
Chris Krycho d9e9af10d9 infra: use mdbook::utils::new_cmark_parser in preprocessors
This guarantees we use the exact same config mdBook does, preventing a
class of bugs where we renderer something different than the baseline
output would simply because we are preprocessing.
2024-05-22 17:20:37 -06:00
Chris Krycho f82c5caa87 infra: CSS for figcaption to match span.caption 2024-05-22 17:02:01 -06:00
Chris Krycho 5c8d7dfbcb Merge pull request #3937 from rust-lang/ferris-js-updates
infra: modernize and improve rigor/safety of ferris.js
2024-05-22 15:50:22 -06:00
Chris Krycho 40993e8ec7 infra: modernize and improve rigor/safety of ferris.js
- Use `let` instead of `var` throughout. All modern browsers support it
  and have for many years, even the now-EOL IE11.[^ie]
- Add a `@ts-check` annotation so that anyone working on a TS-enabled
  editor will get feedback inline about cases they may otherwise miss.
- Add JSDoc-based type definitions for the script, and fix some errors
  that may occur at runtime. (These will be rare if they happen, but
  getting rid of them is still a win!)

[^ie]: IE11 did not correctly support the semantics of `let` for `for`
    loops, but the uses in the existing code here already used `var` in
    a way which would trigger the same behavior as using `let` does.
2024-05-22 15:46:37 -06:00
Chris Krycho e9f5bc794a Merge pull request #3936 from rust-lang/more-workspace-cleanup
infra: more workspace cleanup
2024-05-22 13:30:09 -06:00
Chris Krycho 48909a19ac infra: more workspace cleanup
- Turn back on `default-members`.
- Remove deps from root only used by mdbook preprocessors, since they
  are managed by themselves now.
2024-05-22 13:26:53 -06:00
Carol (Nichols || Goulding) ea8cd41a84 Switch to double quotes as shellcheck suggests 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) 1755cce5cf Update regex to account for new cargo output format 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) 82e1e05aef Suppress new cargo clean output when regenerating output 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) 5fd055e6fb Update to Rust 1.78.0 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) 3d8402b650 Rename deprecated .cargo/config to .cargo/config.toml 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) 1e09221e31 Update to Rust 1.77.2 2024-05-22 14:52:49 -04:00
Carol (Nichols || Goulding) a22a6b42b1 Exclude tmp dir from the workspace
This is where the tools/update-rustc.sh script builds listings for the
purposes of updating commands' output.
2024-05-22 14:52:49 -04:00
Chris Krycho 9e4b5e421f Merge pull request #3933 from rust-lang/preprocessors-default-features
infra: disable mdBook default-features for mdBook preprocessors
2024-05-22 12:38:32 -06:00
Carol (Nichols || Goulding) de1c417faf Revert "Update listings to account for cargo new template update" 2024-05-22 14:36:32 -04:00
Chris Krycho c7c291084c Merge pull request #3932 from tbu-/pr_cargo_new_template
Update listings to account for `cargo new` template update
2024-05-22 12:25:09 -06:00
Chris Krycho e737707eb9 infra: disable mdBook default-features for mdBook preprocessors
This prevents us from pulling in `notify` accidentally, which is causing
a `tidy check` issue in `rust-lang/rust` because of the CC0 license on
`notify`. I had intended to address this in efd315a3, but forgot that
`features = []` does not imply `default-features = false`.
2024-05-22 12:14:45 -06:00
Tobias Bucher e1c1701837 Fix some whitespace at end-of-line and end-of-file 2024-05-22 16:25:21 +02:00
Tobias Bucher 3367ff4fa6 Update listings to account for cargo new template update
Requires https://github.com/rust-lang/cargo/pull/13939.
2024-05-22 16:19:02 +02:00
Chris Krycho fcd2aad566 Merge pull request #3931 from rust-lang/preprocessors-and-rust-lang
infra: tweak mdBook preprocessors configuration
2024-05-22 07:35:03 -06:00
Chris Krycho efd315a348 infra: remove mdBook preprocessors from workspace
Remove these from the workspace, because they will need to be used as
path dependencies in `rust-lang/rust`, as part of the build, because the
Rust build pipeline invokes mdBook programmatically rather than via
tools built directly, and we really don’t want to muck with publishing
these to crates.io at present. As a result, they cannot be part of this
workspace, because path dependencies do not get built as a crate within
the hosting workspace. Make sure they do not rely on any features other
than the core `mdbook` library.
2024-05-22 07:28:29 -06:00
Chris Krycho 5e9051f716 Merge pull request #3924 from davidkurilla/infra-convert-listing-in-ch01-03
Convert ch01-03-hello-cargo.md Listing 1-2 using `<Listing>`
2024-05-16 08:58:56 -06:00
Chris Krycho b539e27d71 Drop extra text from Listing[caption] 2024-05-16 08:54:47 -06:00
Chris Krycho 71267c07af Merge pull request #3925 from rust-lang/fix-trpl-note-rendering
infra: fix rendering bug in mdbook-trpl-note
2024-05-16 08:51:11 -06:00
Chris Krycho e28a6b01f4 infra: fix rendering bug in mdbook-trpl-note
Previously, this was only pushing in the opening paragraph tag before
getting to text, so it was accidentally dropping cases where the text
started after some other opening tag, e.g. strong emphasis.
2024-05-16 08:47:25 -06:00
David Kurilla dd30faab70 Update ch01-03-hello-cargo.md 2024-05-15 18:37:00 -07:00
David Kurilla 53b7c6faed infra: convert listing 1-2 using <Listing> 2024-05-15 18:09:30 -07:00
Chris Krycho 7e2a00d5d0 Merge pull request #3920 from rust-lang/listings-without-file-name
infra: support `Listing`s without `file-name`
2024-05-14 15:56:37 -06:00
Chris Krycho ad673cfb00 infra: support Listings without file-name
I did not realize we had some of these, but: we do!
2024-05-14 15:51:53 -06:00
Chris Krycho 444932b1c8 Merge pull request #3918 from rust-lang/trpl-listing
Add a `<Listing>` preprocessor
2024-05-14 11:41:03 -06:00
Chris Krycho 17c244ac13 infra: Convert one listing to use <Listing>
- Add CSS for `figure.listing`; this now renders identically to how the
  existing listings render.
- Convert the first listing in the book to use `<Listing>` instead of
  a bunch of `<span>`s.
2024-05-14 08:25:02 -06:00
Chris Krycho e65efe3a99 infra: handle trailing newlines correctly in mdbook-trpl-listing 2024-05-14 08:25:02 -06:00
Chris Krycho 04841f73ba infra: configure trpl-listing preprocessor 2024-05-14 08:25:02 -06:00
Chris Krycho 3254856510 infra: Hoist mdBook preprocessor workspace dependencies 2024-05-14 07:50:10 -06:00
Chris Krycho 59a02b9ed4 Merge mdbook-trpl-listing into the repository
This does not yet update all the workspace dependencies to be shared
between the listing and note preprocessors; it *only* integrates the
repo histories.
2024-05-14 07:39:16 -06:00
Chris Krycho dad2b61a69 Prepare to integrate into TRPL repo 2024-05-14 07:32:56 -06:00
Chris Krycho e07789118b Implement an mdBook preprocessor for <Listing>s
Instead of requiring a bunch of `<span>` wrangling, add a custom tag,
`<Listing>`, whose attributes get rewritten into the desired output
format, using `<figure>` and `<figcaption>` for improved semantic HTML.

Support both a default (nice and fancy) HTML output mode and a “simple”
mode to make it so we get the desired output format for the NoStarch
input files as well.
2024-05-14 07:32:06 -06:00
Chris Krycho 000b3d03e1 Create a repo for listing preprocessor 2024-05-13 17:08:58 -06:00
Herbert Reiter 03178db51d Update explanation according to code listing 2024-05-13 09:54:37 -04:00
Chris Krycho 698a756e46 Merge pull request #3915 from rust-lang/run-package-tests
infra: run package tests
2024-05-10 08:45:22 -06:00
Chris Krycho 7e28bd7d73 infra: run package tests
With the introduction of the workspace, we were missing coverage for the
supporting packages.
2024-05-10 08:40:25 -06:00
Chris Krycho 2a20b8373d Merge pull request #3914 from rust-lang/fix-workspace
Fix workspace behavior by excluding `listings`
2024-05-09 12:57:37 -06:00
Chris Krycho d4c69fd881 Fix workspace behavior by excluding listings
At some point we may want to include these in the workspace, but for
now they need to be excluded so `cargo build` and `rust-analyzer` work
correctly with the workspace layout.
2024-05-09 12:38:54 -06:00
Carol (Nichols || Goulding) 93a7176c9a Add subslices to the dictionary 2024-05-07 19:58:22 -04:00
Carol (Nichols || Goulding) b04c03d01a Snapshot changes to ch8 to consider sending to nostarch 2024-05-07 19:58:22 -04:00
Carol (Nichols || Goulding) d1e3925a96 Snapshot changes to generated ch8 that SHOULDN'T be sent to nostarch 2024-05-07 19:58:22 -04:00
Carol (Nichols || Goulding) 36d9cfc0ad Backport changes to chapter 8 2024-05-07 19:58:22 -04:00
Chris Krycho bebcf527e6 Merge pull request #3904 from LukeFranceschini/main
[ch10-03] Fix wording change about mandatory type annotation
2024-04-29 20:06:57 -06:00
Chris Krycho 7813712d03 Merge pull request #3907 from rust-lang/chriskrycho/semantic-notes
Introduce handling for accessible/semantic note rendering in HTML
2024-04-29 20:05:53 -06:00
Chris Krycho 427f7d3b8f Update CI config for workspace and mdbook-trpl-note
- Add building `mdbook-trpl-note` to the relevant workflow.
- Explicitly exclude `linkcheck` from new workspace.
2024-04-29 16:18:34 -06:00