summary refs log tree commit diff
path: root/src/librustdoc/html/markdown.rs
AgeCommit message (Collapse)AuthorLines
2018-07-27Prefer to_string() to format!()ljedrz-4/+4
2018-07-06Auto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, ↵bors-7/+36
r=QuietMisdreavus Prevent some markdown transformation on short docblocks Before: <img width="1440" alt="screen shot 2018-06-28 at 01 46 01" src="https://user-images.githubusercontent.com/3050060/42005762-7d533bbe-7a76-11e8-8361-027886803399.png"> After: <img width="1440" alt="screen shot 2018-06-28 at 01 46 02" src="https://user-images.githubusercontent.com/3050060/42005768-81bd59a0-7a76-11e8-819b-9b4be72579d6.png"> This is only performed on short doc blocks, not on plain ones. Not all transformations are prevented (you still have a few like urls, code blocks, etc...). cc @nical r? @QuietMisdreavus
2018-06-28Prevent some markdown transformation on short docblocksGuillaume Gomez-7/+36
2018-06-26rustdoc codeblock hash escapeLucas Morales-10/+10
2018-06-03Show which line the link is coming from.kennytm-3/+22
2018-03-22Rollup merge of #49189 - GuillaumeGomez:fix-implied-shortcut-links, ↵kennytm-2/+2
r=QuietMisdreavus Fix automatic urls with backticks Fixes #49164. r? @QuietMisdreavus
2018-03-19Fix automatic urls with backticksGuillaume Gomez-2/+2
2018-03-18Add warning for invalid start of code blocks in rustdocGuillaume Gomez-1/+6
2018-03-16fix doctestQuietMisdreavus-1/+1
2018-02-21Rollup merge of #48382 - GuillaumeGomez:fix-rustdoc-test-panic, r=estebankGuillaume Gomez-12/+15
Fix rustdoc test ICE Fixes #48377. r? @QuietMisdreavus
2018-02-20Fix rustdoc test ICEGuillaume Gomez-12/+15
2018-02-18Generate shortcut linksManish Goregaokar-2/+19
2018-02-18Include shortcut links in markdown_linksManish Goregaokar-7/+19
2018-02-17Remove useless commentGuillaume Gomez-1/+0
2018-02-16Remove hoedown from rustdocGuillaume Gomez-688/+60
Is it really time? Have our months, no, *years* of suffering come to an end? Are we finally able to cast off the pall of Hoedown? The weight which has dragged us down for so long? ----- So, timeline for those who need to catch up: * Way back in December 2016, [we decided we wanted to switch out the markdown renderer](https://github.com/rust-lang/rust/issues/38400). However, this was put on hold because the build system at the time made it difficult to pull in dependencies from crates.io. * A few months later, in March 2017, [the first PR was done, to switch out the renderers entirely](https://github.com/rust-lang/rust/pull/40338). The PR itself was fraught with CI and build system issues, but eventually landed. * However, not all was well in the Rustdoc world. During the PR and shortly after, we noticed [some differences in the way the two parsers handled some things](https://github.com/rust-lang/rust/issues/40912), and some of these differences were major enough to break the docs for some crates. * A couple weeks afterward, [Hoedown was put back in](https://github.com/rust-lang/rust/pull/41290), at this point just to catch tests that Pulldown was "spuriously" running. This would at least provide some warning about spurious tests, rather than just breaking spontaneously. * However, the problems had created enough noise by this point that just a few days after that, [Hoedown was switched back to the default](https://github.com/rust-lang/rust/pull/41431) while we came up with a solution for properly warning about the differences. * That solution came a few weeks later, [as a series of warnings when the HTML emitted by the two parsers was semantically different](https://github.com/rust-lang/rust/pull/41991). But that came at a cost, as now rustdoc needed proc-macro support (the new crate needed some custom derives farther down its dependency tree), and the build system was not equipped to handle it at the time. It was worked on for three months as the issue stumped more and more people. * In that time, [bootstrap was completely reworked](https://github.com/rust-lang/rust/pull/43059) to change how it ordered compilation, and [the method by which it built rustdoc would change](https://github.com/rust-lang/rust/pull/43482), as well. This allowed it to only be built after stage1, when proc-macros would be available, allowing the "rendering differences" PR to finally land. * The warnings were not perfect, and revealed a few [spurious](https://github.com/rust-lang/rust/pull/44368) [differences](https://github.com/rust-lang/rust/pull/45421) between how we handled the renderers. * Once these were handled, [we flipped the switch to turn on the "rendering difference" warnings all the time](https://github.com/rust-lang/rust/pull/45324), in October 2017. This began the "warning cycle" for this change, and landed in stable in 1.23, on 2018-01-04. * Once those warnings hit stable, and after a couple weeks of seeing whether we would get any more reports than what we got from sitting on nightly/beta, [we switched the renderers](https://github.com/rust-lang/rust/pull/47398), making Pulldown the default but still offering the option to use Hoedown. And that brings us to the present. We haven't received more new issues from this in the meantime, and the "switch by default" is now on beta. Our reasoning is that, at this point, anyone who would have been affected by this has run into it already.
2018-01-29rustdoc: Fix link title rendering with hoedownOliver Middleton-1/+1
The link title needs to be HTML escaped.
2018-01-22don't process code blocks when scanning for linksQuietMisdreavus-2/+1
2018-01-22Temporary fix missing escape_href in hoedown_link by copying pulldown's codeManish Goregaokar-1/+53
2018-01-22Fix unit testsManish Goregaokar-3/+3
2018-01-22Don't return early and discard the link in hoedown modeManish Goregaokar-1/+1
2018-01-22add intra-links support to hoedownQuietMisdreavus-8/+66
2018-01-22cleanupQuietMisdreavus-2/+8
2018-01-22Add LinkReplacer pass for pulldownManish Goregaokar-7/+40
2018-01-22resolve paths when cleaning docsQuietMisdreavus-0/+3
2018-01-22new function to pull the links from a chunk of markdownQuietMisdreavus-167/+250
2018-01-10Use correct line offsets for doctests (fixes #45868)Manish Goregaokar-2/+2
2017-11-14Rollup merge of #45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomezGuillaume Gomez-4/+4
rustdoc: tweak notes on ignore/compile_fail examples Part of https://github.com/rust-lang/rust/issues/44927 This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo. ![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2017-11-06tweak notes on ignore/compile_fail examplesQuietMisdreavus-4/+4
2017-11-03Copy `AsciiExt` methods to `char` directlyLukas Kalbertodt-1/+0
This is done in order to deprecate AsciiExt eventually.
2017-10-21change footnote anchor formats to fix spurious rendering differencesQuietMisdreavus-3/+3
2017-09-17Rollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavusTim Neumann-6/+39
Codeblock color <img width="1440" alt="screen shot 2017-09-07 at 21 53 58" src="https://user-images.githubusercontent.com/3050060/30183045-4319108e-9419-11e7-98da-da54952cab37.png"> This screenshot has been generated from: ```rust /// foo /// /// ```compile_fail /// foo(); /// ``` /// /// ```ignore /// goo(); /// ``` /// /// ``` /// let x = 0; /// ``` pub fn bar() -> usize { 2 } ``` r? @QuietMisdreavus cc @rust-lang/docs
2017-09-15Auto merge of #43949 - GuillaumeGomez:compile_fail_stable, r=alexcrichtonbors-3/+1
Compile fail stable Since #30726, we never made the `compile_fail` flag nor the error code check stable. I think it's time to change this fact. r? @alexcrichton
2017-09-11Add arrow and improve displayGuillaume Gomez-22/+8
2017-09-11Add class for codeblocksGuillaume Gomez-6/+53
2017-09-05Test rustdoc unit tests.Mark Simulacrum-2/+4
Doc tests are temporarily disabled until next release cycle, since current beta Cargo errors on them. Upgrade should be smooth as the relevant tests are already fixed in this commit.
2017-09-01set compile_fail flag stableGuillaume Gomez-3/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-9/+9
Like #43008 (f668999), but _much more aggressive_.
2017-08-13Rollup merge of #43782 - nrc:include, r=GuillaumeGomezGuillaume Gomez-4/+4
Fix include! in doc tests By making the path relative to the current file. Fixes #43153 [breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.
2017-08-10doc tests: use the filename from the source file for doc test programs, ↵Nick Cameron-4/+4
rather than a dummy name
2017-08-08Remove all usage of hoedown_buffer_putsGuillaume Gomez-2/+1
2017-08-07Remove \0 printingGuillaume Gomez-5/+5
2017-08-06Fix hoedown error in rustdocGuillaume Gomez-8/+7
2017-06-24Shorten some lines so this can pass the tidy checksPaul Woolcock-15/+19
2017-06-24add `allow_fail` test attributePaul Woolcock-18/+23
This change allows the user to add an `#[allow_fail]` attribute to tests that will cause the test to compile & run, but if the test fails it will not cause the entire test run to fail. The test output will show the failure, but in yellow instead of red, and also indicate that it was an allowed failure.
2017-06-23Removed as many "```ignore" as possible.kennytm-1/+1
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-05-06Allow # to appear in rustdoc code output.Mark Simulacrum-27/+48
"##" at the start of a trimmed rustdoc line is now cut to "#" and then shown. If the user wanted to show "##", they can type "###".
2017-04-22Fix line displayGuillaume Gomez-8/+4
2017-04-22Fix testsGuillaume Gomez-4/+5
2017-04-22Re-enable hoedown by defaultGuillaume Gomez-41/+294
2017-04-20Fix line display for hoedownGuillaume Gomez-3/+7