manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.23.2.2 Usage

Variable: *sdocbook->stexi-rules*

Variable: *sdocbook-block-commands*

Function: sdocbook-flatten sdocbook

"Flatten" a fragment of sdocbook so that block elements do not nest inside each other.

Docbook is a nested format, where e.g. a refsect2 normally appears inside a refsect1. Logical divisions in the document are represented via the tree topology; a refsect2 element contains all of the elements in its section.

On the contrary, texinfo is a flat format, in which sections are marked off by standalone section headers like @subsection, and block elements do not nest inside each other.

This function takes a nested sdocbook fragment sdocbook and flattens all of the sections, such that e.g.

 (refsect1 (refsect2 (para "Hello")))

becomes

 ((refsect1) (refsect2) (para "Hello"))

Oftentimes (always?) sectioning elements have <title> as their first element child; users interested in processing the refsect* elements into proper sectioning elements like chapter might be interested in replace-titles and filter-empty-elements. See replace-titles, and filter-empty-elements.

Returns a nodeset; that is to say, an untagged list of stexi elements. See section SXPath, for the definition of a nodeset.

Function: filter-empty-elements sdocbook

Filters out empty elements in an sdocbook nodeset. Mostly useful after running sdocbook-flatten.

Function: replace-titles sdocbook-fragment

Iterate over the sdocbook nodeset sdocbook-fragment, transforming contiguous refsect and title elements into the appropriate texinfo sectioning command. Most useful after having run sdocbook-flatten.

For example:

 (replace-titles '((refsect1) (title "Foo") (para "Bar.")))
    ⇒ '((chapter "Foo") (para "Bar."))

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 20, 2013 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.