#rustdoc #doc #strip #tool

bin+lib rustdoc-stripper

A tool to manipulate rustdoc comments

18 releases

Uses old Rust 2015

0.1.18 Jun 1, 2021
0.1.17 Jan 24, 2021
0.1.16 Sep 30, 2020
0.1.14 Jul 27, 2020
0.1.1 Mar 31, 2016

#3 in #strip

Download history 113/week @ 2021-10-06 165/week @ 2021-10-13 154/week @ 2021-10-20 329/week @ 2021-10-27 313/week @ 2021-11-03 466/week @ 2021-11-10 276/week @ 2021-11-17 196/week @ 2021-11-24 330/week @ 2021-12-01 306/week @ 2021-12-08 350/week @ 2021-12-15 267/week @ 2021-12-22 447/week @ 2021-12-29 478/week @ 2022-01-05 645/week @ 2022-01-12 295/week @ 2022-01-19

1,940 downloads per month
Used in 4 crates

Apache-2.0

73KB
2K SLoC

rustdoc-stripper Build Status

rustdoc-stripper is a tool used to remove rustdoc comments from your code and save them in a comments.cmts file if you want to regenerate them.

Options

Available options for rustdoc-stripper are:

  • -h | --help : Displays this help
  • -s | --strip : Strips the current folder files and create a file with rustdoc information (comments.cmts by default)
  • -g | --regenerate : Recreate files with rustdoc comments from reading rustdoc information file (comments.cmts by default)
  • -n | --no-file-output : Display rustdoc information directly on stdout
  • -i | --ignore [filename]: Ignore the specified file, can be repeated as much as needed, only used when stripping files, ignored otherwise
  • -d | --dir [directory] : Specify a directory path to work on, optional
  • -v | --verbose : Activate verbose mode
  • -f | --force : Remove confirmation demands
  • -m | --ignore-macros : macros in hierarchy will be ignored (so only macros with doc comments will appear in the comments file)
  • -o | --comment-file : specify the file within you want to save rustdoc information

By default, rustdoc is run with -s option:

./rustdoc-stripper -s

IMPORTANT: Only files ending with '.rs' will be stripped/regenerated.

Ignore doc-comment

You can prevent a doc comment to be stripped by prepending it by // rustdoc-stripper-ignore-next.

You can mark the end of the block to ignore with // rustdoc-stripper-ignore-next-stop.

Example:

// rustdoc-stripper-ignore-next
/// existing comment
// rustdoc-stripper-ignore-next-stop
/// This part will be removed when running rustdoc-stripper!
pub unsafe fn new() -> Foo {}

No runtime deps