]> git.r.bdr.sh - rbdr/gema_texto/blame - README.md
Fix lints
[rbdr/gema_texto] / README.md
CommitLineData
8beb2bfa
RBR
1# gema_texto
2
3`gema_texto` parses gemtext and renders html.
4
5This library powers [blog](https://r.bdr.sh/blog.html) and
6[page](https://r.bdr.sh/page.html), so it makes some decisions on
7for those projects. Here's how each line is handled:
8
9- Headings and the content under them is wrapped in a `<section>` tag.
10- All text lines are `<p>`, even empty ones.
5f7e1e31
RBR
11- URLs are wrapped in a `<p>` and .gmi files are changed to .html unless the
12 URL starts with gemini:
8beb2bfa
RBR
13- Alt Text is supported for preformatted-toggles, and is written as
14 the aria-label of the `<pre>` tag.
15- Consecutive list items are wrapped in a `<ul>` and rendered as `<li>` tags.
16- Quotes are wrapped in a single `<blockquote>`
17
18# Usage
19
20More in-depth usage docs in the source. This is an overview of the included
21functionality.
22
23- `gemini_parser` deals with parsing the gemini file itself.
24- `html_renderer` takes a parsed gemini file and renders it to html.
25
26## `gema_texto::gemini_parser::GeminiLine`
27
28An `enum` that represents the six different types of lines in gemtext.
29
30## `gema_texto::gemini_parser::parse`
31
32Parses a `&str` of gemtext source and returns a `Vec<GeminiLine>`.
33
34## `gema_texto::html_renderer::render_html`
35
36Renders a `Vec<GeminiLine>` into some html `String`