Module common

Module common 

Source
Expand description

This submodule contains useful functions and other constructs that don’t sensibly belong to any specific entity in the program.

Copyright © 2020 Santtu Söderholm

Enums§

AplusActiveElementClear
The variant “both” forces the element to a new line, “left” (“right”) allows no floating elements on the left (right)
AplusActiveElementInputType
Use “file” for file inputs, “clickable” for clickable inputs, and “dropdown” for dropdown. For dropdowns, the available options should be listed after the type indicating “dropdown” in this format: “dropdown:option1,option2,option3”
AplusActiveElementOutputType
Default type is text; for image (png) outputs use “image”
AplusExerciseStatus
There are 6 possible statuses for A+ exercises:
AplusQuestionnaireType
An enumeration fo the different A+ questionnaire types. This is used the differentiate between questionnaire hint output formats, among other things.
AplusRadarTokenizer
An enumeration of the different tokenizers offered by the A+ Radar tokenizer.
EnumDelims
Enumerated list item labels can either end with a period . or a right parenthesis ). A third option is to enclose them in matching parentheses ( and ).
EnumKind
List enumerator labels can be Arabic numerals, lower- or upper-case alphet a--z or A--Z, or lower- or upper-case Roman numerals between 1--4999.
FootnoteKind
There are 4 different kinds of footnote markers:
HTMLAlignment
An enumeration of the (deprecated) “align” attribute alternatives recognized by the HTML <img> tag.
HorizontalAlignment
An enumeration of different horizontal alignment options: Left, Middle or Right.
InterpretedTextKind
There are 3 types of interpreted inline text, such as math:
Length
Units of length recognized by reStructuredText.
LinkTarget
A hyperlink target may be one of 3 types:
MetricType
An enumeration of how lengths can be interpreted. This includes precentages of current context and absolute length
OutputStream
An enumeration of the different writer output formats. Currently stdout and files are supported.
ParsingResult
An enumeration of the different ways a (nested) parsing session might terminate. The return type of the Parser::parse method. Generally, finishing conditions that are not outright failures will enclose the document tree fed to the parser when it was initialized.
Reference
An enumeration of the different types of references that a reference node might contain.
SectionLineStyle
A section can be underlined, or over- and underlined with a certain character.
TableColWidths
An enumeration of different horizontal alignment options.
ToCBacklinks
An enumeration of different backlinking alternatives for a table of contents node. Instructs the doctree to generate links from section headers back to the table of contents entries, the table of contents itself, or generate no backlinks.
TraversalType
Enumerated the types of tree traversals that one of the DocTree walk methods might perform.

Constants§

FOOTNOTE_SYMBOLS
The standard Docutils system uses these symbols as footnote marks when a FootnoteKind::AutoSymbol is detected. They are, from first to last:
SECTION_AND_QUOTING_CHARS
These are the characters that can be used in underlining section titles, marking the lines of literal text blocks and creating transitions.

Functions§

normalize_refname
Normalizes the given &str according to the reStructuredText specification. In this context, normalization means converting any contiguous whitespace into a single ASCII space character and converting letters to their lower-case variants.
read_path_lines
Read the lines of a given file into a buffer.
str_to_lines
Returns a Vec<String> from a given &str, split at new lines \n or \r\n.
strip_indent
A whitespace-aware function for stripping indentation from Strings. Returns Ok(String) if successful. If non-whitespace characters are encountered before the notified amount has been stripped, an Err(message) is returned instead.

Type Aliases§

EnumAsInt
A type alias for different kinds of enumerators such as list or foonote ordinals in integer format.
LengthNum
A type alias for the number type used in the Length enum.
NodeId
A type alias for an integer used as a node identifier.
QuizPoints
A type alias for question points.