1 * [[/viki][test viki syntax, playground]]
4 [[otherwiki::dist#anchor][name_show]]
5 [[$TOPDIR/kernel/about][abount]]
21 || head || category ||
26 Foo bar{fn: x} foo bar.
32 <-, ->, <=, =>, <~, ~>, <->, <=>, <~>, !=, ~~, ..., --, ==
35 #Code id=Foo syntax=ruby <<---
44 %%Some formula: {ltx: $\sum_{i=n}^{n} x_{i}$}
45 %%or simply: $\lambda_1 v_1 + \lambda_2 v_2 + ... + \lambda_n v_n$.
48 %%$det A = \sum\limits_{\pi \in S_n} sgn(\pi) a_{\pi(1)1} ... a_{\pi(n)n}$
57 #TI: How to do web-based presenation with deplate
69 EMBEDDED VERBATIM TEXT
72 || Embedded || Table ||
77 @ There is much to say about Item A, too much to be put
78 in words or to be written down.
80 What else is there to say about Item A?
88 #A x11-11-2050 Something was done!
89 #B1 11-11-2050 Some other task
92 || ----------------------------- ||
93 || Head || Categories || < ||
94 | Row1 | Value1 | Value1 |
99 | ----------------------------- |
100 #OPT: hiCol=first hiRow=last cols=w.3cm j.left r.1, w.1cm,,r.1 rows=,h.3cm
101 #OPT: note=Source: My Head, 2004
105 #Var id=styledTableExample <<---
113 Test ''grid'' & ''scriptsize'' styles:
114 #INCLUDE var=styledTableExample
115 #OPT: style=grid,scriptsize
117 Test ''formal'' & ''footnotesize'' styles:
118 #INCLUDE var=styledTableExample
119 #OPT: style=formal,footnotesize
121 Test ''box'' & ''small'' styles:
122 #INCLUDE var=styledTableExample
123 #OPT: style=box,small
125 Test ''overlay'' style:
126 #INCLUDE var=styledTableExample
127 #OPT: style=overlay,landscape
130 * This is section one
137 * This is section two
152 ::[-some name-]#there
155 [[destination][name]]
156 [[destination#anchor][name]]
157 [[destination.suffix]!]
158 [[::destination#anchor][name]]
163 <-, ->, <=, =>, <~, ~>, <->, <=>, <~>, !=, ~~, ..., --, ==, ```, `'', ``, `'
171 #Code id=symbolsTest syntax=ruby <<--
182 Indented paragraphs that begin with a marker and a subsequent space
184 !!! Something like this.
186 --------------------------------------------------------------------
188 9.1.1 Elements and Particles
190 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.
192 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.
194 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.
197 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.
199 * The backslash is used as escape character that prevents the wikification of the following character.
200 * There are two exceptions:
201 1. A backslash at the end of the line makes a pattern include the next line; any whitespace at the beginning of the following line is removed.
202 2. A backslash in front of a blank results in non-breaking space.
203 * A backslash that should be printed must be preceded by a backslash.
205 9.1.3 Special Characters
207 You should especially take care with the following characters:
210 Curly braces usually enclose macros; in other contexts, they should always be preceded by a backslash
212 * There are some grey areas though that could cause problems, e.g. when input to a macro (e.g. the ruby macro) contains an unmatched curly brace
215 Backticks are used to insert some symbols and should be escaped by a backslash in other contexts than inserting a special character.
217 Sequences of character you should notice:
219 Two underscores (__) followed by non-whitespace
221 Two single quotes ('') followed by non-whitespace
222 Literal text set in typewriter font
223 Two colons (::) surrounded by whitespace
224 Used in definition lists
226 Characters with special meaning if they occur at the beginning of line:
229 Headings, unordered lists
231 Anchors, commands, regions, ordered lists
235 1., a., -, *, #, @, ?, ?.
240 Although it has currently to be enabled by loading a module, there is a chance that this will become the standard delimiter for mathematical expressions typed in latex (with the AMS packages enabled). The standard markup will be either $a = x + y$ or with blanks $ a = x + y $ as the dollar sign is most likely used before or after a digit.
242 Be aware that your editors line wrap can inadvertently place these characters at the beginning of a line.
244 Example 9.1: Text styles, backslash
246 __emphasize__, WikiName
248 \__noemphasize\__, \NoWikiName
257 unnnnnnnnnnnnnnnnnn\ breakkkkkkkkkkkkkkkkkk\ ableeeeeeeeeeeeeeeeeeeeeeee
263 __noemphasize__, NoWikiName
269 unnnnnnnnnnnnnnnnnn breakkkkkkkkkkkkkkkkkk ableeeeeeeeeeeeeeeeeeeeeeee
270 9.1.4 Argument Values
272 Arguments to macros, commands, and regions:
274 * In argument values, the characters !=: and single double quotes must be preceded by a backslash
275 * Alternatively, you can enclose a value in double quotes (which will be stripped off; doublequotes must be escaped using a backslash) or parentheses (which will be retained)
276 * Argument values are stripped of whitespace; if you want an argument to contain leading or trailing whitespace, you have to enclose the argument in double quotes
278 Table 9.1: Key arguments Example Key Arguments Body
280 %%{macro: foo} {} "foo"
281 %%{macro boo!: foo} {"boo" ⇒ true} "foo"
282 %%{macro boo! bar=1: foo} {"boo" ⇒ true, "bar" ⇒ "1"} "foo"
283 %%{macro bar=object(id=1): foo} {"bar" ⇒ "object(id=1)"} "foo"
284 %%{macro bar="foo := bar": foo} {"bar" ⇒ "foo := bar"} "foo"
285 %%{macro bar=( boo=boo): foo} {"bar" ⇒ "( boo = boo)"} "foo"
286 %%{macro bar=\( boo=boo): foo} {"bar" ⇒ "(", "boo" ⇒ "boo)"} "foo"
287 %%{macro bar="(" boo=boo): foo} {"bar" ⇒ "(", "boo" ⇒ "boo)"} "foo"
289 There are two special arguments (fmt and if) that allow some control on whether an element will be included in the output. Please see 14.6 for details.
290 9.2 Comments (whole lines)
292 * The percent sign has to be first non-blank character in the line. Otherwise it’s interpreted as a character.
293 * A comment separates lines as paragraphs.
294 * For intra-paragraph comments use the comment macro 12.2
296 Example 9.2: Comments
307 A paragraph a sequence of non-empty lines that don’t match anything else.
309 Example 9.3: Paragraphs
311 Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an
312 empty line. Paragraph 1 finishes with an empty line.
314 Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with
315 an unordered list. Paragraph 2 finishes with an unordered list.
321 Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line. Paragraph 1 finishes with an empty line.
323 Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list. Paragraph 2 finishes with an unordered list.
330 NOTE: Headings can span more than one line by putting a backslash (‘\’) at the end of the line.
335 prevent the heading from being listed in the toc; as you can see from the current heading, the heading number is increased nevertheless (which probably should be considered as a bug?)
337 the display name in the table of contents
339 the display name in a minitoc; with multi-file output, this argument defines the optional file name
341 similar to shortcaption; if an id and a shortcaption are given, the id will be used for the filename and the sort caption for the mini-toc
343 Don’t add any numbering to the heading. (Set the variable headings to “plain” if you want to turn off numbering for all headings.)
345 Turn a heading into a hyperlink; this requires the hyperHeading variable(see 14.1.2) to be set
347 If you set the variable autoFileNames, deplate will derive the file name from the heading.
369 EMBEDDED VERBATIM TEXT
372 || Embedded || Table ||
377 @ There is much to say about Item A, too much to be put
378 in words or to be written down.
380 What else is there to say about Item A?
386 #B1 _ Some other task
388 #A x11-11-2050 Something was done!
389 #B1 11-11-2050 Some other task
400 EMBEDDED VERBATIM TEXT
408 1. There is much to say about Item A, too much to be put in words or to be written down.
409 What else is there to say about Item A?
416 o A 11-11-2050 Something was done!
417 o B1 11-11-2050 Some other task
419 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 9.10.
421 NOTE: If you run into troubles when nesting lists, consider the use of the list macro 12.5.
423 NOTE: Task lists are implemented as varlist in DocBook.
424 9.6 Description lists (indented)
426 Example 9.5: Description list
437 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.
439 A row containing only empty cells and cells with hyphens defines a ruler.
441 A cell containing only “^” means concatenate with the cell above. A cell containing only “<” means concatenate with the cell to the left.
443 Tables take the following options (via the OPT command):
446 The number of rows encompassing the table head
448 The number of rows encompassing the table foot
449 hiRow=N1,N2,first,last,...
450 The rows to be highlighted
451 hiCol=N1,N2,first,last,...
452 The columns to be highlighted
453 rows=ROWDEF1, ROWDEF2, ...
454 Define a row’s attributes
456 * ROWDEF has the form: KEY1.VAL1 KEY2.VAL2 ...; KEY being one of
461 * a ruler counts as a row
463 cols=COLDEF1, COLDEF2, ...
464 Define a columns’s attributes
466 * COLDEF has the form: KEY1.VAL1 KEY2.VAL2 ...; KEY being one of
471 The column’s justification (left, right, center, or justified)
473 Add a left-handed vertical ruler (the value denotes the number of rulers or its thickness)
474 o This option is currently only interpreted for LaTeX output
477 Define whether the longtable environment should be used in LaTeX output (by default, the longtable environment will be used for tables with more than 20 rows).
479 * Switching between the 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.
482 The table style (but see below)
484 Like style but ignore tableStyle
486 A short note concerning data source etc.
488 In addition, the following options for “floats” apply too:
491 In LaTeX output, add the h attribute to the table environment
492 align=[left|right|center], floatAlign=[left|right|center]
493 align the table; the first one is a table specific options, the second a global document option
495 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.)
497 It depends on the formatter whether these options are interpeted.
501 || ----------------------------- ||
502 || Head || Categories || < ||
503 | Row1 | Value1 | Value1 |
507 | Row3 | Value3 | ^ |
508 | ----------------------------- |
509 #OPT: hiCol=first hiRow=last cols=w.3cm j.right r.1, w.1cm,,r.1 rows=,h.3cm
510 #OPT: note=Source: My Head, 2004
515 Table 9.2: This Table Head Categories
519 Source: My Head, 2004
521 NOTE: Rows can span more than one line by putting a backslash (‘\’) at the end of the line.
523 NOTE: An empty cell is marked by at least 3 consecutive blanks.
525 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.
527 The following styles are known (for one or another output format):
530 Draw all table borders/rulers
532 Draw a ruler at the top and the bottom of the table, as well as between groups
534 Like formal but add vertical rulers on both sides
536 Like box but draw the background of some rows and columns in gray or in colours
538 Horizontal rulers between each row
539 small, footnotesize, scriptsize
542 decreased intercell spacing (there is a minor problem with line spacing)
544 rotate the table (LaTeX only, I assume)
546 Example 9.7: Table styles
548 #Var id=styledTableExample <<---
556 Test ''grid'' & ''scriptsize'' styles:
557 #INCLUDE var=styledTableExample
558 #OPT: style=grid,scriptsize
560 Test ''formal'' & ''footnotesize'' styles:
561 #INCLUDE var=styledTableExample
562 #OPT: style=formal,footnotesize
564 Test ''box'' & ''small'' styles:
565 #INCLUDE var=styledTableExample
566 #OPT: style=box,small
568 Test ''overlay'' style:
569 #INCLUDE var=styledTableExample
570 #OPT: style=overlay,landscape
574 Test grid & scriptsize styles:
580 Test formal & footnotesize styles:
586 Test box & small styles:
599 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.
601 The name must begin with a lower letter. There mustn’t be non-whitespace character before the sharp sign.
605 * This is section one
612 * This is section two
616 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.
619 Any word in CamelCase is turned into a wiki name – save if wikification is prevented with a backslash – see 9.1.2.
621 Any text between [- and -] will be turned into a hyperlink.
623 An extended wiki name has the form: [[DESTINATION][OPTIONAL NAME]MODIFIER].
625 * MODIFIER is optional.
628 open page in new window
632 prevents deplate from adapting the reference’s suffix
633 o 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.
634 o Often the chosen 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.
636 * If you want a hyperlink to have an image, use: [[http://www.example.com][{img: example_image}]]. See also 12.5.
639 An interwiki name is a shortcut to a different wiki. Any simple and quoted wiki name can be deferred to an interwiki by prepending 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")
641 Wiki Names are automatically marked as index entries – see 11.4 and 11.5.
643 Example 9.9: Wiki names
655 ::[-some name-]#there
658 [[destination][name]]
659 [[destination#anchor][name]]
660 [[destination.suffix]!]
661 [[::destination#anchor][name]]
667 The backtick (`) is used to introduce some symbols like quotation marks (e.g., in positions where deplate would choose the wrong one).
669 Symbols are not expanded in text marked as typewriter/code and in verbatim regions.
671 Example 9.10: Symbols
673 <-, ->, <=, =>, <~, ~>, <->, <=>, <~>, !=, ~~, ..., --, ==, ```, `'', ``, `'
681 #Code id=symbolsTest syntax=ruby <<--
687 ←, →, ⇐, ⇒, <~, ~>, ↔, ⇔, <~>, ≠, ≈, …, –, ≡, “, ”, ‘, ’
695 NOTE: If you want to disable some of these symbols, you could add some ruby code like this to your config.rb:
697 %%class Deplate::Particle::Symbol
698 %% @@symbols_table.delete_if {|k,v| ['<->', '<=>', '<~>'].include?(k)}
704 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.
706 Example 9.11: Markers
722 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.
726 Indented paragraphs that begin with a marker and a subsequent space
728 !!! Something like this.
732 Indented paragraphs that begin with a marker and a subsequent space start an annotation.
735 9.13 Strings, Smart Quotes
745 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:
747 Deplate::Particle.disable_particle(
748 Deplate::Particle::DoubleQuote,
749 Deplate::Particle::SingleQuote
754 Example 9.14: Text styles
756 __emphasize__, ''typewriter''
760 emphasize, typewriter
762 NOTE: There must not be a whitespace after the opening mark.
764 NOTE: Text in typewriter style is basically set verbatim with the expection of backslashes.
767 A break is marked by at least 2 dashes, “8<”, and again at least 2 dashes.
774 In HTML output, a break is represented by a horizontal line. In other output formates, a break actually denotes a page break.
777 A line of whitespace usually separates text elements – e.g. paragraphs,
783 %%save.image(compress=T)
787 %%fm1 <- aov(tlimth ~ sex + ethnicty + grade + disadvg, data=x)
788 %%fm1.table <- xtable(fm1)
789 %%print(fm1.table,type="html")
791 %%#CAP: An example from the xtable manual using the tli data set
796 %%#CAP: Summary of the tli data set
801 %%#CAP: Summary of the tli data set (guessing cell borders)
803 %%The same inserted verbatim: