aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-07-04 17:36:48 +0200
committerBrian Picciano <me@mediocregopher.com>2024-07-04 17:36:48 +0200
commit0134492489ac70306486678aae81192d9cc0228d (patch)
treee8f3b2a922215c26bb6fa20cf104f54bc0e16aa1 /README.md
parent4291fc5f1c992a499fbc82decc3fe8090d4dff68 (diff)
Split gemtext function output into Body and Title
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 14 insertions, 2 deletions
diff --git a/README.md b/README.md
index 092f348..a914f51 100644
--- a/README.md
+++ b/README.md
@@ -25,8 +25,20 @@ templates {
}
```
-See the `template.localhost` virtual host in `example/Caddyfile` for an example
-of using the `gemtext` template to render a gemtext file within an HTML file.
+Within a template being rendered the `gemtext` function will be available and
+can be passed any string. The function will return a struct with the following
+fields:
+
+* `Body`: The result of converting each line of the input string into an
+ equivalent line of HTML. This will not include any wrapping HTML tags like
+ `<div>` or `<body>`.
+
+* `Title`: A suggested title, based on the first `# Header` line found in the
+ gemtext input.
+
+See the `template.localhost` virtual host in `example/Caddyfile`, and the
+associated `example/tpl/render_gemtext.html` template file, for an example of
+how to use the template function.
[gemtext]: https://geminiprotocol.net/docs/gemtext.gmi
[mdfunc]: https://caddyserver.com/docs/modules/http.handlers.templates#markdown