Logo Search packages:      
Sourcecode: calibre version File versions

calibre::ebooks::rtf2xml::fields_large::FieldsLarge Class Reference

List of all members.

Detailed Description

Make tags for fields.
-Fields reflect text that Microsoft Word automatically generates.
-Each file contains (or should contain) an inner group called field instructions.
-Fields can be nested.
1. As soon as a field is found, make a new text string by appending an empty text string to the field list. Collect all the lines in this string until the field instructions are found.
2. Collect all the tokens and text in the field instructions. When the end of the field instructions is found, process the string of text with the field_strings module. Append the processed string to the field instructins list.
3. Continue collecting tokens. Check for paragraphs or sections. If either is found, add to the paragraph or section list.
4. Continue collecting tokens and text either the beginning of a new field is found, or the end of this field is found.
5. If a new field is found, repeat steps 1-3.
6. If the end of the field is found, process the last text string of the field list.
7. If the field list is empty (after removing the last text string), there are no more fields. Print out the final string. If the list contains other strings, add the processed string to the last string in the field list.
This line of RTF:
    {\field{\*\fldinst { CREATEDATE  \\* MERGEFORMAT }}{\fldrslt {
    \lang1024 1/11/03 10:34 PM}}}
    <field type = "insert-time">
        10:34 PM
The simple field in the above example conatins no paragraph or sections breaks.
This line of RTF:
    {{\field{\*\fldinst SYMBOL 97 \\f "Symbol" \\s 12}{\fldrslt\f3\fs24}}}
    <para><inline font-size="18"><inline font-style="Symbol">&#x03A7;</inline></inline></para>
    The RTF in the example above should be represented as UTF-8 rather than a field.
This RTF:
    {\field\fldedit{\*\fldinst { TOC \\o "1-3" }}{\fldrslt {\lang1024
    Heading one\tab }{\field{\*\fldinst {\lang1024  PAGEREF _Toc440880424
    \\h }{\lang1024 {\*\datafield
    {\lang1024 1}}}{\lang1024 \par }\pard\plain
    \f4\lang1033\cgrid {\lang1024 Heading 2\tab }{\field{\*\fldinst
    {\lang1024  PAGEREF _Toc440880425 \\h }{\lang1024 {\*\datafield
    {\lang1024 1}}}{\lang1024 \par }\pard\plain
    \f4\lang1033\cgrid }}\pard\plain
    \f4\lang1033\cgrid {\fs28 \u214\'85 \par }{\fs36 {\field{\*\fldinst
    SYMBOL 67 \\f "Symbol" \\s 18}{\fldrslt\f3\fs36}}}
    <field-block type="table-of-contents">
    <paragraph-definition language="1033" nest-level="0"
    font-style="Times" name="toc 1" adjust-right="true"
    <para><inline language="1024">Heading one&#x009;</inline><field
    type="reference-to-page" ref="_Toc440880424"><inline
    <paragraph-definition language="1033" nest-level="0" left-indent="12"
    font-style="Times" name="toc 2" adjust-right="true"
    <para><inline language="1024">Heading 2&#x009;</inline><field
    type="reference-to-page" ref="_Toc440880425"><inline

Definition at line 20 of file fields_large.py.

Public Member Functions

def __init__
def fix_fields

Private Member Functions

def __before_body_func
def __end_field_func
def __field_instruction_func
def __found_field_func
def __found_field_instruction_func
def __in_body_func
def __in_field_func
def __initiate_values
def __par_in_field_func
def __sec_in_field_func
def __write_field_string

Private Attributes


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index