Generate markdown docs with rustdoc?
Asked Answered
M

1

9

Is there any way to generate a single markdown file in doc/ from the /// comments?

Multiple markdown files (doc/main.md, doc/foo.md, etc) would be nice too.

I'm new to rust, and while the generated HTML documentation is nice, I mostly live on the command line and really don't want to be switching between my terminal and a web browser just to read the docs. That breaks the flow and takes me out of the zone. Also, md is easily converted to man pages, or to TeX for printed or PDF docs.

(I'm used to suspending vim with Ctrl-Z or using another terminal tab, and running man or perldoc or pydoc etc. Text-mode browsers like lynx nor links are not good options for me - navigation is clumsy, the output is ugly on my 200+ column terminals windows if i forget to use the -width option, and neither support javascript)

Methadone answered 3/12, 2019 at 4:48 Comment(1)
1 year later and we still don't have a clear answer for this?Calvano
L
2

cargo-readme might work for you. You run cargo readme -i foo.rs > FOO.md and it populates FOO.md with the contents of the doc comments from foo.rs. Found it via reddit.

Lakeishalakeland answered 22/8, 2021 at 17:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.