The markup corresponds to the markup of Vim’s viki-plugin. There are some minor deviations, though.
This chapter is mainly a test course.
A deplate
document is made up of
elements (a.k.a. block
elements in HTML,
XML etc.) that consist of
particles (a.k.a. inline
elements). No particle can
cross element boundaries. This distinction is
important to understand, as
commands and
regions yield
elements, but
macros yield
particles.
Although deplate has some facitilities for program control (conditional or repeated output), it really is rather a markup language but no programming language. Although you can define new elements right within a deplate document using deplate markup, this only works for really simple elements.
If a line matches an element pattern (usually defined by the beginning of the line), it marks the end of the previous element and starts a new element. If a line matches no pattern, it either starts a new paragraph or is added to the previous element. Elements like headings, anchors, or table rows are one-line patterns to which no unmatched line will be added. Other elements like list items or paragraphs can be made up of more than one line.
The deplate
markup is based on
inserting special characters into the text as in this example:
__emphasized__
, which will be printed as
emphasized. If you want to prevent deplate
from
interpreting these markers, they must be preceded by a
backslash.
You should especially take care with the following characters:
Sequences of character you should notice:
Characters with special meaning if they occur at the beginning of line:
Other:
$a = x + y$
or with blanks
$ a = x + y $
as the dollar
sign is most likely used before or after a digit.
Be aware that your editors line wrap can inadvertently place these characters at the beginning of a line.
__emphasize__, WikiName \__noemphasize\__, \NoWikiName One \ \ line One\ word unnnnnnnnnnnnnnnnnn\ breakkkkkkkkkkkkkkkkkk\ ableeeeeeeeeeeeeeeeeeeeeeee
Output:
emphasize, WikiName
One line
Oneword
unnnnnnnnnnnnnnnnnn breakkkkkkkkkkkkkkkkkk ableeeeeeeeeeeeeeeeeeeeeeee
Arguments to macros, commands, and regions:
!=:
and single double
quotes must be preceded by a backslash
There are two special arguments (fmt
and if
)
that allow some control on whether an
element will be included in the output. Please
see 15.6 for
details.
Line %1 %Comment Line %2
Output:
Line %1 Line %2
A paragraph a sequence of non-empty lines that don’t match anything else.
Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line. Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list. - Item 1 - Item 2
Output:
Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line.
Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list.
NOTE: Headings can span more than one line by putting a backslash (‘\’) at the end of the line.
Known options:
headings
to
“plain” if you want to turn off numbering for all headings.)
hyperHeading
variable(see 15.1.2)
to be set
If you set the variable
autoFileNames
, deplate
will derive the file
name from the heading.
* Level 1 #OPT: id=foo ** Level 2 *** Level 3 #OPT: noList! plain! ...
- Item * Item + Item 1. Item 1 a. Item a B. Item B #Verb <<--------- EMBEDDED VERBATIM TEXT --------- 2. Item 1 || Embedded || Table || | x | 1 | | y | 2 | * Item # Item 1 @ There is much to say about Item A, too much to be put in words or to be written down. What else is there to say about Item A? @ Item B # Item 2 - Do this #A _ Some task #B1 _ Some other task - Do that #A x11-11-2050 Something was done! #B1 11-11-2050 Some other task
Output:
EMBEDDED VERBATIM TEXT
Embedded | Table |
---|---|
x | 1 |
y | 2 |
NOTE: “#” (numbered, ordered
lists), and “@” (ordered
lists with letters) are the preferred markers. If
you use dashes as in LaTeX (i.e. “--”), a dash appears to be
okay too. Be aware that, like LaTeX, deplate
concatenates
two normal dashes (“--”) to one long dash
(“–”) – see
also 10.10.
NOTE: If you run into troubles when nesting lists, consider the use of the list macro 13.5.
NOTE: Task lists are implemented as
varlist
in DocBook.
Item :: Description
Output:
A table is marked as sequence of lines beginning and ending with one or two “|” symbols. Two pipe symbols (or whatever its name is) define a row belonging to the head or the foot.
A row containing only empty cells and cells with hyphens defines a ruler.
A cell containing only “^” means concatenate with the cell above. A cell containing only “<” means concatenate with the cell to the left.
Tables take the following options (via the OPT command):
head=N
foot=N
hiRow=N1,N2,first,last,...
hiCol=N1,N2,first,last,...
rows=ROWDEF1, ROWDEF2, ...
KEY1.VAL1 KEY2.VAL2 ...
; KEY
being one of
cols=COLDEF1, COLDEF2, ...
KEY1.VAL1 KEY2.VAL2 ...
; KEY
being one of
long!
, short!
longtable
environment should be used in
LaTeX output (by default, the longtable
environment will be
used for tables with more than 20 rows).
table
and the longtable
environment has some effects on the layout. One consequence is that
footnotes are set properly only in the longtable
environment. On the other hand, the here
,
floatHere
, align
, and floatAlign
options are currently ignored.
style=NAME
stylex=NAME
style
but ignore tableStyle
note=TEXT
In addition, the following options for “floats” apply too:
here!
, floatHere=1
h
attribute to the table
environment
align=[left|right|center]
, floatAlign=[left|right|center]
Joining cells: If a cell contains nothing but “^” or “<”, the current cell will be joined with the left one or with the cell above. (The actual output depends on the formatter and the capabilities of the target format, though.)
It depends on the formatter whether these options are interpeted.
|| ----------------------------- || || Head || Categories || < || | Row1 | Value1 | Value1 | | | ----------- | | | Row2 | | Value2 | | | ----------- | | | Row3 | Value3 | ^ | | ----------------------------- | #OPT: hiCol=first hiRow=last cols=w.3cm j.right r.1, w.1cm,,r.1 rows=,h.3cm #OPT: note=Source: My Head, 2004 #CAP: This Table #thisTable
Output:
Head | Categories | |
---|---|---|
Row1 | Value1 | Value1 |
Row2 | Value2 | |
Row3 | Value3 |
NOTE: Rows can span more than one line by putting a backslash (‘\’) at the end of the line.
NOTE: An empty cell is marked by at least 3 consecutive blanks.
You can also define a style for a table. The style attribute is currently only interpreted by the latex-styles module and to some degree emulated in HTML output – not so surprisingly, this works better in Firefox than in MS IExplorer.
The following styles are known (for one or another output format):
#Var id=styledTableExample <<--- || Head || A || B || | Row1 | 1 | 2 | | Row2 | 3 | 4 | || Foot || X || Y || #OPT: hiCol=first --- Test ''grid'' & ''scriptsize'' styles: #INCLUDE var=styledTableExample #OPT: style=grid,scriptsize Test ''formal'' & ''footnotesize'' styles: #INCLUDE var=styledTableExample #OPT: style=formal,footnotesize Test ''box'' & ''small'' styles: #INCLUDE var=styledTableExample #OPT: style=box,small Test ''overlay'' style: #INCLUDE var=styledTableExample #OPT: style=overlay,landscape
Output:
Test grid
& scriptsize
styles:
Head | A | B |
---|---|---|
Foot | X | Y |
Row1 | 1 | 2 |
Row2 | 3 | 4 |
Test formal
& footnotesize
styles:
Head | A | B |
---|---|---|
Foot | X | Y |
Row1 | 1 | 2 |
Row2 | 3 | 4 |
Test box
& small
styles:
Head | A | B |
---|---|---|
Foot | X | Y |
Row1 | 1 | 2 |
Row2 | 3 | 4 |
Test overlay
style:
Anchor (or labels respectively) are attached to the previous element, save if the previous element is a whitespace. In this case the anchor will be attached to the following element.
The name must begin with a lower letter. There mustn’t be non-whitespace character before the sharp sign.
* This is section one #labSectOne Some text. #labSomeText #labSectTwo * This is section two
deplate
is inspired by several wiki engines. It thus also
provides formatting of wiki names and URLs as
hyperlinks. There are about four types of wiki names.
[-
and -]
will be turned into
a hyperlink.
[[DESTINATION][OPTIONAL NAME]MODIFIER]
.
rel="nofollow"
deplate
from adapting the reference’s suffix
deplate
was created as the publishing framework (or so)
for a personal wiki (namely the Vim
viki plugin). As such it assumes that the files
being referenced to are converted to the same target format as the
current file, which is why deplate
modfies an extended wiki
destination’s suffix. Use this modifier to prevent
deplate
from doing so.
deplate
output is only an intermediary
file; in order to make deplate
append the suffix of the
final output file, set the document option
suffix
to the desired value. E.g. if you convert to
docbook and then from
docbook to html, pass the
option -D suffix=html
to deplate
when
converting the text sources.
[[http://www.example.com][{img: example_image}]]
. See
also 13.5.
NAMEINCAPITALS::
. You have to define an interwiki before
referring to it by adding something like this to your configuration
file:
InterWiki.add("ID", "http://BASEURL/", ".SUFFIX")
Wiki Names are automatically marked as index entries – see 12.4 and 12.5.
WikiName WikiName#anchor [-name-] [-some name-]#there [--]#here OTHERWIKI::WikiName OTHERWIKI::WikiName#there OTHERWIKI::[-some name-] OTHERWIKI::[-some name-]#there [[destination]] [[destination][name]] [[destination#anchor][name]] [[destination.suffix]!] [[OTHERWIKI::destination#anchor][name]] [[#anchor]] [[#anchor][name]]
The backtick (`) is used to introduce some
symbols like quotation marks (e.g., in positions where
deplate
would choose the wrong one).
Symbols are not expanded in text marked as typewriter/code and in verbatim regions.
<-, ->, <=, =>, <~, ~>, <->, <=>, <~>, !=, ~~, ..., --, ==, ```, `'', ``, `' ''->'', ''<-'' #Verb <<-- <-, ->, <=, => -- #Code id=symbolsTest syntax=ruby <<-- <-, ->, <=, => --
Output:
NOTE: If you want to disable some of these symbols, you could add some ruby code like this to your config.rb:
class Deplate::Particle::Symbol @@symbols_table.delete_if {|k,v| ['<->', '<=>', '<~>'].include?(k)} reset_symbols end
Markers are meant to highlight a position in the text. In order to avoid ambiguities with notes (see below), there should not be a space before or after the marker – i.e. it should immediately follow or precede the word it is referring to.
- elaborate+++ - here### - questionable??? - attention!!!
Output:
Indented paragraphs that begin with a marker and a subsequent space start an annotation, i.e. the text of paragraph will be turned in a margin note or similar – depending on the output format.
Indented paragraphs that begin with a marker and a subsequent space start an annotation. !!! Something like this.
Output:
Indented paragraphs that begin with a marker and a subsequent space start an annotation.
Something like this.
"Text in quotes"
Output:
“Text in quotes”
NOTE: Quotes are handled by two classes:
Deplate::Particle::DoubleQuote
and
Deplate::Particle::SingleQuote
. In order to disable smart
quotes add this code to your config.rb:
Deplate::Particle.disable_particle( Deplate::Particle::DoubleQuote, Deplate::Particle::SingleQuote )
__emphasize__, ''typewriter''
Output:
emphasize, typewriter
NOTE: There must not be a whitespace after the opening mark.
NOTE: Text in typewriter style is basically set verbatim with the expection of backslashes.
A break is marked by at least 2 dashes, “8<”, and again at least 2 dashes.
I say so. ----8<-------------- Summary:
In HTML output, a break is represented by a horizontal line. In other output formates, a break actually denotes a page break.
A line of whitespace usually separates text elements – e.g. paragraphs,