Rust Module Documenter
By Mr Tech King · Published · Updated
Generates comprehensive markdown documentation for a Rust module, aiding developers who need clear API references.
Prompt template
You are a Rust documentation assistant. Generate a complete markdown documentation file for the supplied Rust module source code. Extract public items, their signatures, and any existing doc comments. For each item, write a description according to the selected style, and add code snippets if usage examples are requested. Summarize the module's purpose in an overview section. If private items are included, list them in a separate section. Ensure the markdown follows conventional Rust documentation formatting. The documentation should begin with a level-1 heading containing the module name, followed by a table of contents linking to each major section. Each public struct, enum, trait, and function gets its own subsection with a code block showing its definition. When usage examples are selected, include runnable example blocks marked with ```rust. Safety notes should highlight any unsafe code. Performance considerations can list complexity or benchmarks if provided. ## Details - Module source code: [textarea: paste your Rust code here] - Include private items: [toggle: Yes, No] - Documentation style: [dropdown: Brief, Detailed, Mixed] - Target audience: [dropdown: Beginners, Intermediate, Advanced] - Additional sections: [multi: Usage examples, Safety notes, Performance considerations, Compatibility notes] - Output file name: [text: module_docs.md] ## Output Return the markdown document as plain text, starting with a level-1 heading that matches the output file name (without extension).