aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7497cf1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# gema_texto
+
+`gema_texto` parses gemtext and renders html.
+
+This library powers [blog](https://r.bdr.sh/blog.html) and
+[page](https://r.bdr.sh/page.html), so it makes some decisions on
+for those projects. Here's how each line is handled:
+
+- Headings and the content under them is wrapped in a `<section>` tag.
+- All text lines are `<p>`, even empty ones.
+- URLs are wrapped in a `<p>`
+- Alt Text is supported for preformatted-toggles, and is written as
+ the aria-label of the `<pre>` tag.
+- Consecutive list items are wrapped in a `<ul>` and rendered as `<li>` tags.
+- Quotes are wrapped in a single `<blockquote>`
+
+# Usage
+
+More in-depth usage docs in the source. This is an overview of the included
+functionality.
+
+- `gemini_parser` deals with parsing the gemini file itself.
+- `html_renderer` takes a parsed gemini file and renders it to html.
+
+## `gema_texto::gemini_parser::GeminiLine`
+
+An `enum` that represents the six different types of lines in gemtext.
+
+## `gema_texto::gemini_parser::parse`
+
+Parses a `&str` of gemtext source and returns a `Vec<GeminiLine>`.
+
+## `gema_texto::html_renderer::render_html`
+
+Renders a `Vec<GeminiLine>` into some html `String`