Expand description

aurelius is a complete solution for live-previewing markdown as HTML.

This crate provides a server that can render and update an HTML preview of markdown without a client-side refresh. Upon receiving an HTTP request, the server responds with an HTML page containing a rendering of supplied markdown. Client-side JavaScript then initiates a WebSocket connection which allows the server to push changes to the client.

This crate was designed to power vim-markdown-composer, a markdown preview plugin for Neovim, but it may be used to implement similar plugins for any editor. See vim-markdown-composer for a real-world usage example.

Example

use aurelius::Server;

let mut server = Server::bind("localhost:0")?;
println!("listening on {}", server.addr());

server.open_browser()?;

server.send(String::from("# Hello, world"));

Acknowledgments

This crate is inspired by suan’s instant-markdown-d.

Why the name?

“Aurelius” is a Roman gens (family name) shared by many famous Romans, including emperor Marcus Aurelius, one of the “Five Good Emperors.” The gens itself originates from the Latin aureus meaning “golden.” Also, tell me that “Markdown Aurelius” isn’t a great pun.

Aurelia (gens) on Wikipedia.

Structs

Markdown preview server.