Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Rackham S.AsciiDoc user guide Rev7.1.2.2006.pdf
Скачиваний:
19
Добавлен:
23.08.2013
Размер:
298.24 Кб
Скачать

AsciiDoc User Guide

When a block element is encountered asciidoc(1) determines the type of block by checking in the following order (first to last): (section) Titles, BlockMacros, Lists, DelimitedBlocks, Tables, AttributeEntrys, AttributeLists, BlockTitles, Paragraphs.

The default paragraph definition [paradef-default] is last element to be checked.

Knowing the parsing order will help you devise unambiguous macro, list and block syntax rules.

Inline substitutions within block elements are performed in the following default order:

1.Special characters

2.Quotes

3.Special words

4.Replacements

5.Attributes

6.Inline Macros

The substitutions and substitution order performed on Title, Paragraph and DelimitedBlock elements is determined by configuration file parameters.

Text Formatting

Quoted Text

Words and phrases can be formatted by enclosing inline text with quote characters:

Emphasized text

Word phrases 'enclosed in single quote characters' (acute accents) are emphasized.

Strong text

Word phrases *enclosed in asterisk characters* are rendered in a strong font (usually bold).

Monospaced text

Word phrases `enclosed in backtick characters` (grave accents) are rendered in a monospaced font.

“Quoted text”

Phrases ``enclosed in double grave accents to the left and double acute accents to the right'' are enclosed with quotation marks.

Unquoted text

Placing ##double hashes around text## does nothing, it is a mechanism to allow inline attributes to be applied to otherwise unformatted text (see example below).

Quoted text properties

13

AsciiDoc User Guide

Quoted text must not be flanked by alphanumeric characters.

Quoting cannot be overlapped.

Different quoting types can be nested.

To suppress quoted text formatting place a backslash character immediately in front of the leading quote character(s). In the case of ambiguity between escaped and non-escaped text you will need to escape both leading and trailing quotes, in the case of multi-character quotes you may even need to escape individual characters.

Quoted text can be prefixed with an attribute list. Currently the only use made of this feature is to allow the font color, background color and size to be specified (XHTML/HTML only, not DocBook) using the first three positional attribute arguments. The first argument is the text color; the second the background color; the third is the font size. Colors are valid CSS colors and the font size is a number which treated as em units. Here are some examples:

[red]##Red text##.

[,yellow]*bold text on a yellow background*. [blue,#b0e0e6]`Monospaced blue text on a light blue background` [,,2]##Double sized text##.

New quotes can be defined by editing asciidoc(1) configuration files. See the Configuration Files section for details.

Inline Passthroughs

This special text quoting mechanism passes inline text to the output document without the usual substitutions. There are two flavors:

+++Triple-plus passthrough+++

No change is made to the quoted text, it is passed verbatim to the output document.

$$Double-dollar passthrough$$

Special characters are escaped but no other changes are made. This passthrough can be prefixed with inline attributes.

Superscripts and Subscripts

Put carets on either side of the text to be superscripted, put tildes on either side of text to be subscripted. For example, the following line:

e^{amp}#960;i^+1 = 0. H~2~O and x^10^. Some ^super text^ and ~some sub text~

Is rendered like:

e#i+1 = 0. H2O and x10. Some super text and some sub text

If you want to display caret (^) or tilde (~) characters you need to ensure only one per line otherwise

14