Skip to content

Instantly share code, notes, and snippets.

@Metaxal
Last active September 2, 2022 13:50
Show Gist options
  • Save Metaxal/20837a1771cf8003a305341f4e91ad1f to your computer and use it in GitHub Desktop.
Save Metaxal/20837a1771cf8003a305341f4e91ad1f to your computer and use it in GitHub Desktop.
scribble examples in <details> html element
#lang scribble/manual
@(require scribble/core
scribble/html-properties
racket
scribble/example)
@(define the-eval (make-base-eval))
@examples[#:eval the-eval #:hidden
(require racket/string)]
@(define (details #:label [label "Details"] . blocks)
(nested-flow
(style #f
(list (alt-tag "details")
(attributes '())))
(cons
(paragraph
plain
(elem label #:style (style #f (list (alt-tag "summary") (attributes '())))))
blocks)))
@(details
#:label "Examples"
@examples[#:eval the-eval
#:label #f
(string-upcase "hello")])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment