SubstitutionDefDirective

Enum SubstitutionDefDirective 

Source
pub enum SubstitutionDefDirective {
    ReplacementText,
    UnicodeCharCode,
    Date,
}
Expand description

An enumeration of different macro directive types.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#directives-for-substitution-definitions

Variants§

§

ReplacementText

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:

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#replacement-text

§

UnicodeCharCode

The “unicode” directive converts Unicode character codes (numerical values) to characters, and may be used in substitution definitions only.

The arguments, separated by spaces, can be:

  • character codes as
    • decimal numbers or
    • hexadecimal numbers, prefixed by 0x, x, \x, U+, u, or \u or as XML-style hexadecimal character entities, e.g. ᨫ
  • text, which is used as-is.

Text following “ .. “ is a comment and is ignored. The spaces between the arguments are ignored and thus do not appear in the output. Hexadecimal codes are case-insensitive.

Details: https://docutils.sourceforge.io/docs/ref/rst/directives.html#unicode-character-codes

§

Date

The “date” directive generates the current local date and inserts it into the document as text. This directive may be used in substitution definitions only.

The optional directive content is interpreted as the desired date format, using the same codes as Python’s time.strftime function. The default format is “%Y-%m-%d” (ISO 8601 date), but time fields can also be used. Examples:

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

Trait Implementations§

Source§

impl Debug for SubstitutionDefDirective

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, 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.