docs/userguide/genuserguide.py
author andy_robinson
Mon, 10 Jul 2000 23:56:09 +0000
changeset 344 dd6e41c2b0ed
parent 341 27c68d524504
child 369 53a1b7bd93ff
permissions -rw-r--r--
Paragraphs chapter pretty much complete. Fancy cover.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     1
#!/bin/env python
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     2
###############################################################################
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     3
#
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
     4
#   ReportLab Public License Version 1.0
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     5
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     6
#   Except for the change of names the spirit and intention of this
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     7
#   license is the same as that of Python
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
     8
#
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
     9
#   (C) Copyright ReportLab Inc. 1998-2000.
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    10
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    11
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    12
# All Rights Reserved
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    13
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    14
# Permission to use, copy, modify, and distribute this software and its
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    15
# documentation for any purpose and without fee is hereby granted, provided
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    16
# that the above copyright notice appear in all copies and that both that
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    17
# copyright notice and this permission notice appear in supporting
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    18
# documentation, and that the name of ReportLab not be used
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    19
# in advertising or publicity pertaining to distribution of the software
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    20
# without specific, written prior permission. 
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    21
# 
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    22
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    23
# Disclaimer
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    24
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    25
# ReportLab Inc. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    26
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    27
# IN NO EVENT SHALL ReportLab BE LIABLE FOR ANY SPECIAL, INDIRECT
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    28
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    29
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    30
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    31
# PERFORMANCE OF THIS SOFTWARE. 
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    32
#
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
    33
###############################################################################
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    34
#   $Log: genuserguide.py,v $
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
    35
#   Revision 1.26  2000/07/10 23:56:09  andy_robinson
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
    36
#   Paragraphs chapter pretty much complete.  Fancy cover.
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
    37
#
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
    38
#   Revision 1.25  2000/07/10 14:20:15  andy_robinson
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
    39
#   Broke up the user guide into chapters.
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
    40
#
340
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
    41
#   Revision 1.24  2000/07/10 12:00:17  andy_robinson
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
    42
#   More work on chapter 1
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
    43
#
337
76141601ec1f Broke out chapter 1
andy_robinson
parents: 336
diff changeset
    44
#   Revision 1.23  2000/07/08 13:24:27  andy_robinson
76141601ec1f Broke out chapter 1
andy_robinson
parents: 336
diff changeset
    45
#   Broke out chapter 1
76141601ec1f Broke out chapter 1
andy_robinson
parents: 336
diff changeset
    46
#
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
    47
#   Revision 1.22  2000/07/08 12:52:25  andy_robinson
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
    48
#   Separated out actual text from genuserguide, so it can be broken into
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
    49
#   chapters.
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
    50
#
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
    51
#   Revision 1.21  2000/07/07 22:55:31  andy_robinson
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
    52
#   Added paragraph examples and widget to User Guide
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
    53
#
331
df7a5344d9e3 More on paragraphs
rgbecker
parents: 330
diff changeset
    54
#   Revision 1.20  2000/07/07 16:18:37  rgbecker
df7a5344d9e3 More on paragraphs
rgbecker
parents: 330
diff changeset
    55
#   More on paragraphs
df7a5344d9e3 More on paragraphs
rgbecker
parents: 330
diff changeset
    56
#
330
e392b1be9211 Start on Paragraph
rgbecker
parents: 328
diff changeset
    57
#   Revision 1.19  2000/07/07 15:09:21  rgbecker
e392b1be9211 Start on Paragraph
rgbecker
parents: 328
diff changeset
    58
#   Start on Paragraph
e392b1be9211 Start on Paragraph
rgbecker
parents: 328
diff changeset
    59
#
328
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
    60
#   Revision 1.18  2000/07/06 15:38:15  rgbecker
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
    61
#   Started on Tables added EmbeddedCode utility
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
    62
#
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
    63
#   Revision 1.17  2000/07/05 16:06:01  rgbecker
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
    64
#   Platypus Start
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
    65
#
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
    66
#   Revision 1.16  2000/07/04 22:22:40  andy_robinson
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
    67
#   Tidied up genuserguide.py, especially figure handling; began
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
    68
#   adding PDF special features docco
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
    69
#
318
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
    70
#   Revision 1.15  2000/07/03 16:03:31  andy_robinson
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
    71
#   Changes to heading structure
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
    72
#
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    73
#   Revision 1.14  2000/07/03 15:50:31  andy_robinson
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    74
#   Pushed down most existing lessons one level; added
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    75
#   functions heading1..heading3 for building story
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    76
#   unambiguously; spelled Hugh Hefner right!
314
72c75740504b abspath is 1.5.2 only
rgbecker
parents: 311
diff changeset
    77
#
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    78
#   Revision 1.13  2000/07/03 09:51:38  rgbecker
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    79
#   abspath is 1.5.2 only
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    80
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    81
#   Revision 1.12  2000/06/28 16:10:00  rgbecker
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    82
#   Fix unwanted 'i'
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    83
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    84
#   Revision 1.11  2000/06/28 14:52:43  rgbecker
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    85
#   Documentation changes
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    86
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    87
#   Revision 1.10  2000/06/27 10:09:48  rgbecker
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    88
#   Minor cosmetic changes
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    89
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    90
#   Revision 1.9  2000/06/23 21:09:03  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    91
#   text text and more text
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    92
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    93
#   Revision 1.8  2000/06/22 19:05:24  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    94
#   added quickhack for font changes in paragraphs and lots of new text
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    95
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    96
#   Revision 1.7  2000/06/22 13:55:59  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    97
#   showPage resets all state parameters warning.
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    98
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
    99
#   Revision 1.6  2000/06/22 13:35:28  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   100
#   textobject and pathobject methods, among other things
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   101
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   102
#   Revision 1.5  2000/06/21 21:19:29  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   103
#   colors, line styles, more examples
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   104
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   105
#   Revision 1.4  2000/06/21 15:16:05  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   106
#   Lots of graphical examples added
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   107
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   108
#   Revision 1.3  2000/06/20 20:31:42  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   109
#   typos and more examples
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   110
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   111
#   Revision 1.2  2000/06/19 21:13:02  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   112
#   2nd try. more text
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   113
#   
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   114
#   Revision 1.1  2000/06/17 02:57:56  aaron_watters
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   115
#   initial checkin. user guide generation framework.
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   116
#   
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   117
__version__=''' $Id: genuserguide.py,v 1.26 2000/07/10 23:56:09 andy_robinson Exp $ '''
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   118
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   119
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   120
__doc__ = """
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   121
This module contains the script for building the user guide.
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   122
"""
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   123
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   124
import os, sys
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   125
import string
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   126
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   127
sys.path.insert(0,os.path.join(os.path.dirname(sys.argv[0]),'..','tools'))
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   128
from rltemplate import RLDocTemplate
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   129
from stylesheet import getStyleSheet
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   130
styleSheet = getStyleSheet()
310
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   131
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   132
#from reportlab.platypus.doctemplate import SimpleDocTemplate
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   133
from reportlab.lib.units import inch
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   134
from reportlab.lib.pagesizes import letter
328
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   135
from reportlab.platypus import Paragraph, Spacer, Preformatted,\
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   136
            PageBreak, CondPageBreak, Flowable, Table, TableStyle, \
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   137
            NextPageTemplate
310
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   138
from reportlab.lib.styles import ParagraphStyle
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   139
from reportlab.lib import colors
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   140
from reportlab.lib.sequencer import getSequencer
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   141
import examples
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   142
import platdemos
328
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   143
import StringIO
318
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   144
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   145
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   146
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   147
from reportlab.lib.corp import ReportLabLogo
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   148
LOGO = ReportLabLogo(0.25*inch, 0.25*inch, inch, 0.75*inch)
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   149
301
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   150
from t_parse import Template
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   151
QFcodetemplate = Template("X$X$", "X")
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   152
QFreptemplate = Template("X^X^", "X")
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   153
codesubst = "%s<font name=Courier>%s</font>"
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   154
QFsubst = "%s<font name=Courier><i>%s</i></font>"
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   155
    
301
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   156
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   157
def quickfix(text):
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   158
    """inside text find any subsequence of form $subsequence$.
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   159
       Format the subsequence as code.  If similarly if text contains ^arg^
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   160
       format the arg as replaceable.  The escape sequence for literal
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   161
       $ is $\\$ (^ is ^\\^.
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   162
    """
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   163
    from string import join
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   164
    for (template,subst) in [(QFcodetemplate, codesubst), (QFreptemplate, QFsubst)]:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   165
        fragment = text
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   166
        parts = []
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   167
        try:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   168
            while fragment:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   169
                try:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   170
                    (matches, index) = template.PARSE(fragment)
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   171
                except: raise ValueError
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   172
                else:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   173
                    [prefix, code] = matches
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   174
                    if code == "\\":
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   175
                        part = fragment[:index]
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   176
                    else:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   177
                        part = subst % (prefix, code)
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   178
                    parts.append(part)
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   179
                    fragment = fragment[index:]
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   180
        except ValueError:
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   181
            parts.append(fragment)
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   182
        text = join(parts, "")
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   183
    return text
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   184
#print quickfix("$testing$ testing $one$ ^two^ $three(^four^)$")
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   185
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   186
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   187
310
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   188
H1 = styleSheet['Heading1']
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   189
H2 = styleSheet['Heading2']
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   190
H3 = styleSheet['Heading3']
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   191
H4 = styleSheet['Heading4']
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   192
B = styleSheet['BodyText']
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   193
BU = styleSheet['Bullet']
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   194
Comment = styleSheet['Comment']
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   195
Centred = styleSheet['Centred']
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   196
Caption = styleSheet['Caption']
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   197
318
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   198
#set up numbering
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   199
seq = getSequencer()
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   200
seq.setFormat('Chapter','1')
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   201
seq.setFormat('Section','1')
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   202
seq.setFormat('Appendix','A')
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   203
seq.setFormat('Figure', '1')
318
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   204
seq.chain('Chapter','Section')
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   205
seq.chain('Chapter','Figure')
318
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   206
03c9f114c621 Changes to heading structure
andy_robinson
parents: 317
diff changeset
   207
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   208
lessonnamestyle = H2
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   209
discussiontextstyle = B
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   210
exampletextstyle = styleSheet['Code']
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   211
# size for every example
283
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   212
examplefunctionxinches = 5.5
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   213
examplefunctionyinches = 3
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   214
examplefunctiondisplaysizes = (examplefunctionxinches*inch, examplefunctionyinches*inch)
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   215
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   216
# for testing
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   217
def NOP(*x,**y):
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   218
    return None
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   219
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   220
def CPage(inches):
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   221
    getStory().append(CondPageBreak(inches*inch))
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   222
    
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   223
def newPage():
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   224
    getStory().append(PageBreak())
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   225
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   226
def nextTemplate(templName):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   227
    f = NextPageTemplate(templName)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   228
    getStory().append(f)
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   229
    
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   230
def disc(text, klass=Paragraph, style=discussiontextstyle):
301
5ad57f31ae75 added quickhack for font changes in paragraphs and lots of new text
aaron_watters
parents: 300
diff changeset
   231
    text = quickfix(text)
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   232
    P = klass(text, style)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   233
    getStory().append(P)
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   234
340
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   235
def restartList():
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   236
    getSequencer().reset('list1')
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   237
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   238
def list(text):
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   239
    text='<bullet><seq id="list1"/>.</bullet>' + quickfix(text)
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   240
    P = Paragraph(text, BU)
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   241
    getStory().append(P)
f3f2af39e7d7 More work on chapter 1
andy_robinson
parents: 337
diff changeset
   242
    
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   243
def bullet(text):
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   244
    text='<bullet><font name="Symbol">'+chr(183)+'</font></bullet>' + quickfix(text)
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   245
    P = Paragraph(text, BU)
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   246
    getStory().append(P)
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   247
    
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   248
def eg(text):
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   249
    getStory().append(Spacer(0.1*inch, 0.1*inch))
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   250
    disc(text, klass=Preformatted, style=exampletextstyle)
328
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   251
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   252
def EmbeddedCode(code,name='t', fn='embedded.tmp'):
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   253
    eg(code)
e0122856a912 Started on Tables added EmbeddedCode utility
rgbecker
parents: 323
diff changeset
   254
    disc("produces")
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   255
    exec code+("\ngetStory().append(%s)\n"%name)
310
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   256
cbec783cfb81 Documentation changes
rgbecker
parents: 308
diff changeset
   257
def title(text):
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   258
    """Use this for the document title only"""
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   259
    disc(text,style=styleSheet['Title'])
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   260
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   261
#AR 3/7/2000 - defining three new levels of headings; code
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   262
#should be swapped over to using them.
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   263
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   264
def heading1(text):
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   265
    """Use this for chapters.  Lessons within a big chapter
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   266
    should now use heading2 instead.  Chapters get numbered."""
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   267
    getStory().append(PageBreak())
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   268
    p = Paragraph('Chapter <seq id="Chapter"/> - ' + quickfix(text), H1)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   269
    getStory().append(p)
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   270
    
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   271
def heading2(text):
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   272
    """Used to be 'lesson'"""
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   273
    getStory().append(CondPageBreak(inch))
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   274
    p = Paragraph('<seq template="%(Chapter)s.%(Section+)s - "/>' + quickfix(text), H2)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   275
    getStory().append(p)
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   276
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   277
def heading3(text):
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   278
    """Used to be most of the plain old 'head' sections"""
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   279
    getStory().append(CondPageBreak(inch))
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   280
    p = Paragraph(quickfix(text), H3)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   281
    getStory().append(p)
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   282
 
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   283
def heading4(text):
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   284
    """Used to be most of the plain old 'head' sections"""
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   285
    getStory().append(CondPageBreak(inch))
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   286
    p = Paragraph(quickfix(text), H4)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   287
    getStory().append(p)
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   288
    
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   289
def todo(text):
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   290
    """Used for notes to ourselves"""
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   291
    getStory().append(Paragraph(quickfix(text), Comment))
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   292
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   293
def centred(text):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   294
    getStory().append(Paragraph(quickfix(text), Centred))
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   295
                      
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   296
def caption(text):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   297
    getStory().append(Paragraph(quickfix(text), Caption))
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   298
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   299
class Illustration(platdemos.Figure):
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   300
    """The examples are all presented as functions which do
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   301
    something to a canvas, with a constant height and width
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   302
    used.  This puts them inside a figure box with a caption."""
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   303
    
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   304
    def __init__(self, operation, caption):
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   305
        stdwidth, stdheight = examplefunctiondisplaysizes
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   306
        #platdemos.Figure.__init__(self, stdwidth * 0.75, stdheight * 0.75)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   307
        platdemos.Figure.__init__(self, stdwidth, stdheight,
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   308
                    'Figure <seq template="%(Chapter)s-%(Figure+)s"/>: ' + quickfix(caption))
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   309
        self.operation = operation
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   310
        
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   311
    def drawFigure(self):
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   312
        #shrink it a little...
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   313
        #self.canv.scale(0.75, 0.75)
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   314
        self.operation(self.canv)
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   315
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   316
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   317
def illust(operation, caption):
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   318
    i = Illustration(operation, caption)
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   319
    getStory().append(i)
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   320
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   321
class ParaBox(platdemos.Figure):
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   322
    """Illustrates paragraph examples, with style attributes on the left"""
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   323
    descrStyle = ParagraphStyle('description',
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   324
                                fontName='Courier',
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   325
                                fontSize=8,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   326
                                leading=9.6)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   327
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   328
    def __init__(self, text, style, caption):
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   329
        platdemos.Figure.__init__(self, 0, 0, caption)
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   330
        self.text = text
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   331
        self.style = style
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   332
        self.para = Paragraph(text, style)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   333
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   334
        styleText = self.getStyleText(style)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   335
        self.pre = Preformatted(styleText, self.descrStyle)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   336
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   337
    def wrap(self, availWidth, availHeight):
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   338
        """Left 30% is for attributes, right 50% for sample,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   339
        10% gutter each side."""
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   340
        self.x0 = availWidth * 0.05  #left of box
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   341
        self.x1 = availWidth * 0.1   #left of descriptive text
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   342
        self.x2 = availWidth * 0.5   #left of para itself
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   343
        self.x3 = availWidth * 0.9   #right of para itself
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   344
        self.x4 = availWidth * 0.95  #right of box
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   345
        self.width = self.x4 - self.x0
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   346
        self.dx = 0.5 * (availWidth - self.width)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   347
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   348
        paw, self.pah = self.para.wrap(self.x3 - self.x2, availHeight)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   349
        self.pah = self.pah + self.style.spaceBefore + self.style.spaceAfter
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   350
        prw, self.prh = self.pre.wrap(self.x2 - self.x1, availHeight)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   351
        self.figureHeight = max(self.prh, self.pah) * 10.0/9.0
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   352
        return platdemos.Figure.wrap(self, availWidth, availHeight)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   353
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   354
    def getStyleText(self, style):
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   355
        """Converts style to preformatted block of text"""
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   356
        lines = []
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   357
        for (key, value) in style.__dict__.items():
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   358
            lines.append('%s = %s' % (key, value))
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   359
        lines.sort()
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   360
        return string.join(lines, '\n')        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   361
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   362
    def drawFigure(self):
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   363
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   364
        #now we fill in the bounding box and before/after boxes       
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   365
        self.canv.saveState()
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   366
        self.canv.setFillGray(0.95)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   367
        self.canv.setDash(1,3)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   368
        self.canv.rect(self.x2 - self.x0,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   369
                       self.figureHeight * 0.95 - self.pah,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   370
                       self.x3-self.x2, self.para.height,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   371
                       fill=1,stroke=1)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   372
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   373
        self.canv.setFillGray(0.90)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   374
        self.canv.rect(self.x2 - self.x0, #spaceBefore
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   375
                       self.figureHeight * 0.95 - self.pah + self.para.height,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   376
                       self.x3-self.x2, self.style.spaceBefore,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   377
                       fill=1,stroke=1)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   378
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   379
        self.canv.rect(self.x2 - self.x0, #spaceBefore
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   380
                       self.figureHeight * 0.95 - self.pah - self.style.spaceAfter,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   381
                       self.x3-self.x2, self.style.spaceAfter,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   382
                       fill=1,stroke=1)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   383
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   384
        self.canv.restoreState()
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   385
        #self.canv.setFillColor(colors.yellow)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   386
        self.para.drawOn(self.canv, self.x2 - self.x0,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   387
                         self.figureHeight * 0.95 - self.pah)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   388
        self.pre.drawOn(self.canv, self.x1 - self.x0,
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   389
                         self.figureHeight * 0.95 - self.prh)
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   390
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   391
        
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   392
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   393
    def getStyleText(self, style):
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   394
        """Converts style to preformatted block of text"""
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   395
        lines = []
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   396
        for (key, value) in style.__dict__.items():
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   397
            if key not in ('name','parent'):
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   398
                lines.append('%s = %s' % (key, value))
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   399
        return string.join(lines, '\n')
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   400
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   401
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   402
class ParaBox2(platdemos.Figure):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   403
    """Illustrates a paragraph side-by-side with the raw
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   404
    text, to show how the XML works."""
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   405
    def __init__(self, text, caption):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   406
        platdemos.Figure.__init__(self, 0, 0, caption)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   407
        descrStyle = ParagraphStyle('description',
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   408
                                fontName='Courier',
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   409
                                fontSize=8,
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   410
                                leading=9.6)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   411
        textStyle = B
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   412
        self.text = text
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   413
        self.left = Paragraph('<![CDATA[' + text + ']]>', descrStyle)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   414
        self.right = Paragraph(text, B)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   415
        
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   416
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   417
    def wrap(self, availWidth, availHeight):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   418
        self.width = availWidth * 0.9
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   419
        colWidth = 0.4 * self.width
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   420
        lw, self.lh = self.left.wrap(colWidth, availHeight)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   421
        rw, self.rh = self.right.wrap(colWidth, availHeight)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   422
        self.figureHeight = max(self.lh, self.rh) * 10.0/9.0
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   423
        return platdemos.Figure.wrap(self, availWidth, availHeight)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   424
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   425
    def drawFigure(self):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   426
        self.left.drawOn(self.canv,
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   427
                         self.width * 0.05,
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   428
                         self.figureHeight * 0.95 - self.lh
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   429
                         ) 
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   430
        self.right.drawOn(self.canv,
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   431
                         self.width * 0.55,
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   432
                         self.figureHeight * 0.95 - self.rh
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   433
                         ) 
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   434
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   435
def parabox(text, style, caption):
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   436
    p = ParaBox(text, style,
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   437
                'Figure <seq template="%(Chapter)s-%(Figure+)s"/>: ' + quickfix(caption)
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   438
                )
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   439
    getStory().append(p)
320
7a4ca2b5bb89 Tidied up genuserguide.py, especially figure handling; began
andy_robinson
parents: 318
diff changeset
   440
    
344
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   441
def parabox2(text, caption):
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   442
    p = ParaBox2(text, 
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   443
                'Figure <seq template="%(Chapter)s-%(Figure+)s"/>: ' + quickfix(caption)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   444
                )
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   445
    getStory().append(p)
dd6e41c2b0ed Paragraphs chapter pretty much complete. Fancy cover.
andy_robinson
parents: 341
diff changeset
   446
296
a5e584b6d61b Lots of graphical examples added
aaron_watters
parents: 293
diff changeset
   447
def pencilnote():
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   448
    getStory().append(examples.NoteAnnotation())
296
a5e584b6d61b Lots of graphical examples added
aaron_watters
parents: 293
diff changeset
   449
        
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   450
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   451
#make a singleton, created when requested rather
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   452
#than each time a chapter imports it.
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   453
_story = None
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   454
def getStory():
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   455
    global _story
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   456
    if _story is None:
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   457
        _story = []
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   458
    return _story
283
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   459
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   460
        
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   461
def run():
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   462
    doc = RLDocTemplate('userguide.pdf',pagesize = letter)
283
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   463
50f6c1be3e51 2nd try. more text
aaron_watters
parents: 273
diff changeset
   464
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   465
    #this builds the story    
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   466
    #resetStory()
323
5795e28c5910 Platypus Start
rgbecker
parents: 320
diff changeset
   467
337
76141601ec1f Broke out chapter 1
andy_robinson
parents: 336
diff changeset
   468
    import ch1_intro
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   469
    import ch2_graphics
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   470
    import ch3_pdffeatures
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   471
    import ch4_platypus_concepts
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   472
    import ch5_paragraphs
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   473
    import ch6_tables
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   474
    import ch7_custom
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   475
    import ch8_future
337
76141601ec1f Broke out chapter 1
andy_robinson
parents: 336
diff changeset
   476
    
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   477
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   478
    # I don't know WHAT is going on here.
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   479
    # the submodules all do 'import *',
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   480
    # and the story they have access to
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   481
    # contains it all; but the one defined
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   482
    # in this module seems to be empty.
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   483
    #if I just call getStory, it has no
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   484
    #items!
334
6f9c206a34c0 Added paragraph examples and widget to User Guide
andy_robinson
parents: 331
diff changeset
   485
    
341
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   486
    story = ch8_future.getStory()
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   487
    print 'Built story contains %d flowables...' % len(story)
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   488
    doc.build(story)
27c68d524504 Broke up the user guide into chapters.
andy_robinson
parents: 340
diff changeset
   489
    print 'Saved userguide.pdf'
317
fce6dad947c3 Pushed down most existing lessons one level; added
andy_robinson
parents: 314
diff changeset
   490
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   491
    
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   492
    
273
cd705b27b6a5 initial checkin. user guide generation framework.
aaron_watters
parents:
diff changeset
   493
if __name__=="__main__":
336
c0fcae4341cf Separated out actual text from genuserguide, so it can be broken into
andy_robinson
parents: 334
diff changeset
   494
    run()