Files
rust/src/librustdoc
Matthias Krüger 86595e4c88 Rollup merge of #134531 - GuillaumeGomez:extract-doctests, r=notriddle,aDotInTheVoid
[rustdoc] Add `--extract-doctests` command-line flag

Part of https://github.com/rust-lang/rust/issues/134529.

It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](https://github.com/Rust-for-Linux/linux/issues/2)).

For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information:

 * filename
 * line
 * langstr
 * text

cc `@ojeda`
r? `@notriddle`
2025-01-31 12:28:15 +01:00
..
2025-01-30 17:47:44 +01:00
2025-01-29 11:44:14 +01:00
2024-11-10 16:32:22 +01:00
2024-07-29 08:26:52 +10:00
2024-08-29 12:14:41 +02:00
2024-07-29 08:26:52 +10:00
2025-01-29 13:57:27 +01:00
2024-11-28 03:05:43 +01:00
2024-10-19 13:37:40 +00:00
2024-07-23 11:19:55 +02:00
2024-11-28 03:05:43 +01:00
2025-01-23 06:01:36 +00:00
2024-07-29 08:26:52 +10:00

For more information about how librustdoc works, see the rustc dev guide.