Enum rustla::doctree::tree_node_types::TreeNodeType [−][src]
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
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’.
A reference to a web address.
Fields of AbsoluteURI
text: String
TODO
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.
Covers all of the standard admonition types of reStructuredText:
- attention,
- caution,
- danger,
- error,
- hint,
- important,
- note,
- tip and
- warning,
- 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 of Admonition
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 of Attribution
raw_text: String
TODO
TODO
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 of AutomaticSectionNumbering
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 of BlockQuote
body_indent: usize
An unnumbered list node. These may only contain BulletListItem
nodes
or EmptyLine
s as their direct children.
An unnumbered list item. Can contain any Body
level elements as its direct children.
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 of Caption
indent: usize
A generic citation target.
A reference to a bibliographic citation.
A container that triggers the storage of HTML classes into the DocTree and gives these to its children, if it has any.
A classifier for a DefinitionTerm
in a DefinitionList
.
Could be the type of a varible in a function decraration, or something similar.
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
TODO
A reStructuredText comment
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
TODO
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
Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#container
TODO
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 of CSVTable
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>
Document metadata
?
The definition of a definition list.
A list of definitions. Contains DefinitionListItems
or EmptyLine
nodes
as its direct children.
Fields of DefinitionList
term_indent: usize
A child node type of DefinitionList
.
Contains a map of DefinitionTerm
s and the corresponding
TermDefinitions
, in addition to optional term classifiers.
?
?
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.
The root node of an reStructuredText document tree.
Emphasised or italicized text.
Fields of Emphasis
text: String
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.
Table data cells or entries may contain arbitrary body elements.
Fields of Entry
is_last: bool
An enumerated list node. Can only contain EnumeratedListItem
and EmptyLine
nodes as its direct children.
Fields of EnumeratedList
Child node type of EnumeratedList
. Can contain any Body
elements
as its children.
Fields of EnumeratedListItem
A target for an external hyperlink. Contains a URI pointing to an external resource
A field of a field list
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 of FieldBody
indentation: usize
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 of FieldList
marker_indent: usize
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 of FieldListItem
raw_marker_name: String
marker_name_as_inline_nodes: Vec<TreeNodeType>
marker_indent: usize
body_indent: usize
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 of Figure
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
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 of Footnote
A reference to a foot note.
Fields of FootnoteReference
?
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 of Header
body_indent: usize
An image without a surrounding figure node. Can be inserted inline, as well (as soon asn substitution definitions and references get implemented…).
Fields of Image
Fields of 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>>
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>
name: Option<String>
class: Option<String>
An indirect hyperlink target. Contains a hyperlink reference pointing to an internal or and external hyperlink.
?
An inline reference target.
Fields of InlineTarget
target_label: String
This node type is reserved for unknown interpreted text roles.
?
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 of Legend
body_indent: usize
A line of a line block.
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 |
+-----------------------+
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 of ListTable
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 text, usually reserved for code.
Fields of Literal
text: String
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 of LiteralBlock
text: String
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
A node for display-style mathematics (LaTeX).
A two-column list of command line options, such as the ones typically seen on unix man
pages.
Four types of options are supported:
- short POSIX options with one ‘-’ and an opion letter,
- Long POSIX options with “–”, followed by an option word. Some systems might use a single dash.
- Old GNU-style options starting with a ‘+’, followed by an option letter (!!!deprecated!!!)
- 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 of OptionList
option_indent: usize
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 of OptionListItem
body_indent: usize
?
Document metadata
A node constructed of a left-aligned block of text with no special starter markers.
Fields of Paragraph
indent: usize
A general reference to a reference target.
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
A section title node, that contains the title text, in addition to its marker type and (sub)section level.
Fields of Section
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 of Sidebar
body_indent: usize
Strongly emphasised text, usually rendered in bold.
Fields of StrongEmphasis
text: String
As the name impies, generates inline subscripted text.
Fields of Subscript
text: String
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 |
| |
+-----------------------------------------------------+
A reference that is to be substituted with the reference target directive output.
Document metadata
Inline superscripted text.
Fields of Superscript
text: String
An error node (currently unused).
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
Fields of Table
A table body node
A plain text node, that contains no special markup.
Fields of Text
text: String
Specifies atable group
Specifies a table header.
Specifies a table row.
Document metadata.
A reference to a title.
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 of Topic
A node corresponding to LaTeX’s \hrulefill
command.
Fields of UnknownDirective
Document metadata
Generic inline whitespace that covers everything from spaces to newlines.
Fields of WhiteSpace
text: String
A Sphinx-specific code block. See https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block for details.
Fields of SphinxCodeBlock
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 of AplusPOI
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.
A quiz node that corresponds to the questionnaire A+ directive.
Fields of AplusQuestionnaire
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>
See the documentation for the quoestionnaire
directive:
https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire
Fields of AplusPickOne
See the documentation for the quoestionnaire
directive:
https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire
Fields of AplusPickAny
See the documentation for the quoestionnaire
directive:
https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire
Fields of AplusFreeText
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
class: Option<String>
required: Option<String>
key: Option<String>
length: Option<String>
height: Option<String>
A node that contains the choices of an A+ pick
type question.
Fields of AplusPickChoices
body_indent: usize
A single answer choice inside an A+ pick-(one|any) question.
A list type node for containing AplusQuestionnaireHint
s.
Fields of AplusQuestionnaireHints
body_indent: usize
A hint for questionnaire pick-{one, any} and freetext questions.
Fields of AplusQuestionnaireHint
A+ submit-type exercise. See https://github.com/apluslms/a-plus-rst-tools#3-submittable-exercise.
Fields of AplusSubmit
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
Fields of AplusActiveElementInput
Fields of AplusActiveElementOutput
Implementations
impl TreeNodeType
[src]
pub fn body_indent(&self) -> Option<usize>
[src]
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.
pub fn node_categories(&self) -> impl Iterator<Item = &NodeCategory>
[src]
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
impl Debug for TreeNodeType
[src]
impl Display for TreeNodeType
[src]
Auto Trait Implementations
impl RefUnwindSafe for TreeNodeType
impl Send for TreeNodeType
impl Sync for TreeNodeType
impl Unpin for TreeNodeType
impl UnwindSafe for TreeNodeType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,