Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Ben-Kiki O.YAML ain't markup language.V1.1.pdf
Скачиваний:
7
Добавлен:
23.08.2013
Размер:
1.06 Mб
Скачать

Syntax

If the following line is empty line, the generic line break is ignored.

[83] b-l-folded-trimmed(n,s) ::= b-ignored-generic l-empty(n,s)+

Thus, a folded non-empty line may end with one of three possible folded line break forms. The original form of such a folded line break is a presentation detail and must not be used to convey node's content information.

[84] b-l-folded-any(n,s) ::=

b-l-folded-specific(n,s)

 

| b-l-folded-as-space

 

| b-l-folded-trimmed(n,s)

Example 4.23. Line Folding

 

>-

%YAML 1.1

specific

--- !!str

trimmed

"specific\L\

··

trimmed\n\n\n\

as space"

·

 

Legend:

as

b-l-folded-specific(n,s)

space

b-l-folded-as-space

b-l-folded-trimmed(n,s)

 

The above rules are common to both the folded block style and the scalar flow styles. Folding does distinguish between the folded block style and the scalar flow styles in the following way:

Block Folding

In the folded block style, folding does not apply to line breaks or empty lines that preced or follow a

 

text line containing leading white space. Note that such a line may consist of only such leading white

 

space; an empty block line is confined to (optional) indentation spaces only. Further, the final line

 

break and empty lines are subject to chomping, and are never folded. The combined effect of these

 

rules is that each “paragraph” is interpreted as a line, empty lines are used to present a line feed, the

 

formatting of “more indented” lines is preserved, and final line breaks may be included or excluded

 

from the node's content information as appropriate.

Flow Folding

Folding in flow styles provides more relaxed, less powerful semantics. Flow styles typically depend

 

on explicit indicators to convey structure, rather than indentation. Hence, in flow styles, spaces preceding

 

or following the text in a line are a presentation detail and must not be considered a part of the node's

 

content information. Once all such spaces have been discarded, folding proceeds as described above.

 

In contrast with the block folded style, all line breaks are folded, without exception, and a line consisting

 

only of spaces is considered to be an empty line, regardless of the number of spaces. The combined

 

effect of these processing rules is that each “paragraph” is interpreted as a line, empty lines are used

 

to present a line feed, and text can be freely “more indented” without affecting the node's content in-

 

formation.

4.3. YAML Character Stream

A YAML character stream may contain several YAML documents, denoted by document boundary markers. Each document presents a single independent root node and may be preceded by a series of directives.

36

XSLFO

RenderX

Соседние файлы в предмете Электротехника