TreeNodeType

Enum TreeNodeType 

Source
pub enum TreeNodeType {
Show 118 variants Abbreviation { name: Option<String>, classes: Option<String>, }, AbsoluteURI { text: String, }, Acronym, Address, Admonition { content_indent: usize, classes: Option<String>, name: Option<String>, variant: AdmonitionType, }, Attribution { raw_text: String, }, Author, Authors, AutomaticSectionNumbering { depth: Option<u32>, prefix: Option<String>, suffix: Option<String>, start: Option<u32>, }, BlockQuote { body_indent: usize, }, BulletList { bullet: char, bullet_indent: usize, text_indent: usize, }, BulletListItem { bullet: char, bullet_indent: usize, text_indent: usize, }, Caption { indent: usize, }, Citation { body_indent: usize, label: String, }, CitationReference { displayed_text: String, target_label: String, }, Class { body_indent: usize, classes: Vec<String>, }, Classifier, Code { text: String, language: Option<String>, name: Option<String>, class: Option<String>, number_lines: Option<String>, }, ColSpec, Comment { text: Option<String>, }, CompoundParagraph { body_indent: usize, name: Option<String>, class: Option<String>, }, Contact, Container { body_indent: usize, class_names: Option<Vec<String>>, name: Option<String>, }, Copyright, CSVTable {
Show 15 fields name: Option<String>, class: Option<String>, widths: Option<TableColWidths>, width: Option<MetricType>, header_rows: Option<u32>, stub_columns: Option<u32>, header: Option<Vec<String>>, file: Option<String>, url: Option<String>, encoding: Option<String>, delim: Option<char>, quote: Option<char>, keepspace: Option<bool>, escape: Option<char>, align: Option<HorizontalAlignment>,
}, Date, Decoration, Definition, DefinitionList { term_indent: usize, }, DefinitionListItem { term: String, classifiers: Vec<String>, body_indent: usize, }, Description, DocInfo, DoctestBlock, Document, Emphasis { text: String, }, EmptyLine, Entry { is_last: bool, }, EnumeratedList { delims: EnumDelims, kind: EnumKind, start_index: usize, n_of_items: usize, enumerator_indent: usize, }, EnumeratedListItem { delims: EnumDelims, kind: EnumKind, index_in_list: usize, enumerator_indent: usize, text_indent: usize, }, ExternalHyperlinkTarget { marker_indent: usize, target: String, uri: String, }, Field, FieldBody { indentation: usize, }, FieldList { marker_indent: usize, }, FieldListItem { raw_marker_name: String, marker_name_as_inline_nodes: Vec<TreeNodeType>, marker_indent: usize, body_indent: usize, }, Figure { body_indent: usize, align: Option<HorizontalAlignment>, figwidth: Option<Length>, figclass: Option<String>, name: Option<String>, }, Footer { body_indent: usize, }, Footnote { body_indent: usize, kind: FootnoteKind, label: String, target: String, }, FootnoteReference { displayed_text: String, target_label: String, kind: FootnoteKind, }, Generated, Header { body_indent: usize, }, Image { uri: String, alt: Option<String>, height: Option<Length>, width: Option<Length>, scale: Option<f64>, align: Option<HTMLAlignment>, target: Option<String>, name: Option<String>, class: Option<String>, inline: bool, }, Include { uri: String, start_line: Option<u32>, end_line: Option<u32>, start_after: Option<u32>, end_before: Option<u32>, literal: bool, code: Option<Option<String>>, number_lines: Option<Option<u32>>, encoding: Option<String>, tab_width: Option<u32>, name: Option<String>, class: Option<String>, }, IndirectHyperlinkTarget { marker_indent: usize, target: String, indirect_target: String, }, Inline, InlineTarget { target_label: String, }, InterpretedText { role: String, content: String, }, Label, Legend { body_indent: usize, }, Line, LineBlock, ListTable { body_indent: usize, title: Option<String>, widths: Option<TableColWidths>, width: Option<MetricType>, header_rows: Option<u32>, stub_columns: Option<u32>, align: Option<HorizontalAlignment>, }, Literal { text: String, }, LiteralBlock { text: String, }, Math { text: String, name: Option<String>, class: Option<String>, }, MathBlock { math_block: String, name: Option<String>, class: Option<String>, }, OptionList { option_indent: usize, }, OptionListItem { body_indent: usize, }, OptionString, Organization, Paragraph { indent: usize, }, ParsedLiteralBlock, Pending, Problematic, Raw, Reference { displayed_text: Option<String>, reference: Reference, }, Revision, Row, Rubric { name: Option<String>, class: Option<String>, }, Section { title_text: String, level: usize, line_style: SectionLineStyle, }, Sidebar { body_indent: usize, }, Status, StrongEmphasis { text: String, }, Subscript { text: String, }, SubstitutionDefinition, SubstitutionReference { substitution_label: String, target_label: Option<String>, }, Subtitle, Superscript { text: String, }, SystemMessage, Table { name: Option<String>, class: Option<String>, align: Option<HorizontalAlignment>, widths: Option<Vec<usize>>, width: Option<Length>, }, Target, TBody, Term, Text { text: String, }, TGroup, THead, TRow, Title, TitleReference { displayed_text: String, target_label: String, }, Topic { title: String, depth: Option<u32>, local: Option<bool>, backlinks: Option<ToCBacklinks>, class: Option<String>, }, Transition, UnknownDirective { directive_name: String, argument: String, options: HashMap<String, String>, body_indent: usize, }, Version, WhiteSpace { text: String, }, SphinxOnly { expression: String, body_indent: usize, }, SphinxCodeBlock { language: String, linenos: bool, lineno_start: Option<usize>, emphasize_lines: Option<Vec<usize>>, caption: Option<String>, name: Option<String>, dedent: Option<usize>, force: bool, code_text: String, }, AplusPOI {
Show 13 fields title: String, body_indent: usize, id: Option<String>, previous: Option<String>, next: Option<String>, hidden: Option<String>, class: Option<String>, height: Option<Length>, columns: Option<String>, bgimg: Option<String>, not_in_slides: Option<String>, not_in_book: Option<String>, no_poi_box: Option<String>,
}, AplusColBreak, AplusQuestionnaire {
Show 18 fields body_indent: usize, points_from_children: QuizPoints, key: String, max_points: Option<QuizPoints>, difficulty: Option<String>, submissions: Option<String>, points_to_pass: Option<String>, feedback: Option<String>, title: Option<String>, no_override: Option<String>, pick_randomly: Option<String>, preserve_questions_between_attempts: Option<String>, category: Option<String>, status: Option<String>, reveal_model_at_max_submissions: Option<String>, show_model: Option<String>, allow_assistant_viewing: Option<String>, allow_assistant_grading: Option<String>,
}, AplusPickOne { body_indent: usize, points: QuizPoints, class: Option<String>, required: bool, key: Option<String>, dropdown: bool, }, AplusPickAny { body_indent: usize, points: QuizPoints, class: Option<String>, required: bool, key: Option<String>, partial_points: bool, randomized: bool, correct_count: Option<u32>, preserve_questions_between_attempts: bool, }, AplusFreeText { body_indent: usize, points: QuizPoints, compare_method: String, model_answer: String, class: Option<String>, required: Option<String>, key: Option<String>, length: Option<String>, height: Option<String>, }, AplusPickChoices { body_indent: usize, }, AplusPickChoice { label: String, is_correct: bool, is_pre_selected: bool, is_neutral: bool, }, AplusQuestionnaireHints { body_indent: usize, }, AplusQuestionnaireHint { label: String, show_when_not_selected: bool, question_type: AplusQuestionnaireType, }, AplusSubmit {
Show 22 fields body_indent: usize, key: String, difficulty: String, max_points: QuizPoints, config: String, submissions: u32, points_to_pass: QuizPoints, class: String, title: String, category: String, status: AplusExerciseStatus, ajax: bool, allow_assistant_viewing: bool, allow_assistant_grading: bool, quiz: bool, url: String, radar_tokenizer: AplusRadarTokenizer, radar_minimum_match_tokens: Option<u32>, lti: String, lti_resource_link_id: String, lti_open_in_iframe: bool, lti_aplus_get_and_post: bool,
}, AplusActiveElementInput { key_for_input: String, title: Option<String>, default: Option<String>, class: Option<String>, width: Option<Length>, height: Option<Length>, clear: Option<AplusActiveElementClear>, input_type: Option<AplusActiveElementInputType>, file: Option<String>, }, AplusActiveElementOutput { key_for_output: String, config: String, inputs: String, title: Option<String>, class: Option<String>, width: Option<Length>, height: Option<Length>, clear: Option<AplusActiveElementClear>, output_type: AplusActiveElementOutputType, submissions: Option<u32>, scale_size: bool, status: AplusExerciseStatus, },
}
Expand description

An enumeration of the different possible document node types.

Some of the nodes listed here are redundant. This is because reStructuredText documentation also lists nodes that (multiply) inherit from other nodes in the implementation, but Rust has no concept of inheritance built in.

Variants§

§

Abbreviation

The abbreviation element is an inline element used to represent an abbreviation being used in the document. An example of an abbreviation is ‘St’ being used instead of ‘Street’.

Fields

§classes: Option<String>
§

AbsoluteURI

A reference to a web address.

Fields

§text: String
§

Acronym

TODO

§

Address

The address element holds the surface mailing address information for the author (individual or group) of the document, or a third-party contact address. Its structure is identical to that of the literal_block element: whitespace is significant, especially newlines.

§

Admonition

Covers all of the standard admonition types of reStructuredText:

  1. attention,
  2. caution,
  3. danger,
  4. error,
  5. hint,
  6. important,
  7. note,
  8. tip and
  9. warning,
  10. admonition

All of these have the same fields, and vary only in how they will be displayed. The last variant “admonition” may also contain a title. as one of its fields.

Fields

§content_indent: usize
§classes: Option<String>
§

Attribution

An optional attribution of a BlockQuote. An attribution is a text block beginning with “–”, “—”, or a true em-dash, flush left within the block quote. If the attribution consists of multiple lines, the left edges of the second and subsequent lines must align.

If a BlockQuote contains an attribution, the following node may be a `BlockQuote as well, but not otherwise (as it will be interpreted as a part of the previous quote).

Fields

§raw_text: String
§

Author

TODO

§

Authors

TODO

§

AutomaticSectionNumbering

The “sectnum” (or “section-numbering”) directive automatically numbers sections and subsections in a document (if not disabled by the –no-section-numbering command line option or the sectnum_xform configuration setting).

Section numbers are of the “multiple enumeration” form, where each level has a number, separated by periods. For example, the title of section 1, subsection 2, subsubsection 3 would have “1.2.3” prefixed.

The “sectnum” directive does its work in two passes: the initial parse and a transform. During the initial parse, a “pending” element is generated which acts as a placeholder, storing any options internally. At a later stage in the processing, the “pending” element triggers a transform, which adds section numbers to titles. Section numbers are enclosed in a “generated” element, and titles have their “auto” attribute set to “1”.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#automatic-section-numbering

Fields

§depth: Option<u32>
§prefix: Option<String>
§suffix: Option<String>
§start: Option<u32>
§

BlockQuote

Text indented relative to previous text, without markup indicating the start of a list or other container nodes. A block quote may end with an Attribution, which allows placing multiple block quotes in a sequence.

Also generated by the epigraph, highlights and pull-quote directives.

Fields

§body_indent: usize
§

BulletList

An unnumbered list node. These may only contain BulletListItem nodes or EmptyLines as their direct children.

Fields

§bullet: char
§bullet_indent: usize
§text_indent: usize
§

BulletListItem

An unnumbered list item. Can contain any Body level elements as its direct children.

Fields

§bullet: char
§bullet_indent: usize
§text_indent: usize
§

Caption

A Figure consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). For page-based output media, figures might float to a different position if this helps the page layout.

Fields

§indent: usize
§

Citation

A generic citation target.

Fields

§body_indent: usize
§label: String
§

CitationReference

A reference to a bibliographic citation.

Fields

§displayed_text: String
§target_label: String
§

Class

A container that triggers the storage of HTML classes into the DocTree and gives these to its children, if it has any.

Fields

§body_indent: usize
§classes: Vec<String>
§

Classifier

A classifier for a DefinitionTerm in a DefinitionList. Could be the type of a varible in a function decraration, or something similar.

§

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

§text: String
§language: Option<String>
§number_lines: Option<String>
§

ColSpec

TODO

§

Comment

A reStructuredText comment

Fields

§

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

§body_indent: usize
§

Contact

TODO

§

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

§body_indent: usize
§class_names: Option<Vec<String>>
§

Copyright

TODO

§

CSVTable

The “csv-table” directive is used to create a table from CSV (comma-separated values) data. CSV is a common data format generated by spreadsheet applications and commercial databases. The data may be internal (an integral part of the document) or external (a separate file).

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

Fields

§header_rows: Option<u32>
§stub_columns: Option<u32>
§header: Option<Vec<String>>
§encoding: Option<String>
§delim: Option<char>
§quote: Option<char>
§keepspace: Option<bool>
§escape: Option<char>
§

Date

Document metadata

§

Decoration

?

§

Definition

The definition of a definition list.

§

DefinitionList

A list of definitions. Contains DefinitionListItems or EmptyLine nodes as its direct children.

Fields

§term_indent: usize
§

DefinitionListItem

A child node type of DefinitionList. Contains a map of DefinitionTerms and the corresponding TermDefinitions, in addition to optional term classifiers.

Fields

§term: String
§classifiers: Vec<String>
§body_indent: usize
§

Description

?

§

DocInfo

?

§

DoctestBlock

These are interactive Python sessions contained in Python docstrings. Based on the Python standard library doctest module.

Doctest blocks begin with “>>>”, the python REPL main prompt and end with a blank line. They are a special case of the literal block and if both are present, the literal block takes precedence.

§

Document

The root node of an reStructuredText document tree.

§

Emphasis

Emphasised or italicized text.

Fields

§text: String
§

EmptyLine

A simple empty line, that contains no actual data. These can be contained in pretty much any container node, such as lists or list items, in addition to existing between body level elements.

§

Entry

Table data cells or entries may contain arbitrary body elements.

Fields

§is_last: bool
§

EnumeratedList

An enumerated list node. Can only contain EnumeratedListItem and EmptyLine nodes as its direct children.

Fields

§delims: EnumDelims
§start_index: usize
§n_of_items: usize
§enumerator_indent: usize
§

EnumeratedListItem

Child node type of EnumeratedList. Can contain any Bodyelements as its children.

Fields

§delims: EnumDelims
§index_in_list: usize
§enumerator_indent: usize
§text_indent: usize
§

ExternalHyperlinkTarget

A target for an external hyperlink. Contains a URI pointing to an external resource

Fields

§marker_indent: usize
§target: String
§

Field

A field of a field list

§

FieldBody

The parameter that FieldName refers to. May contain arbitrary body elements, just like bulleted and enumerated list items. The first line after the marker specifies the indentation used as a reference for parsing the rest of the block.

Fields

§indentation: usize
§

FieldList

A list of fields, that are used as a part of the reStructuredText extension syntax, such as directives. Bibliographies are a special case of these types of lists.

Fields

§marker_indent: usize
§

FieldListItem

A field item of a FieldList. Consists of a marker with a field name and a field body consisting of arbitrary body elements.

+--------------------+----------------------+
| ":" field name ":" | field body           |
+-------+------------+                      |
        | (body elements)+                  |
        +-----------------------------------+

Fields

§raw_marker_name: String
§marker_name_as_inline_nodes: Vec<TreeNodeType>
§marker_indent: usize
§body_indent: usize
§

Figure

A “figure” consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). For page-based output media, figures might float to a different position if this helps the page layout.

Fields

§body_indent: usize

The indentation of the caption and legend of this Figure.

§figwidth: Option<Length>
§figclass: Option<String>
§

Footer

The “header” and “footer” directives create document decorations, useful for page navigation, notes, time/datestamp, etc.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#document-header-footer

Fields

§body_indent: usize
§

Footnote

A foonote citation target. Contains a label and the foornote text itself.

The “target-notes” directive creates a footnote for each external target in the text, and corresponding footnote references after each reference. For every explicit target (of the form, .. _target name: URL) in the text, a footnote will be generated containing the visible URL as content.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#target-footnotes

Fields

§body_indent: usize
§label: String
§target: String
§

FootnoteReference

A reference to a foot note.

Fields

§displayed_text: String
§target_label: String
§

Generated

?

§

Header

The “header” and “footer” directives create document decorations, useful for page navigation, notes, time/datestamp, etc.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#document-header-footer

Fields

§body_indent: usize
§

Image

An image without a surrounding figure node. Can be inserted inline, as well (as soon asn substitution definitions and references get implemented…).

Fields

§height: Option<Length>
§scale: Option<f64>
§target: Option<String>
§inline: bool

Images can be inserted inline via substitution references (not yet implemented in ruSTLa).

§

Include

Fields

§start_line: Option<u32>
§end_line: Option<u32>
§start_after: Option<u32>
§end_before: Option<u32>
§literal: bool
§number_lines: Option<Option<u32>>

This might be set or not, and if it is, it might contain a start line number or not.

§encoding: Option<String>
§tab_width: Option<u32>
§

IndirectHyperlinkTarget

An indirect hyperlink target. Contains a hyperlink reference pointing to an internal or and external hyperlink.

Fields

§marker_indent: usize
§target: String
§indirect_target: String
§

Inline

?

§

InlineTarget

An inline reference target.

Fields

§target_label: String
§

InterpretedText

This node type is reserved for unknown interpreted text roles.

Fields

§role: String
§content: String
§

Label

?

§

Legend

A Figure consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). For page-based output media, figures might float to a different position if this helps the page layout.

Fields

§body_indent: usize
§

Line

A line of a line block.

§

LineBlock

A block of text where each new line begins with an unindented ‘|’, followed be text with specific left-alignment, used as a reference for the rest of the block. Allows writing blocks of text, where the struture of the lines is meaningful, such as poetry.

The symbols ‘|’ may be omitted, as they signify the start of a new line in the rendered output.

+------+-----------------------+
| "| " | line                  |
+------| continuation line     |
       +-----------------------+
§

ListTable

The “list-table” directive is used to create a table from data in a uniform two-level bullet list. “Uniform” means that each sublist (second-level list) must contain the same number of list items.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table

Fields

§body_indent: usize
§title: Option<String>

An optional title, given as the directive argument.

§widths: Option<TableColWidths>

A comma- or space-separated list of relative column widths. The default is equal-width columns (100%/#columns). The special value “auto” may be used by writers to decide whether to delegate the determination of column widths to the backend (LaTeX, the HTML browser, …).

§width: Option<MetricType>

Forces the width of the table to the specified length or percentage of the line width. If omitted, the renderer determines the width of the table based on its contents.

§header_rows: Option<u32>

The number of rows of list data to use in the table header. Defaults to 0.

§stub_columns: Option<u32>

The number of table columns to use as stubs (row titles, on the left). Defaults to 0.

§align: Option<HorizontalAlignment>

The horizontal alignment of the table. (New in Docutils 0.13)

§

Literal

Literal text, usually reserved for code.

Fields

§text: String
§

LiteralBlock

Paragraph (possibly empty) ending in a “::” signifies the start of a literal block of text. Text contained in a literal block is not interpreted in any way, but simply stored in this node as is.

Fields

§text: String
§

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

§text: String
§

MathBlock

A node for display-style mathematics (LaTeX).

Fields

§math_block: String
§

OptionList

A two-column list of command line options, such as the ones typically seen on unix man pages. Four types of options are supported:

  1. short POSIX options with one ‘-’ and an opion letter,
  2. Long POSIX options with “–”, followed by an option word. Some systems might use a single dash.
  3. Old GNU-style options starting with a ‘+’, followed by an option letter (!!!deprecated!!!)
  4. DOS/VMS options starting with a ‘/’, followed by an option letter or a word.

The recognized syntax is based on Python’s getopt.py module.

Fields

§option_indent: usize
§

OptionListItem

A single option in an OptionList. Consists of an option, folllowed by and optional argument and a description. May contain arbitrary indented body elements after these:

+----------------------------+-------------+
| option [" " argument] "  " | description |
+-------+--------------------+             |
        | (body elements)+                 |
        +----------------------------------+

Fields

§body_indent: usize
§

OptionString

?

§

Organization

Document metadata

§

Paragraph

A node constructed of a left-aligned block of text with no special starter markers.

Fields

§indent: usize
§

ParsedLiteralBlock

§

Pending

§

Problematic

§

Raw

§

Reference

A general reference to a reference target.

Fields

§displayed_text: Option<String>
§reference: Reference
§

Revision

§

Row

§

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

§

Section

A section title node, that contains the title text, in addition to its marker type and (sub)section level.

Fields

§title_text: String
§level: usize
§line_style: SectionLineStyle
§

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.

The sidebar element is a nonrecursive section-like construct which may occur at the top level of a section wherever a body element (list, table, etc.) is allowed. In other words, sidebar elements cannot nest inside body elements, so you can’t have a sidebar inside a table or a list, or inside another sidebar (or topic).

Fields

§body_indent: usize
§

Status

§

StrongEmphasis

Strongly emphasised text, usually rendered in bold.

Fields

§text: String
§

Subscript

As the name impies, generates inline subscripted text.

Fields

§text: String
§

SubstitutionDefinition

Explicit markup node, as in begins with “.. “ followed by a vertical bar ‘|’, substitution text and another ‘|’. The text may not begin or end with whitespace. Substitution definition blocks may contain a nested, inline compatible directive without the leading “.. “, such as image or replace.

+-------+-----------------------------------------------------+
| ".. " | "|" substitution text "| " directive type "::" data |
+-------+ directive block                                     |
        |                                                     |
        +-----------------------------------------------------+
§

SubstitutionReference

A reference that is to be substituted with the reference target directive output.

Fields

§substitution_label: String
§target_label: Option<String>
§

Subtitle

Document metadata

§

Superscript

Inline superscripted text.

Fields

§text: String
§

SystemMessage

An error node (currently unused).

§

Table

The “table” directive is used to associate a title with a table or specify options.

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

§

Target

§

TBody

A table body node

§

Term

§

Text

A plain text node, that contains no special markup.

Fields

§text: String
§

TGroup

Specifies atable group

§

THead

Specifies a table header.

§

TRow

Specifies a table row.

§

Title

Document metadata.

§

TitleReference

A reference to a title.

Fields

§displayed_text: String
§target_label: String
§

Topic

The topic element is a nonrecursive section-like construct which may occur at the top level of a section wherever a body element (list, table, etc.) is allowed. In other words, topic elements cannot nest inside body elements, so you can’t have a topic inside a table or a list, or inside another topic. Topics may contain only body elements.

The “contents” directive generates a table of contents (TOC) in a topic. Topics, and therefore tables of contents, may occur anywhere a section or transition may occur. Body elements and topics may not contain tables of contents.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents

Fields

§title: String
§depth: Option<u32>
§local: Option<bool>
§

Transition

A node corresponding to LaTeX’s \hrulefill command.

§

UnknownDirective

Fields

§directive_name: String
§argument: String
§body_indent: usize
§

Version

Document metadata

§

WhiteSpace

Generic inline whitespace that covers everything from spaces to newlines.

Fields

§text: String
§

SphinxOnly

Fields

§expression: String
§body_indent: usize
§

SphinxCodeBlock

A Sphinx-specific code block. See https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block for details.

Fields

§language: String
§linenos: bool
§lineno_start: Option<usize>
§emphasize_lines: Option<Vec<usize>>
§caption: Option<String>
§dedent: Option<usize>
§force: bool
§code_text: String
§

AplusPOI

A “point of interest” summary block. A point of interest is mostly like a normal admonition (“coloured info box”), but they are also linked to each other with next/previous links. The links enable the user to quickly navigate between the points of interest.

Fields

§title: String
§body_indent: usize
§previous: Option<String>
§hidden: Option<String>
§height: Option<Length>
§columns: Option<String>
§not_in_slides: Option<String>
§not_in_book: Option<String>
§no_poi_box: Option<String>
§

AplusColBreak

A node that can be inserted inside A+ directives that support multiple columns. Placing a line that conforms to he regex [ ]+::newcol with the ::newcol having proper indentation with respect to the multicol directive will generate this type of node.

§

AplusQuestionnaire

A quiz node that corresponds to the questionnaire A+ directive.

Fields

§body_indent: usize
§points_from_children: QuizPoints
§max_points: Option<QuizPoints>
§difficulty: Option<String>
§submissions: Option<String>
§points_to_pass: Option<String>
§feedback: Option<String>
§no_override: Option<String>
§pick_randomly: Option<String>
§preserve_questions_between_attempts: Option<String>
§category: Option<String>
§status: Option<String>
§reveal_model_at_max_submissions: Option<String>
§show_model: Option<String>
§allow_assistant_viewing: Option<String>
§allow_assistant_grading: Option<String>
§

AplusPickOne

See the documentation for the quoestionnaire directive: https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire

Fields

§body_indent: usize
§points: QuizPoints
§required: bool
§dropdown: bool
§

AplusPickAny

See the documentation for the quoestionnaire directive: https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire

Fields

§body_indent: usize
§points: QuizPoints
§required: bool
§partial_points: bool
§randomized: bool
§correct_count: Option<u32>
§preserve_questions_between_attempts: bool
§

AplusFreeText

See the documentation for the quoestionnaire directive: https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire

Fields

§body_indent: usize
§points: QuizPoints
§compare_method: String

One of int, float, string, subdiff, regexp, unsortedchars, with string and regexp having the --separated modifiers , ignorews, ignorequotes, requirecase, ignorerepl and ignoreparenthesis available.

§model_answer: String
§required: Option<String>
§length: Option<String>
§height: Option<String>
§

AplusPickChoices

A node that contains the choices of an A+ pick type question.

Fields

§body_indent: usize
§

AplusPickChoice

A single answer choice inside an A+ pick-(one|any) question.

Fields

§label: String
§is_correct: bool
§is_pre_selected: bool
§is_neutral: bool
§

AplusQuestionnaireHints

A list type node for containing AplusQuestionnaireHints.

Fields

§body_indent: usize
§

AplusQuestionnaireHint

A hint for questionnaire pick-{one, any} and freetext questions.

Fields

§label: String
§show_when_not_selected: bool
§

AplusSubmit

A+ submit-type exercise. See https://github.com/apluslms/a-plus-rst-tools#3-submittable-exercise.

Fields

§body_indent: usize
§difficulty: String
§max_points: QuizPoints
§config: String
§submissions: u32
§points_to_pass: QuizPoints
§class: String
§title: String
§category: String
§ajax: bool
§allow_assistant_viewing: bool
§allow_assistant_grading: bool
§quiz: bool
§radar_tokenizer: AplusRadarTokenizer
§radar_minimum_match_tokens: Option<u32>
§lti_resource_link_id: String
§lti_open_in_iframe: bool
§lti_aplus_get_and_post: bool
§

AplusActiveElementInput

§

AplusActiveElementOutput

Fields

§key_for_output: String
§config: String
§inputs: String
§height: Option<Length>
§submissions: Option<u32>
§scale_size: bool

Implementations§

Source§

impl TreeNodeType

Source

pub fn body_indent(&self) -> Option<usize>

Returns the relevant content indent of each node type. This is useful, when one is trying to find out whether a node belongs to a parent node. Node containerzation is determined by indentation in reStructuredText.

Source

pub fn node_categories(&self) -> impl Iterator<Item = &NodeCategory>

According to the reStructuredText DTD each node type is associated with a set of categories. This function returns that set (an immutable iterator) for each defined node type.

Trait Implementations§

Source§

impl Debug for TreeNodeType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TreeNodeType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.