about summary refs log tree commit diff
path: root/src/librustdoc/html/markdown
AgeCommit message (Collapse)AuthorLines
2023-09-19Allow more characters in custom classesGuillaume Gomez-3/+18
2023-09-17Update tests for `custom_code_classes_in_docs` featureGuillaume Gomez-2/+5
2023-09-15Add `custom` tag for markdown codeblocksGuillaume Gomez-0/+36
2023-09-15Implement new eBNF for codeblock attributesGuillaume Gomez-51/+38
2023-09-15Add support for double quotes in markdown codeblock attributesGuillaume Gomez-0/+12
2023-09-15Add tests for `custom_code_classes_in_docs` featureGuillaume Gomez-27/+104
2023-09-15Implement custom classes for rustdoc code blocks with ↵Guillaume Gomez-0/+24
`custom_code_classes_in_docs` feature
2023-07-30Remove some unneeded `clone()` callsGuillaume Gomez-1/+1
2023-02-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-1/+1
2022-12-11Extend rustdoc hashtag prepended line testGuillaume Gomez-0/+8
2022-12-10Add test for non-rust code block hashtag prepended linesGuillaume Gomez-0/+37
2022-09-22rustdoc: fix unit testsMichael Howell-6/+5
2022-02-09Update rustdoc tests for headings indentGuillaume Gomez-34/+7
2022-02-09Unify headings indent and remove useless anchorGuillaume Gomez-10/+10
2022-01-28remove allow_fail test flagyuhaixin.hx-1/+0
2021-12-02Rename ID "main" into "main-content"Guillaume Gomez-4/+4
2021-10-04heading_level: u32 -> heading_offset: HeadingOffsetMukund Lakshman-3/+3
2021-10-04No need to default offset since we always override it.Mukund Lakshman-2/+2
2021-10-04Change `Markdown(...)` to `Markdown { ... }`Mukund Lakshman-4/+20
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-16/+16
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-09-08Auto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpiderbors-1/+23
`rustdoc`: compute correct line number for indented rust code blocks. This PR fixes a bug in `rustdoc` where it computes the wrong line number for indented rust code blocks (and subsequent blocks) it finds in markdown strings. To fix this issue, we decrement the line number if we find characters between the code block and the preceding line ending. I noticed this issue as I was trying to use `rustdoc` to extract examples from The Rust Reference and run them through the [Rust Model Checker](https://github.com/model-checking/rmc).
2021-08-25Add tests for `HtmlWithLimit`Noah Lev-0/+2
2021-07-26Pass correct line number for indented code blocks.Abdalrhman Mohamed-1/+23
2021-07-24Escape item search summariesNoah Lev-1/+11
I noticed that `Pin::new()`'s search summary looked off, and I realized that the reason is that it has inline code containing `Pin<P>`, which is not escaped and thus renders as a paragraph tag!
2021-06-18Update test cases for intra-doc links in summariesMichael Howell-1/+3
2021-03-09Treat header as first paragraph for shortened markdown descriptionsMichael Howell-0/+1
"The Rust Standard LibraryThe Rust Standard Library is the …" is an awful description.
2021-03-05Undo addition of boxesCamelid-1/+0
I don't think the boxing helped performance, in fact I think it potentially made it worse. The data was still being copied, but now it was through a pointer. Thinking about it more, I think boxing might only help when you're passing a big object around by value all the time, rather than the slowdown being that you're cloning it.
2021-03-05Don't unnecessarily clone some fields in `Context`Camelid-9/+3
There was no need to clone `id_map` because it was reset before each item was rendered. `deref_id_map` was not reset, but it was keyed by `DefId` and thus was unlikely to have collisions (at least for now). Now we just clone the fields that need to be cloned, and instead create fresh versions of the others.
2021-02-26Auto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514bors-4/+42
[librustdoc] Only split lang string on `,`, ` `, and `\t` Split markdown lang strings into tokens on `,`. The previous behavior was to split lang strings into tokens on any character that wasn't a `_`, `_`, or alphanumeric. This is a potentially breaking change, so please scrutinize! See discussion in #78344. I noticed some test cases that made me wonder if there might have been some reason for the original behavior: ``` t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None); t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None); t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None); t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None); ``` It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`. I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.` It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted. Closes https://github.com/rust-lang/rust/issues/78344.
2021-02-23Rollup merge of #79423 - camelid:smart-punct, r=jyn514Dylan DPC-5/+5
Enable smart punctuation Closes #76690.
2021-02-20Cut off plain text descriptions after headersMichael Howell-0/+1
Before: The Rust Standard LibraryThe Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like `Vec<T>` and `Option<T>`, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things. After: The Rust Standard Library
2021-02-12[librustdoc] Reform lang string token splittingCasey Rodarmor-4/+42
Only split doctest lang strings on `,`, ` `, and `\t`. Additionally, to preserve backwards compatibility with pandoc-style langstrings, strip a surrounding `{}`, and remove leading `.`s from each token. Prior to this change, doctest lang strings were split on all non-alphanumeric characters except `-` or `_`, which limited future extensions to doctest lang string tokens, for example using `=` for key-value tokens. This is a breaking change, although it is not expected to be disruptive, because lang strings using separators other than `,` and ` ` are not very common
2021-02-09Update Markdown unit testsCamelid-5/+5
2020-12-20impl Default for LangString, replacing all_false by defaultAlexis Bourget-30/+18
2020-12-13Refactor test_lang_string_parse to make it clearerAlexis Bourget-74/+69
2020-12-03Render Markdown in search resultsCamelid-1/+32
Previously Markdown documentation was not rendered to HTML for search results, which led to the output not being very readable, particularly for inline code. This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark (the library rustdoc uses to parse Markdown for the main text of documentation). However, the text for the title attribute (the text shown when you hover over an element) still uses the plain-text rendering since it is displayed in browsers as plain-text. Only these styles will be rendered; everything else is stripped away: * *italics* * **bold** * `inline code`
2020-09-03Auto merge of #73819 - euclio:rustdoc-summaries, r=jyn514,GuillaumeGomezbors-3/+10
rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474. Unfortunately this is not quite ready to go because the newly-working links trigger a bunch of linkcheck failures. The failures are tough to fix because the links are resolved relative to the implementor, which could be anywhere in the module hierarchy. (In the current docs, these links end up rendering as uninterpreted markdown syntax, so I don't think these failures are any worse than the status quo. It might be acceptable to just add them to the linkchecker whitelist.) Ideally this could be fixed with intra-doc links ~~but it isn't working for me: I am currently investigating if it's possible to solve it this way.~~ Opened #73829. EDIT: This is now ready!
2020-08-31Fix stringGuillaume Gomez-1/+1
2020-08-31Fix strings indentGuillaume Gomez-20/+15
2020-08-30rustdoc: do not use plain summary for trait implsAndy Russell-3/+10
Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.
2020-07-15rustdoc: Rename internal API fns to `into_string`Lzu Tao-3/+4
to avoid surprising listed in API guidelines.
2020-05-06Update librustdoc ID testsGuillaume Gomez-4/+4
2020-04-23Update LangString::parse usage in markdown testsGuillaume Gomez-1/+1
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+1
2019-12-24x.py fmt after previous deignoreMark Rousskov-71/+162
2019-09-03Added ability to crosscompile doctestsDario Gonzalez-21/+23
2019-08-11Drop RefCell from IdMap in markdown renderingMark Rousskov-6/+6
2019-08-02librustdoc: Unconfigure tests during normal buildVadim Petrochenkov-0/+20
2019-06-16Separate librustcdoc modulechansuke-0/+125