A gemtext parsing/conversion module for the slope programming language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sloum 9ca1cc3283
Changes up naming to support namespaces
9 months ago
README.md Changes up naming to support namespaces 9 months ago
main.slo Changes up naming to support namespaces 9 months ago
module.json Changes up naming to support namespaces 9 months ago

README.md

gemtext

gemtext is a gemtext parsing module for the slope programming language. It can parse gemtext as a list of associative lists (a flat parse tree), convert gemtext to markdown, and convert gemtext to html.

(load-mod gemtext)
(define my-gemtext "# Test\n\n=> https://slope.colorfield.space Slope Language Website\n\nThis is some sample text\n")

(display (gemtext::->markdown my-gemtext)) ; will print markdown
(display (gemtext::->html my-gemtext)) ; will print html, honoring extra line breaks via <br> tags
(display (gemtext::->html my-gemtext #t)) ; will print html and strip extra line breaks

(define my-gemtext-assoc (gemtext::parse my-gemtext)) ; saves the parse list to a variable
(display (assoc (car my-gemtext-assoc) "type")) ; will print 'h1'

(usage gemtext) ; Will print the known procedures in the gemtext module
(usage gemtext::->html) ; will print the ->html usage information