{"size": 1132, "ext": "scrbl", "max_stars_repo_path": "scribblings/gemtext.scrbl", "max_stars_repo_name": "bctnry/gemtext-racket", "max_stars_repo_stars_event_min_datetime": "2021-08-17T14:58:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-20T20:31:44.000Z", "max_issues_repo_path": "scribblings/gemtext.scrbl", "max_issues_repo_name": "bctnry/gemtext-racket", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scribblings/gemtext.scrbl", "max_forks_repo_name": "bctnry/gemtext-racket", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.0256410256, "max_line_length": 112, "alphanum_fraction": 0.656360424}
#lang scribble/manual
@require[@for-label[gemtext
                    racket/base
                    racket/contract]]

@title{gemtext: A text/gemini parser for Racket}
@author[(author+email "Sebastian René Higgins" "bctnry@outlook.com" #:obfuscate? #t)]

@defmodule[gemtext]

text/gemini is the markup language used by the @hyperlink["https://gemini.circumlunar.space/"]{Gemini protocol}.

@section{Datatypes}
@defstruct[gmi-link ([url string?] [text string?]) #:transparent]
@defstruct[gmi-heading ([level exact-positive-integer?] [text string?]) #:transparent]
@defstruct[gmi-list ([items (listof string?)]) #:transparent]
@defstruct[gmi-blockquote ([body string?]) #:transparent]
@defstruct[gmi-pre ([body (listof string?)] [alt string?]) #:transparent]

@defproc[(gmi-datum? [v any/c]) boolean?]{
 Defined as:
 @codeblock{
  (define (gmi-datum? v)
    (or (string? v)
        (gmi-link? v)
        (gmi-heading? v)
        (gmi-list? v)
        (gmi-blockquote? v)
        (gmi-pre? v)))
 }
}

@section{Parsing}

@defproc[(string->gmi [v string?]) (listof gmi-datum?)]{
 Parse a string into a list of text/gemini elements.
}

