On this page:
3.1 Using require
3.2 Metadata block

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:

  1. By using require as you usually would, or

  2. 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:

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.