rustla/doctree/
directives.rs

1/*!
2A submodule that contains an enumeration for the different directive types recognized by reStructuredText
3and associated functions and metods. The documentation found in the comments in this file was taken from
4https://docutils.sourceforge.io/docs/ref/rst/directives.html
5
6This module is currently obsolete, and the only really relevant enumeration still
7found in here is the `AdmonitionType` type.
8
9Copyright © 2020 Santtu Söderholm
10*/
11use super::*;
12
13/// An enumeration of the different directive types found in reStructuredText and LarST.
14#[derive(Debug)]
15pub enum DirectiveNode {
16    Admonition {
17        content_indent: usize,
18        classes: Option<String>,
19        name: Option<String>,
20        variant: AdmonitionType,
21    },
22    Image(ImageDirective),
23    BodyElement(BodyElementDirective),
24    Table(TableDirective),
25    DocumentPart(DocumentPartDirective),
26    Reference(ReferenceDirective),
27    HTMLspecific(HTMLSpecificDirective),
28    SubstitutionDef(SubstitutionDefDirective),
29    Miscellaneous(MiscellaneousDirective),
30
31    APlusrSTTools(AplusDirective),
32}
33
34/// An enumeration of the different admonition types.
35/// Admonitions are specially marked "topics" that can
36/// appear anywhere an ordinary body element can.
37/// They contain arbitrary body elements. Typically,
38/// an admonition is rendered as an offset block in a document,
39/// sometimes outlined or shaded, with a title matching
40/// the admonition type.
41///
42/// For details, see https://docutils.sourceforge.io/docs/ref/rst/directives.html#admonitions
43#[derive(Debug, Clone)]
44pub enum AdmonitionType {
45    Attention,
46    Caution,
47    Danger,
48    Error,
49    Hint,
50    Important,
51    Note,
52    Tip,
53    Warning,
54    Admonition { title: String },
55}
56
57use std::fmt;
58impl std::fmt::Display for AdmonitionType {
59    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
60        let admonition_str = match self {
61            Self::Attention => "attention".to_string(),
62            Self::Caution => "caution".to_string(),
63            Self::Danger => "danger".to_string(),
64            Self::Error => "error".to_string(),
65            Self::Hint => "hint".to_string(),
66            Self::Important => "important".to_string(),
67            Self::Note => "note".to_string(),
68            Self::Tip => "tip".to_string(),
69            Self::Warning => "warning".to_string(),
70            Self::Admonition { title } => format!("admonition: {}", title),
71        };
72        write!(f, "{}", admonition_str)
73    }
74}
75
76/// An enumeration of different image types.
77/// There are two image directives: `image` and `figure`.
78///
79/// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#images
80#[derive(Debug)]
81pub enum ImageDirective {
82    /// #### Image
83    /// An "image" is a simple picture.
84    ///
85    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#image
86    Image {
87        /// #### uri
88        /// A compulsory image location.
89        uri: String,
90
91        // Options
92        alt: Option<String>,
93        height: Option<String>,
94        width: Option<String>,
95        scale: Option<String>,
96        align: Option<String>,
97        target: Option<String>,
98        name: Option<String>,
99        class: Option<String>,
100    },
101
102
103    /// 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,
104    /// figures might float to a different position if this helps the page layout.
105    ///
106    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#figure
107    Figure {
108        /// #### uri
109        /// A compulsory image location.
110        uri: String,
111
112        // Options
113        name: Option<String>,
114        class: Option<String>,
115        alt: Option<String>,
116        height: Option<String>,
117        width: Option<String>,
118        scale: Option<String>,
119        align: Option<String>,
120        target: Option<String>,
121        figwidth: Option<FigWidth>,
122        figclass: Option<String>,
123    },
124}
125
126/// Alternatives to `Figure` width settings.
127#[derive(Debug)]
128pub enum FigWidth {
129    Image,
130    Length(u32),
131    Percentage(u32),
132}
133
134/// An enumeration of different body element directives.
135#[derive(Debug)]
136pub enum BodyElementDirective {
137
138    /// A topic is like a block quote with a title, or a self-contained section with no subsections.
139    /// Use the "topic" directive to indicate a self-contained idea that is separate from the flow of the document.
140    /// Topics may occur anywhere a section or transition may occur. Body elements and topics may not contain nested topics.
141    ///
142    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#topic
143    Topic {
144        title: String,
145        name: Option<String>,
146        class: Option<String>,
147    },
148
149
150    /// Sidebars are like miniature, parallel documents that occur inside other documents, providing related or reference material.
151    /// 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;
152    /// their content is outside of the flow of the document's main text.
153    ///
154    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#sidebar
155    SideBar {
156        title: Option<String>,
157        name: Option<String>,
158        class: Option<String>,
159    },
160
161
162    /// Unlike an ordinary literal block, the "parsed-literal" directive constructs a literal block
163    /// where the text is parsed for inline markup. It is equivalent to a line block with different
164    /// rendering: typically in a typewriter/monospaced typeface, like an ordinary literal block.
165    /// Parsed literal blocks are useful for adding hyperlinks to code examples.
166    ///
167    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#parsed-literal-block
168    ParsedLiteralBlock {
169        inline_nodes: Vec<TreeNodeType>,
170        name: Option<String>,
171        class: Option<String>,
172    },
173
174
175    /// The "code" directive constructs a literal block.
176    /// If the code language is specified, the content is parsed by the Pygments syntax highlighter
177    /// and tokens are stored in nested inline elements with class arguments according to their syntactic category.
178    /// The actual highlighting requires a style-sheet (e.g. one generated by Pygments, see the sandbox/stylesheets
179    /// for examples).
180    ///
181    /// The parsing can be turned off with the syntax_highlight configuration setting and command line option or by
182    /// specifying the language as :class: option instead of directive argument. This also avoids warnings when Pygments
183    /// is not installed or the language is not in the supported languages and markup formats.
184    ///
185    /// For inline code, use the "code" role.
186    ///
187    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#code
188    Code {
189        language: Option<String>,
190        name: Option<String>,
191        class: Option<String>,
192        number_lines: Option<u32>,
193    },
194
195
196    /// The "math" directive inserts blocks with mathematical content (display formulas, equations)
197    /// into the document. The input format is subset of LaTeX math syntax with support for Unicode symbols.
198    /// For inline formulas, use the "math" role.
199    ///
200    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#math
201    Math {
202        name: Option<String>,
203        class: Option<String>,
204    },
205
206
207    /// The "rubric" directive inserts a "rubric" element into the document tree. A rubric is like an informal
208    /// heading that doesn't correspond to the document's structure.
209    ///
210    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#rubric
211    Rubric {
212        name: Option<String>,
213        class: Option<String>,
214    },
215
216
217    /// An epigraph is an apposite (suitable, apt, or pertinent) short inscription, often a quotation or poem,
218    /// at the beginning of a document or section.
219    ///
220    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#epigraph
221    Epigraph,
222
223
224    /// Highlights summarize the main points of a document or section, often consisting of a list.
225    ///
226    /// The "highlights" directive produces a "highlights"-class block quote.
227    /// See Epigraph above for an analogous example.
228    ///
229    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#highlights
230    Highlights,
231
232
233    /// A pull-quote is a small selection of text "pulled out and quoted", typically in a larger typeface.
234    /// Pull-quotes are used to attract attention, especially in long articles.
235    ///
236    /// The "pull-quote" directive produces a "pull-quote"-class block quote.
237    /// See Epigraph above for an analogous example.
238    ///
239    /// Details https://docutils.sourceforge.io/docs/ref/rst/directives.html#pull-quote
240    PullQuote,
241
242
243    /// The "compound" directive is used to create a compound paragraph,
244    /// which is a single logical paragraph containing multiple physical body elements
245    /// such as simple paragraphs,literal blocks, tables, lists, etc.,
246    /// instead of directly containing text and inline elements. For example:
247    ///
248    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#compound-paragraph
249    CompoundParagraph {
250        name: Option<String>,
251        class: Option<String>,
252    },
253
254
255    /// The "container" directive surrounds its contents (arbitrary body elements) with a generic block-level "container" element.
256    /// Combined with the optional "classes" attribute argument(s), this is an extension mechanism for users & applications.
257    /// The "container" directive is the equivalent of HTML's <div> element. It may be used to group a sequence of elements for user-
258    /// or application-specific purposes.
259    ///
260    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#container
261    Container {
262        class_names: Option<Vec<String>>,
263        name: Option<String>,
264    },
265}
266
267pub enum TableWidth {
268    Length(u32),
269    Percentage(u32),
270}
271
272
273/// An enumeration of different table directive types.
274///
275/// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#tables
276#[derive(Debug)]
277pub enum TableDirective {
278
279    /// The "table" directive is used to associate a title with a table or specify options.
280    ///
281    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#table
282    Table {
283        name: Option<String>,
284        class: Option<String>,
285        align: Option<HorizontalAlignment>,
286        widths: Option<Vec<usize>>,
287        width: Option<Length>,
288    },
289
290    /// The "csv-table" directive is used to create a table from CSV (comma-separated values) data. CSV is
291    /// a common data format generated by spreadsheet applications and commercial databases.
292    /// The data may be internal (an integral part of the document) or external (a separate file).
293    ///
294    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#id4
295    CSVTable {
296        name: Option<String>,
297        class: Option<String>,
298        widths: Option<TableColWidths>,
299        width: Option<MetricType>,
300        header_rows: Option<u32>,
301        stub_columns: Option<u32>,
302        header: Option<Vec<String>>,
303        file: Option<String>,
304        url: Option<String>,
305        encoding: Option<String>,
306        delim: Option<char>,
307        quote: Option<char>,
308        keepspace: Option<bool>,
309        escape: Option<char>,
310        align: Option<HorizontalAlignment>,
311    },
312
313    /// The "list-table" directive is used to create a table from data in a uniform two-level bullet list.
314    /// "Uniform" means that each sublist (second-level list) must contain the same number of list items.
315    ///
316    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#list-table
317    ListTable {
318        widths: Option<TableColWidths>,
319        width: Option<MetricType>,
320        header_rows: Option<u32>,
321        stub_columns: Option<u32>,
322        align: Option<HorizontalAlignment>,
323    },
324}
325
326/// An enumeration of different table directive types.
327///
328/// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#document-parts
329#[derive(Debug)]
330pub enum DocumentPartDirective {}
331
332/// An enumeration of different reference directive types.
333#[derive(Debug)]
334pub enum ReferenceDirective {
335    /// #### TargetFootnote
336    /// The "target-notes" directive creates a footnote for each external target in the text,
337    /// and corresponding footnote references after each reference. For every explicit target (of the form, .. _target name: URL) in the text,
338    /// a footnote will be generated containing the visible URL as content.
339    ///
340    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#target-footnotes
341    TargetFootnote {
342        class: Option<String>,
343        name: Option<String>,
344    },
345
346    /// #### Footnote
347    /// Not implemented in docutils!
348    ///
349    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#footnotes
350    Footnote,
351
352    /// #### Citation
353    /// Not implemented in docutils!
354    ///
355    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#citations
356    Citation,
357}
358
359/// An enumeration of different HTML-specific directive types.
360#[derive(Debug)]
361pub enum HTMLSpecificDirective {
362
363    /// The "meta" directive is used to specify HTML metadata stored in HTML META tags.
364    /// "Metadata" is data about data, in this case data about web pages.
365    /// Metadata is used to describe and classify web pages in the World Wide Web, in a form that is easy for search engines to extract and collate.
366    ///
367    /// Within the directive block, a flat field list provides the syntax for metadata.
368    /// The field name becomes the contents of the "name" attribute of the META tag, and the field body
369    /// (interpreted as a single string without inline markup) becomes the contents of the "content" attribute.
370    ///
371    ///
372    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#meta
373    Meta,
374
375    /// Not implemented in docutils.
376    ///
377    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#imagemap
378    ImageMap,
379}
380
381/// An enumeration of different macro directive types.
382///
383/// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#directives-for-substitution-definitions
384#[derive(Debug)]
385pub enum SubstitutionDefDirective {
386
387    /// The "replace" directive is used to indicate replacement text for a substitution reference. It may be used within substitution definitions only. For example, this directive can be used to expand abbreviations:
388    ///
389    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#replacement-text
390    ReplacementText,
391
392    /// The "unicode" directive converts Unicode character codes (numerical values) to characters, and may be used in substitution definitions only.
393    ///
394    /// The arguments, separated by spaces, can be:
395    ///
396    /// * character codes as
397    ///   * decimal numbers or
398    ///   * hexadecimal numbers, prefixed by 0x, x, \x, U+, u, or \u or as XML-style hexadecimal character entities, e.g. &#x1a2b;
399    /// * text, which is used as-is.
400    ///
401    /// Text following " .. " is a comment and is ignored.
402    /// The spaces between the arguments are ignored and thus do not appear in the output.
403    /// Hexadecimal codes are case-insensitive.
404    ///
405    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#unicode-character-codes
406    UnicodeCharCode,
407
408    /// The "date" directive generates the current local date and inserts it into the document as text.
409    /// This directive may be used in substitution definitions only.
410    ///
411    /// The optional directive content is interpreted as the desired date format,
412    /// using the same codes as Python's time.strftime function.
413    /// The default format is "%Y-%m-%d" (ISO 8601 date), but time fields can also be used. Examples:
414    ///
415    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#date
416    Date,
417}
418
419/// An enumeration of different miscellaneous directive types.
420///
421/// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#miscellaneous
422#[derive(Debug)]
423pub enum MiscellaneousDirective {
424
425    /// **!!!WARNING!!!** The "include" directive represents a potential security hole.
426    /// It can be disabled with the "file_insertion_enabled" runtime setting.
427    ///
428    /// The "include" directive reads a text file.
429    /// The directive argument is the path to the file to be included,
430    /// relative to the document containing the directive.
431    /// Unless the options literal or code are given,
432    /// the file is parsed in the current document's context at the point of the directive.
433    ///
434    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#including-an-external-document-fragment
435    Include {
436        start_line: Option<usize>,
437        end_line: Option<usize>,
438        start_after: Option<String>,
439        end_before: Option<String>,
440        literal: Option<bool>,
441        code: Option<String>,
442        number_lines: Option<String>,
443        encoding: Option<String>,
444        tab_width: Option<usize>,
445        class: Option<String>,
446        name: Option<String>,
447    },
448
449    /// **Warning** The "raw" directive represents a potential security hole.
450    /// It can be disabled with the "raw_enabled" or "file_insertion_enabled" runtime settings.
451    ///
452    /// **Caution** The "raw" directive is a stop-gap measure allowing the author to bypass reStructuredText's markup. It is a "power-user" feature that should not be overused or abused.
453    /// The use of "raw" ties documents to specific output formats and makes them less portable.
454    ///
455    /// If you often need to use the "raw" directive or a "raw"-derived interpreted text role, that is a sign either of overuse/abuse or that functionality may be missing from reStructuredText.
456    /// Please describe your situation in a message to the Docutils-users mailing list.
457    ///
458    /// ##### The Directive
459    /// The "raw" directive indicates non-reStructuredText data that is to be passed untouched to the Writer. The names of the output formats are given in the directive arguments.
460    /// The interpretation of the raw data is up to the Writer. A Writer may ignore any raw output not matching its format.
461    ///
462    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#raw-data-pass-through
463    RawDataPassthrough {
464        file: Option<String>,
465        url: Option<String>,
466        encoding: Option<String>,
467    },
468
469    /// The "class" directive sets the "classes" attribute value on its content or on the first immediately following
470    /// non-comment element. The directive argument consists of one or more space-separated class names.
471    /// The names are transformed to conform to the regular expression [a-z](-?[a-z0-9]+)* (see Identifier Normalization below).
472    ///
473    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#class
474    Class { class_names: Option<Vec<String>> },
475
476    /// The "role" directive dynamically creates a custom interpreted text
477    /// role and registers it with the parser.
478    /// The role must be declared in a document before it can be used.
479    ///
480    /// The new role may be based on an existing role,
481    /// specified as a second argument in parentheses (whitespace optional).
482    ///
483    /// A special case is the "raw" role:
484    /// derived roles enable inline raw data pass-through.
485    /// If no base role is explicitly specified,
486    /// a generic custom role is automatically used.
487    /// Subsequent interpreted text will produce an "inline" element with
488    /// a "classes" attribute, as in the first example above.
489    ///
490    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#custom-interpreted-text-roles
491    CustomInterpretedTextRole,
492
493    /// The "default-role" directive sets the default interpreted text role,
494    /// the role that is used for interpreted text without an explicit role.
495    /// The "default-role" directive sets the default interpreted text role,
496    /// the role that is used for interpreted text without an explicit role.
497    ///
498    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#setting-the-default-interpreted-text-role
499    DefaultRole,
500
501    /// The "title" directive specifies the document title as metadata,
502    /// which does not become part of the document body.
503    /// It overrides a document-supplied title.
504    /// For example, in HTML output the metadata document title appears
505    /// in the title bar of the browser window.
506    ///
507    /// Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata-document-title
508    MetadataDocTitle,
509
510    /// This directive is provided for test purposes only.
511    /// (Nobody is expected to type in a name that long!)
512    /// It is converted into a level-1 (info) system message showing the directive data,
513    /// possibly followed by a literal block containing the rest of the directive block.
514    ReStructuredTextTestDirective,
515}
516
517/// Directives defined in the A+ rST Tools submodule of the A+ LMS.
518///
519/// Details: https://github.com/apluslms/a-plus-rst-tools
520#[derive(Debug)]
521pub enum AplusDirective {
522
523    /// The questionnaire directive arguments define the exercise key and optional max points with the difficulty.
524    /// For example, .. questionnaire:: 1 A50 sets key 1, max points 50 and difficulty A.
525    /// If not set in the directive arguments, the max points will be set to the sum of the question points.
526    /// Setting the difficulty is optional and it can be set even if the max points aren't defined in the argument.
527    ///
528    /// Details: https://github.com/apluslms/a-plus-rst-tools#1-graded-questionnaire
529    GradedQuestionnaire,
530
531    /// A feedback questionnaire is almost like a graded questionnaire. When the feedback option is set,
532    /// the questionnaire uses the feedback category and CSS class by default.
533    /// Feedback questionnaires always grant full points if all of the required questions are answered.
534    ///
535    /// The questionnaire options chapter-feedback, weekly-feedback, appendix-feedback,
536    /// and course-feedback use a different CSS class (with the same name as the option).
537    /// If points are not specified, they are set to zero.
538    /// The feedback option can be set only to one questionnaire in an RST file because the exercise key is then hardcoded to feedback.
539    ///
540    /// Details: https://github.com/apluslms/a-plus-rst-tools#2-feedback-questionnaire
541    FeedbackQuestionnaire,
542
543    /// These types of exercises are configured separately for the MOOC grader by linking a YAML configuration file with the config option.
544    /// Some settings may also be defined directly with the directive options.
545    /// The directive will attach the exercise at this position in the content chapter.
546    ///
547    /// Its arguments define the exercise key and max points with the optional difficulty.
548    /// The instructions can be written in the body of the submit directive.
549    /// The body supports RST syntax. If the instructions field is also given in the config.yaml,
550    /// the body of the submit directive will be prioritized.
551    ///
552    /// Details: https://github.com/apluslms/a-plus-rst-tools#3-submittable-exercise
553    SubmittableExercise,
554
555    /// This exercise opens an external tool via the LTI launch protocol.
556    /// The LTI service must be configured beforehand in A+ by an administrator.
557    /// The lti option refers to the label of the LTI service.
558    /// The url option may exclude the domain of the service URL since the domain
559    /// must be equal to the URL defined in the LTI service anyway.
560    ///
561    /// Details: https://github.com/apluslms/a-plus-rst-tools#4-external-exercise-lti
562    LTIExercise,
563
564    /// The meta directive is used to define module (exercise round) settings. It should be defined in the RST
565    /// file that defines the toctree of the module (module index). Furthermore, it may be used in chapters to hide them (i.e.,
566    /// set status hidden) with the hidden option or to set the chapter audience with the audience option.
567    ///
568    /// Details: Details: https://github.com/apluslms/a-plus-rst-tools#5-meta-exercise-round-settings
569    RoundSettings,
570
571    /// This creates an input field for active element.
572    ///
573    /// Details: https://github.com/apluslms/a-plus-rst-tools#6-active-element-input
574    ActiveElementInput,
575
576    /// This creates an output field for active element.
577    ///
578    /// More active element examples can be found at
579    /// https://version.aalto.fi/gitlab/piitulr1/active-element-example
580    ///
581    /// Details: https://github.com/apluslms/a-plus-rst-tools#7-active-element-output
582    ActiveElementOutput,
583
584    /// Directive for creating hidden content blocks. The content can be shown/hidden by clicking the link.
585    /// (This uses the Bootstrap collapse component.)
586    ///
587    /// Details: https://github.com/apluslms/a-plus-rst-tools#8-hidden-block
588    HiddenBlock,
589
590    /// Directive for creating a "point of interest" summary block.
591    /// This extension must be activated separately in the project conf.py (extensions = ["aplus_setup", "point_of_interest"]).
592    /// 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.
593    /// The links enable the user to quickly navigate between the points of interest.
594    ///
595    /// Point of interests may also be used to generate separate lecture slides (not directly included in the A+ content chapters).
596    /// This requires a separate tool called "presentation maker".
597    ///
598    /// Details: https://github.com/apluslms/a-plus-rst-tools#9-point-of-interest
599    PointOfInterest,
600
601    /// Code blocks may be annotated with comments for specific lines. This extension must be activated separately in the project conf.py
602    /// (extensions = ["aplus_setup", "annotated"]).
603    /// This extension requires custom JavaScript code and CSS styles in order to highlight the annotations on mouse hover in the web browser.
604    /// The frontend code is not distributed in this repository (or anywhere).
605    ///
606    /// Details: https://github.com/apluslms/a-plus-rst-tools#10-annotated-code-blocks
607    AnnotatedCodeBlock,
608
609    /// With the `lineref-code-block`, you may add links from the chapter contents to specific lines of the code block.
610    /// You define labels enclosed in :: for lines of the code block. Labels can include alphanumeric characters, underscore (_),
611    /// and hyphen (-). The directive is used similarly to the Sphinx directive code-block. This extension must be activated
612    /// separately in the project conf.py (extensions = ["aplus_setup", "codeblock_lineref"]).
613    ///
614    /// Details: https://github.com/apluslms/a-plus-rst-tools#11-code-blocks-with-line-references
615    CodeBlockWithLineReference,
616
617    /// The repl directive is used to print a (Scala) REPL session (read-eval-print loop).
618    /// This extension must be activated separately in the project conf.py (extensions = ["aplus_setup", "repl"]).
619    ///
620    /// Details: https://github.com/apluslms/a-plus-rst-tools#12-repl-sessions
621    REPLSession,
622
623    /// The custom directive acos-submit behaves almost identically to the normal submit directive.
624    /// It is intended for exercises that are hosted outside the MOOC grader, such as the ACOS server.
625    /// The directive option url should define the URL path of the exercise in the ACOS server.
626    /// The URL domain is added automatically based on the configuration value acos_submit_base_url in conf.py.
627    /// The acos-submit directive also automatically uses the ajax flag of the submit directive.
628    ///
629    /// Details: https://github.com/apluslms/a-plus-rst-tools#13-submittable-acos-exercises
630    SubmittableACOSExercise,
631
632    /// The div directive can be used to insert basic <div> html elements into the generated document.
633    /// This is useful for styling and other similar reasons.
634    ///
635    /// Any arguments given to the directive will be added as classes to the resulting element.
636    ///
637    /// Details: https://github.com/apluslms/a-plus-rst-tools#14-html-div-elements
638    HTMLDiv,
639
640    /// Directive that inserts topic elements that are more friendly to css styling using the bootstrap framework.
641    ///
642    /// Details: https://github.com/apluslms/a-plus-rst-tools#15-css-styled-topics
643    CSSStyledTopic,
644
645    /// The media directives were developed basically for a single course and they may
646    /// not be quite reusable for other usecases, but they are listed here anyway.
647    /// This extension must be activated separately in the project conf.py
648    /// (extensions = ["aplus_setup", "media"]).
649    ///
650    /// Details: https://github.com/apluslms/a-plus-rst-tools#16-media-directives
651    Media,
652}