Crate sphinx_rustdocgen

crate sphinx_rustdocgen

Library for the sphinx-rustdocgen executable.

It consists of functions to extract content from the AST and to write the content to an RST or MD file. The crate is tested on itself, so all the documentation in the crate is in RST. The tests for Markdown are done on the dependencies.

Modules

Re-exports

Functions

fn traverse_crate(config: Configuration)

Traverse the crate and extract the docstrings for the items.

Args:
config:

The configuration for the crate.

Structs and Unions

struct Configuration
crate_name: String
crate_dir: PathBuf
doc_dir: PathBuf
force: bool
format: Format
visibility: DirectiveVisibility
strip_src: bool

Functions

fn get_canonical_crate_dir(&self) -> PathBuf
struct RuntimeConfiguration

Runtime version of the configuration after validation and normalizing

crate_name: String

The name of the crate in the configuration.

crate_dir: PathBuf

The crate’s root directory, the one which contains Cargo.toml.

src_dir: Option<PathBuf>

The crate’s src/ directory, if one is found and strip_src is true.

doc_dir: PathBuf

The directory under which to write the documents.

force: bool

Whether to rewrite all the documents, even the ones that are unchanged.

format: Format

The format of the docstrings.

max_visibility: DirectiveVisibility

Only document items with visibility less than this.

executables: Vec<SourceCodeFile>

The executables within the crate that will be documented.

lib: Option<SourceCodeFile>

The crate’s library to document, if any.

Functions

fn write_doc_file<F: for<'a> FnOnce(&'a Format, &'a DirectiveVisibility) -> Vec<String>>(&self, source_file_path: &Path, content_fn: F)

Write a documentation file for the provided source file path and content

Args:
source_file_path:

The path of the source file corresponding to the content.

content_fn:

A function to extract the content for the file.

Traits implemented

impl From<Configuration> for RuntimeConfiguration
fn from(config: Configuration) -> Self