Overview
The standard commands of samizdat, as one table.
(import (samizdat expand))
(import (samizdat commands))
(def commands
(map-merge standard-commands
#map(("bjolang" (text-command "Bjolang")))))
(read-document-file "post.sz" commands)
The commands make the tree of (samizdat doc). They do not know
the output format.
Each command checks its call. A misspelt keyword, a body where the
command takes none, and an argument that is missing or of the wrong
kind are errors: the expansion returns Err.
| Command | What it makes |
|---|---|
@em{...} @strong{...} | emphasis, and strong emphasis |
@strike{...} | struck-through text |
@sup{...} @sub{...} | superscript and subscript |
@code{...} | code, as written |
@checkbox @checkbox[#:checked #t] | an unchecked or a checked box |
@link["url"]{...} | a link. Without a body, the link shows the URL |
@image["src" #:alt "..."] | an image, as an inline |
@image["src" #:alt "..."]{...} | a figure with a caption, as a block |
@br | a line break |
@span["class"]{...} | text with a class |
@raw["html"]{...} | text for one format only |
@note{...} | a footnote, which can hold paragraphs |
@section{...} @section*{...} | a heading. #:id sets its id. The starred form has no id and is not in the table of contents |
@subsection{...} @subsubsection{...} | the levels below, also starred |
@codeblock[#:lang "x"]{...} | a block of code. With #:file "x.bjo", the code is the text of the file |
@blockquote{...} | a quotation, which can hold paragraphs |
@itemlist{@item{...} ...} | a list. #:style ordered numbers it, and #:start N sets the first number |
@lineblock{... @br ...} | lines whose breaks are kept |
@deflist{@term{...} @def{...}} | a definition list. A term can have more than one definition |
@read-list{- ...} | a list, written as Markdown and Org write one |
@read-table{| ... |} | a table, written as Org or Markdown write one |
@markdown{...} @include-markdown["post.md"] | Markdown, translated into the document |
@hr | a rule |
@div["class"]{...} | blocks with a class |
@raw-block["html"]{...} | a block for one format only |
@toc | a table of contents. #:depth 3 includes one more level |
@numbered-headings | numbers the headings: 1, 1.1, 1.1.1. #:depth 2 numbers fewer levels |
@ref["id"] @ref["id"]{...} | a link to a heading, before or after it |
@include["other.sz"] | another document, as if its text were written here |
@generate-docs[#:module "std random"] | a page of the docs of a Bjolang module |
@defmodule[(std random)]{...} | the doc of a module, and the module of the commands after it |
@defdoc[random-int]{...} @defdocs | the doc of one definition, or of all of them |
@docref[random-int] | a link to a definition that the document shows |
@comment{...} | nothing |
See also: standard-commands
Reference
Values
standard-commands
value ↑ Values
(: standard-commands (Map string Command))
The table of the standard commands, by name.
(read-document "Some @em{text}." standard-commands)
;; Your own commands, over the standard ones:
(map-merge standard-commands #map(("aside" aside)))
The key is the name of the command, without the @. The module
doc lists every command. map-merge lets the second map win, so a
command of yours replaces a standard command with the same name.
@item, @term and @def are in the table only to
give an error outside @itemlist and @deflist.
See also: read-list, read-table, markdown, include-markdown, generate-docs, defmodule, defdoc, defdocs, docref