Module geez

Geez is a gemtext-parsing library, designed to be used to build websites.

  • Dependency-free
  • Parses gemtext to a modifiable AST
  • Compile the AST to (linted) gemtext and HTML

Info:

  • Copyright: 2026
  • License: AGPL-v3-or-later
  • Author: Pixelo789

Functions

iter_split_newline (str) Split a string by newlines.
escape_text (str) Escape text for HTML.

Class GeminiAST

GeminiAST:load_ast (ast) Load an AST table.
GeminiAST:load_str (str) Parse a gemtext string and set it as the AST.
GeminiAST:get_gemtext_doc () Compile the AST into gemtext.
GeminiAST:get_html_doc (def) Compile the AST into HTML.


Functions

iter_split_newline (str)
Split a string by newlines.

Parameters:

Returns:

    function An iterator function that returns strings.
escape_text (str)
Escape text for HTML.

Parameters:

  • str string String to escape.

Returns:

    string Escaped string.

Class GeminiAST

Gemtext AST class.
GeminiAST:load_ast (ast)
Load an AST table.

Parameters:

GeminiAST:load_str (str)
Parse a gemtext string and set it as the AST.

Parameters:

  • str string Gemtext string to parse.
GeminiAST:get_gemtext_doc ()
Compile the AST into gemtext.

Returns:

    string Linted gemtext string.
GeminiAST:get_html_doc (def)
Compile the AST into HTML.

Parameters:

  • def table

    A definition table, with the following parameters:

    • embed_images=true: whether or not to embed images in links.
    • escape=true: whether or not to escape less-than and greater-than signs.
    • indent="\t": what string to use to indent the document, if needed.
    • indent_level=0: what level to indent the document.
    • internal_link_suffix={before="gmi", after="html"}: a struct that defines how to parse internal links:
      • before="gmi" is the filename extension of the filename before parsing.
      • after="html" is the filename extension of the filename after parsing.

Returns:

    string HTML string.
generated by LDoc 1.5.0 Last updated 2026-04-30 21:50:59