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§
- Render
Options - Options to use when rendering Gemtext as HTML.
Enums§
- Copy
Button Style - Whether and how a Copy Text button should be generated in preformatted blocks.
- Empty
Line Tag - 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
Markuprepresentation.