gemtext:   A text/  gemini parser for Racket
1 Datatypes
gmi-link
gmi-heading
gmi-list
gmi-blockquote
gmi-pre
gmi-datum?
2 Parsing
string->gmi
8.12

gemtext: A text/gemini parser for Racket🔗ℹ

Sebastian René Higgins <bctnry at outlook dot com>

 (require gemtext) package: gemtext

text/gemini is the markup language used by the Gemini protocol.

1 Datatypes🔗ℹ

struct

(struct gmi-link (url text)
    #:extra-constructor-name make-gmi-link
    #:transparent)
  url : string?
  text : string?

struct

(struct gmi-heading (level text)
    #:extra-constructor-name make-gmi-heading
    #:transparent)
  level : exact-positive-integer?
  text : string?

struct

(struct gmi-list (items)
    #:extra-constructor-name make-gmi-list
    #:transparent)
  items : (listof string?)

struct

(struct gmi-blockquote (body)
    #:extra-constructor-name make-gmi-blockquote
    #:transparent)
  body : string?

struct

(struct gmi-pre (body alt)
    #:extra-constructor-name make-gmi-pre
    #:transparent)
  body : (listof string?)
  alt : string?

procedure

(gmi-datum? v)  boolean?

  v : any/c
Defined as:
(define (gmi-datum? v)
  (or (string? v)
      (gmi-link? v)
      (gmi-heading? v)
      (gmi-list? v)
      (gmi-blockquote? v)
      (gmi-pre? v)))

2 Parsing🔗ℹ

procedure

(string->gmi v)  (listof gmi-datum?)

  v : string?
Parse a string into a list of text/gemini elements.