Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown

Donna markdown

Docs - Read

Test status

Markdown to HTML conversion for the Donna programming language.

Overview

markdown is a small Donna wrapper around the MD4C C Markdown parser.

It exposes one focused function: convert a Markdown document string into an HTML fragment.

Installation

Add to your donna.toml as a dependency:

[dependencies]
markdown = { git = "https://github.com/NikolasSkyl/markdown", version = ">=0.1.0 and <1.0.0" }

Then import the module:

import markdown

Quick start

import markdown

pub fn render_post() -> String:
  markdown.to_html("# Hello Donna\n\nThis is **Markdown**.")

Use it in an app:

import markdown

pub fn main() -> Nil:
  echo markdown.to_html("Hello *Donna*")

Run tests:

donna test

API

For API Reference visit the generated docs here

Output

to_html returns an HTML fragment:

markdown.to_html("# Hello")
<h1>Hello</h1>

Credits

This package vendors MD4C, which is distributed under the MIT licence.

Licence

MIT

About

📝 Minimal/Basic Markdown support for Donna

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages