2Skribilo User Manual — Syntax |
This chapter describes the syntax or Skribilo documents---or rather, the available syntaxes Skribilo documents can use. Skribilo actually supports several input syntaxes, each of which is implemented by a reader. The input syntax (and reader) can be selected at document compilation time using the --reader option of the compiler (see Chapter 14). Nevertheless, it has a ``preferred'' syntax (the default syntax), which is that of the Skribe document preparation system. Thus, the Skribe syntax is first described, and then alternate syntaxes are presented.
By default or when the --reader=skribe option is passed to the compiler, a Skribilo document is composed of Skribe expressions, which resemble expressions in the Scheme programming language, with a few extensions to make them more convenient to use within documents. A Skribe expression can be:
Here are several examples of correct Skribe expressions:Expressions are evaluated, thus (bold "foo") has the effect of typesetting the word foo in bold face to produce foo. Escape sequences enable evaluation of expressions inside the text. Thus the text [Another ,(bold "text") sample] produces `Another text sample'. On the other hand [Another (bold "text") sample] produces `Another (bold "text") sample' because it does not contain the escape sequence `,('.
|
A Skribe width refers to the horizontal size a construction occupies on an output document. There are three different ways for specifying a width:
350).50.0) which ranges in the interval
[-100.0 .. 100.0]"0*"
specification). Note that this way of specifying width
is strictly unportable.Alternatively, Skribilo allows documents to be written in a plain text format, with almost no markup. Instead, conventions borrowed from Emacs' Outline Mode to denote the text structure as well as other common conventions are used to express various formatting ideas. This syntax is implemented by the outline reader; thus, it is made available by passing the --reader=outline option to the compiler. The major elements of this syntax are the following:
Title: at the beginning of the text file, and followed by
the title. Likewise, the author can be specified with a line starting
with Author:.tt.(ref :url ...) form (see ref). In addition,
outline has limited support for Org-Mode-style hyperlinks; for
instance, [[http://gnu.org/][The GNU Project]] yields The GNU Project.Here is an example showing how the outline syntax maps to the native skribe syntax:
-*- mode: outline; coding: latin-1; -*-
Title: Demonstrating Skribilo's Outline Syntax
Author: Ludovic Courtès
Keywords: Skribilo outline Emacs
This document aims to *demonstrate*
[[http://skribilo.nongnu.org/][Skribilo]]'s outline syntax.
* The First Chapter
The first chapter contains a couple of sections.
They look as though they had been introduced with
the `section' markup of the Skribe syntax.
** The First Section
This section is pretty much empty.
** The Second Section
This section introduces lists.
*** Bullet Lists
This section contains a wonderful `itemize'-style bullet list:
- the first item;
- the second item;
- the last one, which spans
two lines of text.
And that's it. Note that list items had to be
separated by empty lines.
*** Enumerations
This section shows an `enumerate'-style list:
1. The first item;
2. The second one;
3. The last one.
Note that list items are numbered this time.
* The Second Chapter
The second chapter does _not_ add anything useful.
Text like this that starts after an empty line is
put into a new paragraph.
Ex. 1: The outline syntax... produces:
|
The outline mode makes it possible to quickly create documents that can be output in variety of formats (see Chapter 13). The downside is that, being a very simple markup-less document format, there are many things that cannot be done using it, most notably tables, bibliographies, and cross-references.
It is also possible to create and output Skribilo documents
from a Guile Scheme program. In that case, you get to use the Scheme
syntax, which is close to the Skribe
syntax described above, modulo the [...] constructs. A
typical Scheme program that would produce and output a document, pretty
much like what the skribilo
compiler does, would look like this:
|