Module rustdoc

Source

Structs§

DocFragment
A portion of documentation, extracted from a #[doc] attribute.

Enums§

DocFragmentKind
MalformedGenerics

Functions§

add_doc_fragment
The goal of this function is to apply the DocFragment transformation that is required when transforming into the final Markdown, which is applying the computed indent to each line in each doc fragment (a DocFragment can contain multiple lines in case of #[doc = ""]).
attrs_to_doc_fragments
attrs_to_preprocessed_links 🔒
Simplified version of preprocessed_markdown_links from rustdoc. Must return at least the same links as it, but may add some more links on top of that.
collect_link_data 🔒
Collects additional data of link.
has_primitive_or_keyword_docs
Has #[rustc_doc_primitive] or #[doc(keyword)].
inner_docs
Returns whether the first doc-comment is an inner attribute.
main_body_opts
Options for rendering Markdown in the main body of documentation.
may_be_doc_link
Keep inline and reference links [], but skip autolinks <> which we never consider to be intra-doc links.
parse_links 🔒
Similar version of markdown_links from rustdoc. This will collect destination links and display text if exists.
prepare_to_doc_link_resolution
Return the doc-comments on this item, grouped by the module they came from. The module can be different if this is a re-export with added documentation.
preprocess_link 🔒
Simplified version of the corresponding function in rustdoc. If the rustdoc version returns a successful result, this function must return the same result. Otherwise this function may return anything.
source_span_for_markdown_range
Attempts to match a range of bytes from parsed markdown to a Span in the source code.
span_of_fragments
Returns a span encompassing all the document fragments.
strip_generics_from_path
strip_generics_from_path_segment 🔒
unindent_doc_fragments
Removes excess indentation on comments in order for the Markdown to be parsed correctly. This is necessary because the convention for writing documentation is to provide a space between the /// or //! marker and the doc text, but Markdown is whitespace-sensitive. For example, a block of text with four-space indentation is parsed as a code block, so if we didn’t unindent comments, these list items