FAQs: Scribble - racket/racket GitHub Wiki

This page collects frequently asked questions about Scribble.

How to type a hyphen or dash?

use -- or --- to get an n-dash or m-dash respectively

See https://docs.racket-lang.org/scribble/decode.html

How to type @ (at sign)

Use @"@".

For example, @bold{a@"@"b} is rendered as a@b

Furthermore:

In some cases, a text contains many literal @s, which can be cumbersome to quote individually. For such case, braces have an alternative syntax: A block of text can begin with a |{ and terminated accordingly with a }|.

For example, @bold|{a@b}| is also rendered as a@b

Reference: https://docs.racket-lang.org/scribble/reader.html?q=escape#%28part._.The_.Scribble_.Syntax_at_a_.Glance%29

How to create a custom tag

Following code demonstrates how to create details, which corresponds to <details> in HTML.

#lang scribble/base

@(require (only-in scribble/core make-style)
          (only-in scribble/html-properties alt-tag))

@(define details-style (make-style #f (list (alt-tag "details"))))

@(define (details . arg*)
   (apply elem #:style details-style arg*))

@; -----------------------------------------------------------------------------

This is a Scribble document with a @tt{details} element.

@details{
 The @tt{alt-tag} style property can change the HTML tag that
 Scribble creates for an @tt{element} or @tt{paragraph}.
}

Reference: https://docs.racket-lang.org/scribble/core.html#(def._((lib._scribble%2Fhtml-properties..rkt)._alt-tag))

⚠️ **GitHub.com Fallback** ⚠️