Skip to content

Commit

Permalink
[BOT] Updating 33f31a3 content
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 4, 2024
1 parent 33f31a3 commit 30721da
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
10 changes: 10 additions & 0 deletions rustbook-en/ADMIN_TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,13 @@ $ dot dot/trpl04-01.dot -Tsvg > src/img/trpl04-01.svg
In the generated SVG, remove the width and the height attributes from the `svg`
element and set the `viewBox` attribute to `0.00 0.00 1000.00 1000.00` or other
values that don't cut off the image.

## Publish a preview to GitHub Pages

We sometimes publish to GitHub Pages for in-progress previews. The recommended
flow for publishing is:

- Install the `ghp-import` tool by running `pip install ghp-import` (or `pipx install ghp-import`, using [pipx][pipx]).
- In the root, run `tools/generate-preview.sh`

[pipx]: https://pipx.pypa.io/stable/#install-pipx
6 changes: 3 additions & 3 deletions rustbook-en/packages/mdbook-trpl-listing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn rewrite_listing(src: &str, mode: Mode) -> Result<String, String> {
}
ev => state.events.push(Ok(ev)),
};
Ok::<ListingState, String>(state)
Ok::<ListingState<'_>, String>(state)
},
)?;

Expand Down Expand Up @@ -190,7 +190,7 @@ struct ListingState<'e> {
impl<'e> ListingState<'e> {
fn open_listing(
&mut self,
tag: pulldown_cmark::CowStr,
tag: pulldown_cmark::CowStr<'_>,
mode: Mode,
) -> Result<(), String> {
// We do not *keep* the version constructed here, just temporarily
Expand Down Expand Up @@ -247,7 +247,7 @@ impl<'e> ListingState<'e> {
Ok(())
}

fn close_listing(&mut self, tag: pulldown_cmark::CowStr, mode: Mode) {
fn close_listing(&mut self, tag: pulldown_cmark::CowStr<'_>, mode: Mode) {
let trailing = if !tag.ends_with('>') {
tag.replace("</Listing>", "")
} else {
Expand Down
6 changes: 6 additions & 0 deletions rustbook-en/tools/generate-preview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

mdbook build
cp ./tools/preview-robots.txt ./book/robots.txt
ghp-import -m "rebuild GitHub Pages from generated-book" book
git push origin gh-pages
2 changes: 2 additions & 0 deletions rustbook-en/tools/preview-robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /

0 comments on commit 30721da

Please sign in to comment.