-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch warning blocks to use admonitions #1595
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fixes an issue where if an admonition blockquote had multiple paragraphs, it would incorrectly interpret it as multiple blockquotes, and break the formatting. The problem is that the regex was expecting at least one space after the `>`. I vaguely recall doing this intentionally, but I don't remember now why I did it this way, and I can't find any problems with this approach.
This adds the term ("Warning") at the beginning of the admonition with a standardized styling (bold italics, with a colon). This ensures uniform styling.
This fixes the formatting for admonitions when they are indented. The code was missing the indentation for the parts that it was adding, which made it overall inconsistent and fail to render correctly.
This switches the custom div-based warnings to the admonition syntax provided by the mdbook-spec extension.
Now that warnings are wrapped in blockquotes, the CSS needs to be adjusted for that. This also includes a minor fix for the `::before` rule so that it only applies to the first paragraph in a multi-paragraph warning.
traviscross
approved these changes
Sep 3, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Sep 9, 2024
Update books ## rust-lang/edition-guide 1 commits in eeba2cb9c37ab74118a4fb5e5233f7397e4a91f8..b3ca7ade0f87d7e3fb538776defc5b2cc4188172 2024-09-03 22:59:56 UTC to 2024-09-03 22:59:56 UTC - Rename `static_mut_refs` file to plural ## rust-embedded/book 1 commits in ff5d61d56f11e1986bfa9652c6aff7731576c37d..dbae36bf3f8410aa4313b3bad42e374735d48a9d 2024-09-04 20:49:11 UTC to 2024-09-04 20:49:11 UTC - Fix small error in c bindings (rust-embedded/book#377) ## rust-lang/reference 6 commits in 0668397076da350c404dadcf07b6cbc433ad3743..687faf9958c52116d003b41dfd29cc1cf44f5311 2024-09-03 20:21:23 UTC to 2024-08-29 01:11:29 UTC - `asm!`: clarify that `nomem` / `readonly` can access private memory (rust-lang/reference#1598) - Switch warning blocks to use admonitions (rust-lang/reference#1595) - dont use stdcall on x86_64 where it is not a valid ABI (rust-lang/reference#1600) - Add capturing and precise capturing rules (rust-lang/reference#1577) - Add a prefix to rule HTML IDs (rust-lang/reference#1593) - Add a description of rule identifiers (rust-lang/reference#1594) ## rust-lang/rust-by-example 2 commits in 859786c5bc99301bbc22fc631a5c2b341860da08..c79ec345f08a1e94494cdc8c999709a90203fd88 2024-09-08 13:24:48 UTC to 2024-09-08 13:24:08 UTC - Fix typo in conversion/from_into (rust-lang/rust-by-example#1882) - Corrected x values for example rectangle (rust-lang/rust-by-example#1884) ## rust-lang/rustc-dev-guide 9 commits in fa928a6d19e1666d8d811dfe3fd35cdad3b4e459..0ed9229f5b6f7824b333beabd7e3d5ba4b9bd971 2024-09-09 10:58:45 UTC to 2024-08-31 13:02:08 UTC - fix some comments (rust-lang/rustc-dev-guide#2059) - Fix a link and create an implied internal link (rust-lang/rustc-dev-guide#2051) - link to additional LLVM update PRs (rust-lang/rustc-dev-guide#2055) - fix/improve rdg contributing howto (rust-lang/rustc-dev-guide#2056) - fixed the typo (rust-lang/rustc-dev-guide#2058) - fix typo maker -> marker (thanks `@lholten)` (rust-lang/rustc-dev-guide#2057) - improve query system documentation (rust-lang/rustc-dev-guide#2041) - add section on overlap checks (rust-lang/rustc-dev-guide#2042) - clarify the role of rustc_const_unstable (rust-lang/rustc-dev-guide#2045)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 9, 2024
Rollup merge of rust-lang#130158 - rustbot:docs-update, r=ehuss Update books ## rust-lang/edition-guide 1 commits in eeba2cb9c37ab74118a4fb5e5233f7397e4a91f8..b3ca7ade0f87d7e3fb538776defc5b2cc4188172 2024-09-03 22:59:56 UTC to 2024-09-03 22:59:56 UTC - Rename `static_mut_refs` file to plural ## rust-embedded/book 1 commits in ff5d61d56f11e1986bfa9652c6aff7731576c37d..dbae36bf3f8410aa4313b3bad42e374735d48a9d 2024-09-04 20:49:11 UTC to 2024-09-04 20:49:11 UTC - Fix small error in c bindings (rust-embedded/book#377) ## rust-lang/reference 6 commits in 0668397076da350c404dadcf07b6cbc433ad3743..687faf9958c52116d003b41dfd29cc1cf44f5311 2024-09-03 20:21:23 UTC to 2024-08-29 01:11:29 UTC - `asm!`: clarify that `nomem` / `readonly` can access private memory (rust-lang/reference#1598) - Switch warning blocks to use admonitions (rust-lang/reference#1595) - dont use stdcall on x86_64 where it is not a valid ABI (rust-lang/reference#1600) - Add capturing and precise capturing rules (rust-lang/reference#1577) - Add a prefix to rule HTML IDs (rust-lang/reference#1593) - Add a description of rule identifiers (rust-lang/reference#1594) ## rust-lang/rust-by-example 2 commits in 859786c5bc99301bbc22fc631a5c2b341860da08..c79ec345f08a1e94494cdc8c999709a90203fd88 2024-09-08 13:24:48 UTC to 2024-09-08 13:24:08 UTC - Fix typo in conversion/from_into (rust-lang/rust-by-example#1882) - Corrected x values for example rectangle (rust-lang/rust-by-example#1884) ## rust-lang/rustc-dev-guide 9 commits in fa928a6d19e1666d8d811dfe3fd35cdad3b4e459..0ed9229f5b6f7824b333beabd7e3d5ba4b9bd971 2024-09-09 10:58:45 UTC to 2024-08-31 13:02:08 UTC - fix some comments (rust-lang/rustc-dev-guide#2059) - Fix a link and create an implied internal link (rust-lang/rustc-dev-guide#2051) - link to additional LLVM update PRs (rust-lang/rustc-dev-guide#2055) - fix/improve rdg contributing howto (rust-lang/rustc-dev-guide#2056) - fixed the typo (rust-lang/rustc-dev-guide#2058) - fix typo maker -> marker (thanks `@lholten)` (rust-lang/rustc-dev-guide#2057) - improve query system documentation (rust-lang/rustc-dev-guide#2041) - add section on overlap checks (rust-lang/rustc-dev-guide#2042) - clarify the role of rustc_const_unstable (rust-lang/rustc-dev-guide#2045)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This switches the warning div blocks to use the admonition feature provided by mdbook-spec.
This also includes several fixes to the admonition support, described in the individual commits.
The rendering should essentially look identical in most cases, with some minor fixes for multi-paragraph warnings, and more consistent styling of the word "Warning".