Skip to content

rustdoc: add unstable latex math markdown feature#156032

Draft
notriddle wants to merge 3 commits into
rust-lang:mainfrom
notriddle:rustdoc-texmath
Draft

rustdoc: add unstable latex math markdown feature#156032
notriddle wants to merge 3 commits into
rust-lang:mainfrom
notriddle:rustdoc-texmath

Conversation

@notriddle
Copy link
Copy Markdown
Contributor

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels May 1, 2026
@rust-log-analyzer

This comment has been minimized.

notriddle added 3 commits May 9, 2026 22:09
This adds a flag to the doc context to track whether a rendering has a
math span anywhere in the page. If so, it loads the resources needed for
math, but otherwise it skips them. The math font, in particular, is
about 200K, which is bigger than Fira Sans.
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking termize v0.2.1
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `TagEnd::BlockQuote`
    --> src/tools/clippy/clippy_lints/src/doc/mod.rs:1124:29
     |
1124 |                         End(TagEnd::BlockQuote) => next_range.end,
     |                             ^^^^^^^^^^^^^^^^^^ help: use the tuple variant pattern syntax instead: `TagEnd::BlockQuote(_)`
     |
    ::: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pulldown-cmark-0.13.3/src/lib.rs:388:5
     |
 388 |     BlockQuote(Option<BlockQuoteKind>),
     |     ---------- `TagEnd::BlockQuote` defined here

error[E0532]: expected unit struct, unit variant or constant, found tuple variant `TagEnd::BlockQuote`
    --> src/tools/clippy/clippy_lints/src/doc/mod.rs:1148:17
     |
1148 |             End(TagEnd::BlockQuote) => {
     |                 ^^^^^^^^^^^^^^^^^^ help: use the tuple variant pattern syntax instead: `TagEnd::BlockQuote(_)`
     |
    ::: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pulldown-cmark-0.13.3/src/lib.rs:388:5
     |
 388 |     BlockQuote(Option<BlockQuoteKind>),
     |     ---------- `TagEnd::BlockQuote` defined here

[RUSTC-TIMING] termize test:false 0.037
   Compiling pulldown-cmark v0.11.3
[RUSTC-TIMING] build_script_build test:false 0.081
    Checking unit-prefix v0.5.2
---
[RUSTC-TIMING] unicase test:false 0.106
error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> src/tools/clippy/clippy_lints/src/doc/doc_paragraphs_missing_punctuation.rs:59:37
    |
 59 |         Parser::new_ext(doc_string, main_body_opts() - Options::ENABLE_SMART_PUNCTUATION).into_offset_iter()
    |                                     ^^^^^^^^^^^^^^-- argument #1 of type `std::option::Option<&DocAttributeSyntax>` is missing
    |
note: function defined here
   --> compiler/rustc_resolve/src/rustdoc.rs:252:8
    |
252 | pub fn main_body_opts(doc_syntax: Option<&DocAttributeSyntax>) -> Options {
    |        ^^^^^^^^^^^^^^
help: provide the argument
    |
 59 |         Parser::new_ext(doc_string, main_body_opts(/* std::option::Option<&DocAttributeSyntax> */) - Options::ENABLE_SMART_PUNCTUATION).into_offset_iter()
    |                                                    ++++++++++++++++++++++++++++++++++++++++++++++

error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> src/tools/clippy/clippy_lints/src/doc/mod.rs:896:13
    |
896 |             main_body_opts() - Options::ENABLE_SMART_PUNCTUATION,
    |             ^^^^^^^^^^^^^^-- argument #1 of type `std::option::Option<&DocAttributeSyntax>` is missing
    |
note: function defined here
   --> compiler/rustc_resolve/src/rustdoc.rs:252:8
    |
252 | pub fn main_body_opts(doc_syntax: Option<&DocAttributeSyntax>) -> Options {
    |        ^^^^^^^^^^^^^^
help: provide the argument
    |
896 |             main_body_opts(/* std::option::Option<&DocAttributeSyntax> */) - Options::ENABLE_SMART_PUNCTUATION,
    |                            ++++++++++++++++++++++++++++++++++++++++++++++

error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> src/tools/clippy/clippy_lints/src/doc/mod.rs:924:16
    |
924 |     let opts = main_body_opts() - Options::ENABLE_SMART_PUNCTUATION;
    |                ^^^^^^^^^^^^^^-- argument #1 of type `std::option::Option<&DocAttributeSyntax>` is missing
    |
note: function defined here
   --> compiler/rustc_resolve/src/rustdoc.rs:252:8
    |
252 | pub fn main_body_opts(doc_syntax: Option<&DocAttributeSyntax>) -> Options {
    |        ^^^^^^^^^^^^^^
help: provide the argument
    |
924 |     let opts = main_body_opts(/* std::option::Option<&DocAttributeSyntax> */) - Options::ENABLE_SMART_PUNCTUATION;
    |                               ++++++++++++++++++++++++++++++++++++++++++++++

[RUSTC-TIMING] askama_derive test:false 3.764
   Compiling askama_macros v0.16.0
[RUSTC-TIMING] pulldown_cmark test:false 0.909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants