pub struct Yamd {
pub metadata: Option<String>,
pub body: Vec<YamdNodes>,
}Expand description
§Yamd
Metadata is optional Frontmatter.
Can be only in the beginning of the document surrounded by Minus of length 3 followed by EOL and EOL followed by Minus of length 3. Can contain any string that is parsable by the consumer.
For example toml:
---
title: "Yamd"
tags:
- software
- rust
---Body can contain one or more:
Separated by Terminator.
Example:
Yamd can contain a Paragraph. Or a
# Heading
Or one image:

Or code:
```rust
let a="or a code block";
```
Or unordered list:
- Level 0
- Level 1
Or ordered list:
+ Level 0
+ Level 0
+ Level 1
It also can have a thematic break:
-----
Or embed:
{{youtube|url}}
Or multiple images combined into gallery. There is no 1:1 match for that in HTML, and multiple
ways to do it depending on how it will be rendered:


Or a highlight:
>> Highlight title
> warning
There is no 1:1 equivalent to a highlight in HTML.
Highlight body can contain multiple paragraphs.
>>
{% Or collapsible
Which is also does not have 1:1 equivalent in HTML
%}HTML equivalent:
<p>Yamd can contain a Paragraph. Or a</p>
<h1>Heading</h1>
<p>Or one image:</p>
<img src="url" alt="alt"/>
<p>Or code:</p>
<pre><code>let a="or a code block";</code></pre>
<p>Or unordered list:</p>
<ul>
<li>
Level 0
<ul>
<li>Level 1</li>
</ul>
</li>
</ul>
<p>Or ordered list:</p>
<ol>
<li>Level 0</li>
<li>
Level 1
<ol>
<li>Level 1</li>
</ol>
</li>
</ol>
<p>It also can have a thematic break:</p>
<hr/>
<p>Or embed:</p>
<iframe class="youtube" src="url" />
<p>Or multiple images combined into gallery, there is no 1:1 match for that in HTML, and multiple
ways to do it depending on how it will be rendered:</p>
<div class="images">
<img src="url" alt="alt"/>
<img src="url" alt="alt"/>
</div>
<p>Or a highlight:</p>
<div class="highlight">
<div class="icon warning"></div>
<div class="body">
<h3>Highlight title</h3>
<p>There is no 1:1 equivalent to a highlight in HTML.</p>
<p>Highlight body can contain multiple paragraphs.</p>
</div>
</div>
<div class="collapsible">
<input type="checkbox" id="{{ node.title }}" />
<label for="{{ node.title }}">Or collapsible</label>
<div class="body">
<p>Which is also does not have 1:1 equivalent in HTML</p>
</div>
</div>Fields§
§metadata: Option<String>§body: Vec<YamdNodes>Implementations§
Trait Implementations§
impl Eq for Yamd
impl StructuralPartialEq for Yamd
Auto Trait Implementations§
impl Freeze for Yamd
impl RefUnwindSafe for Yamd
impl Send for Yamd
impl Sync for Yamd
impl Unpin for Yamd
impl UnwindSafe for Yamd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more