Created
November 23, 2021 23:17
-
-
Save Metaxal/4755dff3f47d76f616736d5abf83e810 to your computer and use it in GitHub Desktop.
Renders the current markdown file as HTML in the browser (quickscript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
;;; Author: Laurent Orseau https://github.com/Metaxal | |
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or | |
;;; [MIT license](http://opensource.org/licenses/MIT) at your option. | |
;;; Requires `commonmark` | |
(require quickscript | |
commonmark | |
net/sendurl | |
racket/file) | |
(script-help-string "Renders the current markdown file as HTML in the browser") | |
(define-script commonmark-render | |
#:label "CommonMark render (opens browser)" | |
(λ (selection #:file f) | |
(send-url/contents (document->html (string->document (file->string f)))) | |
#f)) | |
(module url2script-info racket/base | |
(provide filename url) | |
(define filename "commonmark-render.rkt") | |
(define url "https://gist.github.com/Metaxal/4755dff3f47d76f616736d5abf83e810")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment