Mercurial > blahgd > experimental
changeset 1059:226dc304f397
docs: document the fmt 3 commands and environments
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Wed, 26 Aug 2020 09:45:12 -0400 |
parents | f02cc80a6f13 |
children | 38c3ca0cea50 |
files | docs/post-fmt3.txt |
diffstat | 1 files changed, 82 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/post-fmt3.txt Sat Aug 22 15:01:09 2020 -0400 +++ b/docs/post-fmt3.txt Wed Aug 26 09:45:12 2020 -0400 @@ -3,9 +3,88 @@ The format v3 language is similar to LaTeX but not identical. +Commands +-------- + +There is a number of different commands supported. In all cases, a commands +takes 0, 1, or 2 arguments. All commands that take 2 arguments, take one +optional and one mandatory argument. Therefore, it is possible to use +2-argument commands as 1-argument commands. + +Syntax-wise, the possible command forms are: + + \foo - no arguments + \foo{mandatory-arg} - 1 argument + \foo[opt-arg}{mandatory-arg} - 2 argument, but the optional + argument and the surrounding [] + may be omitted + +The supported commands are: + + \abbrev[long]{short} generates "short" with the "long" text as the + definition, the long text defaults to the short + \begin{env} begin the env environment + \bug{id} generates a link to bug "id" in the bug tracker; it + amounts to a shortcut for \link[id]{<bug-base-url>/id} + \category{text} no-op (originally associated a category with the post) + \degree{text} generates a "°text" + \emph{text} emphasizes "text" + \end{env} end the env environment + \img[alt-text]{url} generates an image, alt-text defaults to the URL + \item[desc]{text} generates a list item with "desc" keyword and "text" + body (description environment) + \item{text} generates a list item with "text" (for enumerate and + itemize environments) + \leftarrow generates a "←" + \leftrightarrow generates a "↔" + \link[text]{url} generates a link, the text defaults to the URL; Note + that the text can be an expression, for example an \img + \listing[lang]{path} include file "path" in a monospaced block (e.g., a + code listing); the lang argument is intended to + select syntax highlighting rules, but that + functionality is not yet implemented + \photo[alt]{uri} a shortcut for \img[alt]{<photo-base-url>/uri} + \photolink[text]{uri} a shortcut for \link[text]{<photo-base-url>/uri}; + Note that if text is not specified, the uri is + used as the text instead of the full URL + \post[text]{post-id} a shortcut for \link[text]{<base-url>/?p=post-id} + \published{timestamp} sets the date & time of publication, generates nothing + \rightarrow generates a "→" + \section{name} generates a heading + \subsection{name} generates a subheading + \subsubsection{name} generates a subsubheading + \tag{tag-name} associate a tag with the post, generates nothing + \taglink[text]{tag} a shortcut for \link[text]{<base-url>/?tag=tag}; + Note that if text is not specified, the tag name is + used as the text instead of the full URL + \textbf{text} bolds "text" + \textit{text} italicizes "text" + \texttt{text} monospaces "text" + \title{text} sets the title of the post, generates nothing + \tm generates a "™" + \trow{text} generates a table row with "text", each column is + separated by a '&' + \wiki[text]{name} generates a link to "name" Wikipedia article, with + the link text of "text"; it amounts to a shortcut + for \link[text]{<wiki-base-url>/name} + +Note that some of the commands only set metadata. This metadata takes +precedence over the metadata stored in the post.lisp file. + + \title{foo} is equivalent to (title . "foo") in post.lisp + \tag{foo} is equivalent to (tag "foo") in post.lisp (multiple \tag{}s are + allowed) + \published(foo} is equivalent to (published . "foo") + + Environments ------------ - verbatim - output raw html - texttt - merely monospace - listing - similar to the listing command + description - keyword list, each item made using \item[key]{text} command + enumerate - ordered list, each item made using \item{} command + itemize - unordered list, each item made using \item{} command + listing - similar to the listing command + quote - block quote + tabular - a table + texttt - merely monospace, similar to \texttt + verbatim - output raw html