Crate gemrendr

Crate gemrendr 

Source
Expand description

Turns Gemtext into idiomatic HTML.

use gemrendr::html_from_gemtext;

let document = "# Hello, world!";
let output = html_from_gemtext(document, Default::default());

assert!(output.ends_with("<h1>Hello, world!</h1>"));

By default, the output includes a comment that points to gemrendr’s public source code repository. To omit this line, configure render options like so:

use gemrendr::{RenderOptions, html_from_gemtext};

let options = RenderOptions {
	preamble: false,
	..Default::default()
};
let document = "# Hello, world!";
let output = html_from_gemtext(document, options);

assert_eq!(output, "<h1>Hello, world!</h1>");

See RenderOptions for more available options.

Structs§

RenderOptions
Options to use when rendering Gemtext as HTML.

Enums§

CopyButtonStyle
Whether and how a Copy Text button should be generated in preformatted blocks.
EmptyLineTag
The tag that should be used to represent empty Text lines.

Functions§

html_from_gemtext
Transforms the given Gemtext document string into an HTML document string.
html_markup_from_gemtext
Transforms the given Gemtext document string into an intermediate HTML Markup representation.