Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 1.13 KB

README.md

File metadata and controls

67 lines (51 loc) · 1.13 KB

vertigo-cmark

Converts CommonMark string into rendered vertigo DomElement.

vertigo-cmark = { git = "https://github.com/vertigo-web/vertigo-cmark" }

Example

use vertigo::{start_app, DomElement, dom};

const CONTENT: &str = r#"
# Hello world

## Paragraph

Lorem ipsum dolor sit amet, __consectetur__ adipiscing elit, sed do
```eiusmod tempor incididunt```
ut *labore* et dolore magna aliqua.

## List

* Lorem ipsum
* dolor sit amet
* consectetur adipiscing elit

## Table

| Lorem           | Ipsum          |
| --------------- | -------------- |
| dolor sit amet  | consectetur    |
| adipiscing elit | sed do eiusmod |
"#;

fn app() -> DomElement {
    let content = vertigo_cmark::to_vertigo(CONTENT);
    dom! {
        <div>{ content }</div>
    }
}

#[no_mangle]
pub fn start_application() {
    start_app(app);
}

image

Features

  • Regular, bod, italic, strike-through text
  • Headings
  • Paragraphs
  • Tables
  • Blockquotes
  • Codeblocks
  • Lists (numbers, bullets)
  • Rules
  • Task list markers
  • Html
  • Footnotes
  • Soft/hard breaks
  • Links
  • Images