This crate defines types and traits used in the inline and core crate to render Unimarkup elements to all supported output formats.
Therefore, all Unimarkup elements must implement the Render
trait defined in this crate.
Newly added Unimarkup elements must implement the Render
trait.
rust
impl Render for NewElement {
fn render_html(&self) -> Result<Html, LogId> {
// implement rendering to HTML for this new element
}
}
To add a new output format, the Render
trait must be extended.
Note: This affects all Unimarkup elements implementing the Render
trait!
```rust pub trait Render { // ... // previous output formats // ...
/// Renders Unimarkup to the new output format
fn rendernewformat(&self) => Result
The crate also provides syntax highlighting functionality in the highlight
module using the syntect crate.