Next / Previous / Contents / Shipman's homepage

6.3. Manifest constants

docbook5index
# - - - - -   M a n i f e s t   c o n s t a n t s

Names of constants are capitalized.

6.3.1. DB5_NS

The DocBook 5.0 namespace URI.

docbook5index
DB5_NS = 'http://docbook.org/ns/docbook'

6.3.2. XML_NS

The XML namespace, used for standard attributes such as “id”.

docbook5index
XML_NS = 'http://www.w3.org/XML/1998/namespace'

6.3.3. nsWrap: Namespace-wrap function

This function combines a namespace URI and a local name to return a fully qualified name.

docbook5index
def nsWrap(ns, local):
    '''Combine an NSURI and a local name.
    '''
    return '{{{0}}}{1}'.format(ns, local)

6.3.4. dbWrap(): Wrap a DocBook name

Given a DocBook 5 local name, returns the fully qualified name.

docbook5index
def dbWrap(local):
    '''Convert a DocBook 5 name to a QName.
    '''
    return nsWrap(DB5_NS, local)

6.3.5. xmlWrap(): Wrap an XML name

Given an XML name, returns it wrapped in the XML namespace.

docbook5index
def xmlWrap(local):
    '''Convert an XML name to a QName.
    '''
    return nsWrap(XML_NS, local)

6.3.6. NS_MAP: Namespace prefix map

This dictionary relates namespace prefixes to the corresponding namespace URIs. It is used by various lxml functions to find elements and attributes in specific namespaces.

docbook5index
NS_MAP = { 'db': DB5_NS,  'xml': XML_NS }

6.3.7. SECTIONING_NODES

This is an XPath expression describing all the nodes that section a document.

docbook5index
SECTIONING_NODES = "db:chapter|db:section|db:sect1|db:sect2|db:sect3"

6.3.8. OUT_FILE_NAME

Name of the output file.

docbook5index
OUT_FILE_NAME = "toc.fo"

6.3.9. ODD_MASTER

Name of the simple-master for odd-numbered pages.

docbook5index
ODD_MASTER = "odd-master"

6.3.10. EVEN_MASTER

Name of the simple-master for even-numbered pages.

docbook5index
EVEN_MASTER = "even-master"

6.3.11. REPEAT_MASTER

Name of the page-sequence-master used for the main flow.

docbook5index
REPEAT_MASTER = "repeat-master"

6.3.12. ODD_BEFORE

Name of the header region on odd-numbered pages.

docbook5index
ODD_BEFORE = "odd-before"

6.3.13. EVEN_BEFORE

Name of the header region on even-numbered pages.

docbook5index
EVEN_BEFORE = "even-before"

6.3.14. WIDE_MARGIN

Width of the margin on the binding side of the page. To save paper, this is just wide enough to clear a standard 3-hole punch with about a pica to spare.

docbook5index
WIDE_MARGIN = "4pc"

6.3.15. NARROW_MARGIN

Width of the margins not on the binding side. Tight, to save paper.

docbook5index
NARROW_MARGIN = "3pc"

6.3.16. HEADING_EXTENT

Height of the page heading and a little more space.

docbook5index
HEADING_EXTENT = "18pt"

6.3.17. GUTTER_WIDE

Separation between the columns.

docbook5index
GUTTER_WIDE = "18pt"

6.3.18. REGION_BODY_PROPS

This dictionary specifies assorted properties on the XSL-FO region-body: two columns with a small separation.

docbook5index
REGION_BODY_PROPS = h.dash(columnCount='2', columnGap=GUTTER_WIDE)

6.3.19. PRE_TITLE

Gap between the end of the ID and the beginning of the section title in a report block.

docbook5index
PRE_TITLE = h.FoDim("1.5", "pc")

6.3.20. INDENT_PER_LEVEL

How much each section level is indented in the report. We use an instance of the FoDim class from the fohelpers module, because such instances support arithmetic operations that make it easy to insert computed dimensions into the output.

docbook5index
INDENT_PER_LEVEL = h.FoDim("1", "pc")

6.3.21. CONTINUED_INDENT

For those cases where the title is so long that it wraps, this dimension specifies how much further the continuation lines are indented relative to the start of the first line.

docbook5index
CONTINUED_INDENT = h.FoDim("8", "pc")

6.3.22. MAIN_FONT_FAMILY

Font families can be a comma-separated list; the output toolchain will use the first one it finds.

docbook5index
MAIN_FONT_FAMILY = "Palatino, Palladio, serif"

6.3.23. APP_FONT_FAMILY

Font family for rendering a DocBook application tag, which is to be rendered as oblique sans in the TCC standard.

docbook5index
APP_FONT_FAMILY = "Deja Vu Sans, Helvetica, sans-serif"

6.3.24. MONO_FONT_FAMILY

docbook5index
MONO_FONT_FAMILY = "Lucida Typewriter, monospace"

6.3.25. HEAD_SIZE

Size of the heading font.

docbook5index
HEAD_SIZE = "12pt"

6.3.26. BODY_SIZE

General font size.

docbook5index
BODY_SIZE = "9pt"

6.3.27. HEAD_FONT

Dictionary of font attributes for the header.

docbook5index
HEAD_FONT = h.font(fontFamily=MAIN_FONT_FAMILY, fontSize=HEAD_SIZE)

6.3.28. BODY_FONT

docbook5index
BODY_FONT = h.font(fontFamily=MAIN_FONT_FAMILY, fontSize=BODY_SIZE)

6.3.29. APP_FONT

Font for rendering DocBook application elements. No fontSize is specified, because this tag may be rendered in the header as well as the body.

docbook5index
APP_FONT = h.font(fontFamily=APP_FONT_FAMILY, fontStyle='oblique')

6.3.30. REPLACE_FONT

This font is used in FO inlines to render the DocBook replaceable element, which marks up its content as oblique (slanted) type.

docbook5index
REPLACE_FONT = h.font(fontStyle="oblique")

6.3.31. ID_FONT

For rendering the section id: a bold monospaced font.

docbook5index
ID_FONT = h.font(fontFamily=MONO_FONT_FAMILY, fontSize=BODY_SIZE,
                   fontWeight="bold")

6.3.32. MONO_FONT

For rendering DocBook code, userinput, and filename elements in title text: a regular-weight, monospaced font.

docbook5index
MONO_FONT = h.font(fontFamily=MONO_FONT_FAMILY)

6.3.33. MARKUP_MAP

The purpose of this dictionary is to convert names of markup tags that appear in titles to XSL-FO fonts.

docbook5index
MARKUP_MAP = {
    "application":  APP_FONT,
    "replaceable":  REPLACE_FONT,
    "code":         MONO_FONT,
    "filename":     MONO_FONT,
    "userinput":    MONO_FONT }