3 Writing Punct
Start your Punct source file with #lang punct. Then just write in CommonMark-flavored Markdown.
Punct allows inline Racket code that follows @ Syntax but with the • “bullet” character (U+2022) as the control character instead of @. On Mac OS, you can type this using ALT+8.
Punct source files automaticaly provide two bindings: doc (a document) and metas (a hash table).
3.1 Using require
By default, Punct programs have access to the bindings in racket/base and punct/core. You can import bindings from other modules in two ways:
By using require as you usually would, or
By adding one or more Module Paths directly on the #lang line.
#lang punct "my-module.rkt" racket/math •; All bindings in "my-module.rkt" and racket/math are now available •; You can also just use require normally •(require racket/string)
3.2 Metadata block
Sources can optionally add metadata using key: value lines delimited by lines consisting only of consecutive hyphens:
#lang punct --- title: Prepare to be amazed date: 2020-05-07 --- Regular content goes here
This is a syntactic convenience that comes with a few rules and limitations:
The metadata block must be the first non-whitespace thing that follows the #lang line.
The values will always be parsed as flat strings.
The reader will not evaluate any escaped code inside the metadata block; all characters in the keys and values will be used verbatim.
If you want to use non-string values, or the results of expressions, in your metadata, you can use the set-meta function anywhere in the document or in code contained in other modules. Within the document body you can also use the ? macro as shorthand for set-meta.