Enum rustla::doctree::directives::BodyElementDirective[][src]

pub enum BodyElementDirective {
    Topic {
        title: String,
        name: Option<String>,
        class: Option<String>,
    },
    SideBar {
        title: Option<String>,
        name: Option<String>,
        class: Option<String>,
    },
    ParsedLiteralBlock {
        inline_nodes: Vec<TreeNodeType>,
        name: Option<String>,
        class: Option<String>,
    },
    Code {
        language: Option<String>,
        name: Option<String>,
        class: Option<String>,
        number_lines: Option<u32>,
    },
    Math {
        name: Option<String>,
        class: Option<String>,
    },
    Rubric {
        name: Option<String>,
        class: Option<String>,
    },
    Epigraph,
    Highlights,
    PullQuote,
    CompoundParagraph {
        name: Option<String>,
        class: Option<String>,
    },
    Container {
        class_names: Option<Vec<String>>,
        name: Option<String>,
    },
}

An enumeration of different body element directives.

Variants

Topic

A topic is like a block quote with a title, or a self-contained section with no subsections. Use the “topic” directive to indicate a self-contained idea that is separate from the flow of the document. Topics may occur anywhere a section or transition may occur. Body elements and topics may not contain nested topics.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#topic

Fields of Topic

title: Stringname: Option<String>class: Option<String>
SideBar

Sidebars are like miniature, parallel documents that occur inside other documents, providing related or reference material. A sidebar is typically offset by a border and “floats” to the side of the page; the document’s main text may flow around it. Sidebars can also be likened to super-footnotes; their content is outside of the flow of the document’s main text.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#sidebar

Fields of SideBar

title: Option<String>name: Option<String>class: Option<String>
ParsedLiteralBlock

Unlike an ordinary literal block, the “parsed-literal” directive constructs a literal block where the text is parsed for inline markup. It is equivalent to a line block with different rendering: typically in a typewriter/monospaced typeface, like an ordinary literal block. Parsed literal blocks are useful for adding hyperlinks to code examples.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#parsed-literal-block

Fields of ParsedLiteralBlock

inline_nodes: Vec<TreeNodeType>name: Option<String>class: Option<String>
Code

The “code” directive constructs a literal block. If the code language is specified, the content is parsed by the Pygments syntax highlighter and tokens are stored in nested inline elements with class arguments according to their syntactic category. The actual highlighting requires a style-sheet (e.g. one generated by Pygments, see the sandbox/stylesheets for examples).

The parsing can be turned off with the syntax_highlight configuration setting and command line option or by specifying the language as :class: option instead of directive argument. This also avoids warnings when Pygments is not installed or the language is not in the supported languages and markup formats.

For inline code, use the “code” role.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#code

Fields of Code

language: Option<String>name: Option<String>class: Option<String>number_lines: Option<u32>
Math

The “math” directive inserts blocks with mathematical content (display formulas, equations) into the document. The input format is subset of LaTeX math syntax with support for Unicode symbols. For inline formulas, use the “math” role.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#math

Fields of Math

name: Option<String>class: Option<String>
Rubric

The “rubric” directive inserts a “rubric” element into the document tree. A rubric is like an informal heading that doesn’t correspond to the document’s structure.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#rubric

Fields of Rubric

name: Option<String>class: Option<String>
Epigraph

An epigraph is an apposite (suitable, apt, or pertinent) short inscription, often a quotation or poem, at the beginning of a document or section.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#epigraph

Highlights

Highlights summarize the main points of a document or section, often consisting of a list.

The “highlights” directive produces a “highlights”-class block quote. See Epigraph above for an analogous example.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#highlights

PullQuote

A pull-quote is a small selection of text “pulled out and quoted”, typically in a larger typeface. Pull-quotes are used to attract attention, especially in long articles.

The “pull-quote” directive produces a “pull-quote”-class block quote. See Epigraph above for an analogous example.

Details https://docutils.sourceforge.io/docs/ref/rst/directives.html#pull-quote

CompoundParagraph

The “compound” directive is used to create a compound paragraph, which is a single logical paragraph containing multiple physical body elements such as simple paragraphs,literal blocks, tables, lists, etc., instead of directly containing text and inline elements. For example:

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#compound-paragraph

Fields of CompoundParagraph

name: Option<String>class: Option<String>
Container

The “container” directive surrounds its contents (arbitrary body elements) with a generic block-level “container” element. Combined with the optional “classes” attribute argument(s), this is an extension mechanism for users & applications. The “container” directive is the equivalent of HTML’s

element. It may be used to group a sequence of elements for user- or application-specific purposes.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#container

Fields of Container

class_names: Option<Vec<String>>name: Option<String>

Trait Implementations

impl Debug for BodyElementDirective[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.