Paulo Matos

Announcing HTML examples (html-examples)

Paulo Matos in announcement, racket, package, html-examples ‚óŹ

Announcing a new racket package html-examples to convert an examples block to HTML for inclusion in your own page.

raco pkg install html-examples

html-examples is a simple, one function, package to convert an scribble/example block into HTML. I tried to find a pre-existing function to do this but all I could do was to get scribble to generate a whole page together with a bunch of assets for the page to render properly. Therefore I created this package which fishes out the correct div from the page generated by scribble, so you can typeset beautiful examples on your web page like:

> (define x '(1 2 3 4))
> x

'(1 2 3 4)

> (define (sq x)
    (* x x))
> (map sq x)

'(1 4 9 16)

As usual, documentation can be found online and code can be found in the project’s page on GitHub where I am happy to receive any bug reports and feature requests you might have.

© Paulo Matos - Linki Tools 2020. All rights reserved