Skip to main content

sections

Function sections 

pub fn sections(lines: &[String]) -> Vec<(String, String)>
Expand description

Splits a doc comment into its #-headed sections.

Rustdoc’s convention is that a module’s documentation opens with a summary and then uses # for its sections, which on a page that already has an <h1> are one level too high. Splitting them is what lets a generator publish the sections it wants under headings of its own. Everything before the first heading is dropped: it is the summary, and a page states its own subject.

A # inside a fenced code block is a comment, not a heading.