Skip to content

vertigo-web/vertigo-cmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Allows to render CommonMark inside Vertigo tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages