Package docutils :: Package transforms :: Module frontmatter :: Class DocInfo
[show private | hide private]
[frames | no frames]

Class DocInfo

Transform --+
            |
           DocInfo


This transform is specific to the reStructuredText_ markup syntax;
see "Bibliographic Fields" in the `reStructuredText Markup
Specification`_ for a high-level description. This transform
should be run *after* the `DocTitle` transform.

Given a field list as the first non-comment element after the
document title and subtitle (if present), registered bibliographic
field names are transformed to the corresponding DTD elements,
becoming child elements of the "docinfo" element (except for a
dedication and/or an abstract, which become "topic" elements after
"docinfo").

For example, given this document fragment after parsing::

    <document>
        <title>
            Document Title
        <field_list>
            <field>
                <field_name>
                    Author
                <field_body>
                    <paragraph>
                        A. Name
            <field>
                <field_name>
                    Status
                <field_body>
                    <paragraph>
                        $RCSfile: frontmatter.py,v $
        ...

After running the bibliographic field list transform, the
resulting document tree would look like this::

    <document>
        <title>
            Document Title
        <docinfo>
            <author>
                A. Name
            <status>
                frontmatter.py
        ...

The "Status" field contained an expanded RCS keyword, which is
normally (but optionally) cleaned up by the transform. The sole
contents of the field body must be a paragraph containing an
expanded RCS keyword of the form "$keyword: expansion text $". Any
RCS keyword can be processed in any bibliographic field. The
dollar signs and leading RCS keyword name are removed. Extra
processing is done for the following RCS keywords:

- "RCSfile" expands to the name of the file in the RCS or CVS
  repository, which is the name of the source file with a ",v"
  suffix appended. The transform will remove the ",v" suffix.

- "Date" expands to the format "YYYY/MM/DD hh:mm:ss" (in the UTC
  time zone). The RCS Keywords transform will extract just the
  date itself and transform it to an ISO 8601 format date, as in
  "2000-12-31".

  (Since the source file for this text is itself stored under CVS,
  we can't show an example of the "Date" RCS keyword because we
  can't prevent any RCS keywords used in this explanation from
  being expanded. Only the "RCSfile" keyword is stable; its
  expansion text changes only if the file name changes.)

Method Summary
  apply(self)
Override to apply the transform to the document tree.
  authors_from_bullet_list(self, field)
  authors_from_one_paragraph(self, field)
  authors_from_paragraphs(self, field)
  check_compound_biblio_field(self, field, name)
  check_empty_biblio_field(self, field, name)
  extract_authors(self, field, name, docinfo)
  extract_bibliographic(self, field_list)
    Inherited from Transform
  __init__(self, document, startnode)
Initial setup for in-place document transforms.

Class Variable Summary
dict biblio_nodes = {'status': <class docutils.nodes.status a...
int default_priority = 340                                                                   
list rcs_keyword_substitutions = [(<_sre.SRE_Pattern object a...

Method Details

apply(self)

Override to apply the transform to the document tree.
Overrides:
docutils.transforms.Transform.apply (inherited documentation)

Class Variable Details

biblio_nodes

Type:
dict
Value:
{'abstract': <class docutils.nodes.topic at 0x82d7254>,
 'address': <class docutils.nodes.address at 0x82c02f4>,
 'author': <class docutils.nodes.author at 0x82c3efc>,
 'authors': <class docutils.nodes.authors at 0x82c9504>,
 'contact': <class docutils.nodes.contact at 0x82c275c>,
 'copyright': <class docutils.nodes.copyright at 0x82c102c>,
 'date': <class docutils.nodes.date at 0x82c0f3c>,
 'dedication': <class docutils.nodes.topic at 0x82d7254>,
...                                                                    

default_priority

Type:
int
Value:
340                                                                   

rcs_keyword_substitutions

Type:
list
Value:
[(<_sre.SRE_Pattern object at 0x83d7b10>, '\\1-\\2-\\3'),
 (<_sre.SRE_Pattern object at 0x83d7c00>, '\\1'),
 (<_sre.SRE_Pattern object at 0x83d7c90>, '\\1')]                      

Generated by Epydoc 2.0 on Tue Jul 22 05:30:54 2003 http://epydoc.sf.net