Commit graph

17 commits

Author SHA1 Message Date
Casey Rodarmor
66f4883308
[librustdoc] Reform lang string token splitting
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-12 00:02:52 -08:00
Alexis Bourget
74bd2eae33 impl Default for LangString, replacing all_false by default 2020-12-20 00:26:38 +01:00
Alexis Bourget
ec0f1d70c9 Refactor test_lang_string_parse to make it clearer 2020-12-13 17:47:46 +01:00
Camelid
5d4a7128d9 Render Markdown in search results
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-12-03 14:11:37 -08:00
bors
62dad457bc Auto merge of #73819 - euclio:rustdoc-summaries, r=jyn514,GuillaumeGomez
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-09-03 19:07:38 +00:00
Guillaume Gomez
b741cc5b7d Fix string 2020-08-31 17:07:25 +02:00
Guillaume Gomez
c9a48d1d73 Fix strings indent 2020-08-31 13:16:50 +02:00
Andy Russell
e0822ecdbc
rustdoc: do not use plain summary for trait impls
Fixes #38386.
Fixes #48332.
Fixes #49430.
Fixes #62741.
Fixes #73474.
2020-08-30 12:02:18 -04:00
Lzu Tao
0f4e4a022c rustdoc: Rename internal API fns to into_string
to avoid surprising listed in API guidelines.
2020-07-15 10:55:40 +00:00
Guillaume Gomez
a64d643956 Update librustdoc ID tests 2020-05-06 09:59:47 +02:00
Guillaume Gomez
977603cd1f Update LangString::parse usage in markdown tests 2020-04-23 17:02:37 +02:00
Mazdak Farrokhzad
b1aad76586 Normalize syntax::edition imports. 2020-01-02 19:31:38 +01:00
Mark Rousskov
6891388e66 x.py fmt after previous deignore 2019-12-24 17:38:22 -05:00
Dario Gonzalez
98bd8fd88c Added ability to crosscompile doctests 2019-09-03 13:48:18 -07:00
Mark Rousskov
1aa0964b54 Drop RefCell from IdMap in markdown rendering 2019-08-11 10:47:58 -04:00
Vadim Petrochenkov
a332e224a3 librustdoc: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
chansuke
46e622beb9 Separate librustcdoc module 2019-06-16 14:17:01 +03:00