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 4a61216890 Initial commit of working module 3 weeks ago
README.md Initial commit of working module 3 weeks ago
main.slo Initial commit of working module 3 weeks ago
module.json Initial commit of working module 3 weeks 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 #f) ; Will print the known procedures in the gemtext module
(usage gemtext gemtext->html) ; will print the gemtext->html usage information