Enum Node
Source pub enum Node {
Text(String),
Link {
to: String,
text: Option<String>,
},
Heading {
level: usize,
text: String,
},
List(Vec<String>),
Blockquote(String),
PreformattedText {
alt_text: Option<String>,
text: String,
},
Whitespace,
}
Expand description
A Gemtext AST node.
Each Gemtext line is a Node, and some lines can even be grouped together,
such as the Node::List Node!
§Gemtext Resources
A link line
§Examples
=> /this-is-the-to This is the text
=> gemini://to.somewhere.link
Fields
The location that a link line is pointing to
§Examples
=> /this-is-the-to This is the text
=> gemini://to.somewhere.link
The text a link line may have
§Examples
=> /this-is-the-to This line has text, unlike the next one.
=> gemini://to.somewhere.link
A heading line
§Examples
# This is a heading
## This is a sub-heading
### This is a sub-sub-heading
Fields
The level of a heading
§Examples
# This is a level 1 heading
## This is a level 2 sub-heading
### This is a level 3 sub-sub-heading
The text of a heading
§Examples
# This is the headings text
# This is also the headings text
A collection of sequential list item lines
§Examples
* These are
* sequential list
* items.
A blockquote line
§Examples
> This is a blockquote line
> This is also a blockquote line
A preformatted block
§Examples
Try to ignore the leading backslash in-front of the triple backticks,
they are there to not confuse the Markdown engine.
\```This is the alt-text
This is the preformatted block
This is the rest of the preformatted block
\```
Fields
A preformatted blocks alt-text
§Examples
Try to ignore the leading backslash in-front of the triple backticks,
they are there to not confuse the Markdown engine.
\```This is the alt-text
This is the preformatted block
This is the rest of the preformatted block
\```
A preformatted blocks content
§Examples
Try to ignore the leading backslash in-front of the triple backticks,
they are there to not confuse the Markdown engine.
\```This is the alt-text
This is the preformatted blocks content
This is the rest of the preformatted blocks content
\```
A whitespace line, a line which contains nothing but whitespace.
Convert a single Node of any node type to a Gemtext String
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.