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

AsciiDoc User Guide

Block macro definition.

<pattern>=+<name>

System macro definition.

<pattern>

Delete the existing macro with this <pattern>.

<pattern> is a Python regular expression and <name> is the name of a markup template. If <name> is omitted then it is the value of the regular expression match group name.

Here's what happens during macro substitution

Each contextually relevant macro pattern from the [macros] section is matched against the input source line.

If a match is found the text to be substituted is loaded from a configuration markup template section named like <name>-inlinemacro or <name>-blockmacro (depending on the macro type).

Global and macro attribute list attributes are substituted in the macro's markup template.

The substituted template replaces the macro reference in the output document.

Tables

Tables are the most complex AsciiDoc elements and this section is quite long. 3

Note

AsciiDoc generates nice HTML tables, but the current crop of DocBook toolchains render tables with varying degrees of success. Use tables only when really necessary.

Example Tables

The following annotated examples are all you'll need to start creating your own tables.

The only non-obvious thing you'll need to remember are the column stop characters:

Backtick (`) — align left.

Single quote (') — align right.

Period (.) — align center.

3The current table syntax is overly complicated and unwieldy to edit, hopefully a more usable syntax will appear in future versions of AsciiDoc.

40

AsciiDoc User Guide

Simple table:

`---`---

1

2

 

3

4

 

5

6

 

--------

Output:

 

 

 

1

2

 

3

4

 

5

6

 

 

 

 

Table with title, header and footer:

.An example table [grid="all"]

'---------

.--------------

Column 1

Column 2

-------------------------

1Item 1

2Item 2

3Item 3

-------------------------

6 Three items

-------------------------

Output:

Table 2. An example table

Column 1

Column 2

 

 

1

Item 1

 

 

2

Item 2

 

 

3

Item 3

 

 

6

Three items

 

 

Four columns totaling 15% of the pagewidth, CSV data:

[frame="all"]

````~15

1,2,3,4

a,b,c,d

A,B,C,D

~~~~~~~~

Output:

1

2

3

4

a

b

c

d

 

 

 

 

41