For example, to make a function has the colour red built in,
I tried
@(define (redtext text) (colorize #:color "red" text))
which did not work.
I've found this as an example for getting coloured text:
#lang scribble/base
@(require scribble/core)
@(define (colorize #:color c . content)
(elem #:style (style #f (list (color-property c)))
content))
@colorize[#:color "red"]{WARNING}
But what if you want to call colorize from Racket code.
For example, to make a function has the colour red built in,
I tried
@(define (redtext text) (colorize #:color "red" text))
which did not work.
In cases like these,
I’d just define a helper file my-commands.rkt
,
and @(require "my-commands.rkt")
Those helper commands can use standard Racket syntax, since
they’re likely to mostly be standard-looking Racket functions,
and they can (require scribble/whatever)
libraries if they need to call some of the scribble markup
functions. You can also use standard provide
forms in my-commands.rkt
to provide just your helper functions.