#lang racket/base
(require srfi/13)
(define (surround-char str char [prefix ""] [suffix (string-reverse prefix)])
(let ([line (string-append prefix (build-string (+ 4 (string-length str)) (λ(i) char)) suffix "\n")])
(string-append
line
prefix (string char) " " str " " (string char) suffix "\n"
line)))
(provide title)
(define (title str)
(surround-char
(string-append " " (string-titlecase str) " ")
#\* "; **")
)
(provide section)
(define (section str)
(surround-char str #\= ";==")
)
(provide subsection)
(define (subsection str)
(surround-char str #\: ";:")
)
(provide subsubsection)
(define (subsubsection str)
(surround-char str #\- ";")
)