[Zope-Checkins] CVS: Zope2 - DocumentClass.py:1.5.6.3 HTMLClass.py:1.4.6.2 HTMLWithImages.py:1.2.6.1 MML.py:1.3.124.1 StructuredText.py:1.30.4.5
Brian Lloyd
brian@digicool.com
Fri, 30 Mar 2001 15:18:03 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/StructuredText
In directory korak:/home/brian/temp/build/bin-231/lib/python/StructuredText
Modified Files:
Tag: zope-2_3-branch
DocumentClass.py HTMLClass.py HTMLWithImages.py MML.py
StructuredText.py
Log Message:
fix missed merges
--- Updated File DocumentClass.py in package Zope2 --
--- DocumentClass.py 2001/03/14 19:17:50 1.5.6.2
+++ DocumentClass.py 2001/03/30 20:17:32 1.5.6.3
@@ -230,7 +230,7 @@
"""
row is a list of tuples, where each tuple is
the raw text for a cell/column and the span
- of that cell/column".
+ of that cell/column.
EX
[('this is column one',1), ('this is column two',1)]
"""
@@ -338,6 +338,8 @@
class StructuredTextLink(StructuredTextMarkup): pass
+class StructuredTextXref(StructuredTextMarkup): pass
+
class DocumentClass:
"""
Class instance calls [ex.=> x()] require a structured text
@@ -368,7 +370,8 @@
'doc_strong',
'doc_emphasize',
'doc_literal',
- 'doc_sgml'
+ 'doc_sgml',
+ 'doc_xref',
]
def __call__(self, doc):
@@ -976,3 +979,18 @@
start,end = r.span()
text = s[start:end]
return (StructuredTextSGML(text),start,end)
+
+
+ def doc_xref(self, s,
+ expr = re.compile('\[([a-zA-Z0-9\-.:/;,\n\~]+)\]').search
+ ):
+ r = expr(s)
+ if r:
+ start, end = r.span(1)
+ return (StructuredTextXref(s[start:end]), start-1, end+1)
+ else:
+ return None
+
+
+
+
--- Updated File HTMLClass.py in package Zope2 --
--- HTMLClass.py 2001/01/24 16:51:48 1.4.6.1
+++ HTMLClass.py 2001/03/30 20:17:32 1.4.6.2
@@ -267,6 +267,10 @@
def sgml(self,doc,level,output):
for c in doc.getChildNodes():
getattr(self, self.element_types[c.getNodeName()])(c, level, output)
+
+ def xref(self, doc, level, output):
+ val = doc.getNodeValue()
+ output('<a href="#%s">[%s]</a>' % (val, val) )
def table(self,doc,level,output):
"""
--- Updated File HTMLWithImages.py in package Zope2 --
--- HTMLWithImages.py 2001/01/04 15:01:59 1.2
+++ HTMLWithImages.py 2001/03/30 20:17:35 1.2.6.1
@@ -109,21 +109,16 @@
output('</body>\n')
output('</html>\n')
-
def image(self, doc, level, output):
- output('<img src="%s" alt="%s">' % (doc.href, doc.getNodeValue()))
-
-
- def image(self, doc, level, output):
if hasattr(doc, 'key'):
- output('<a name="%s"></a>\n<img src="%s" alt="%s">' % (doc.key, doc.href, doc.getNodeValue()))
- else:
- output('<img src="%s" alt="%s">' % (doc.href, doc.getNodeValue()))
-
+ output('<a name="%s"></a>\n' % doc.key)
+ output('<img src="%s" alt="%s">\n' % (doc.href, doc.getNodeValue()))
+ if doc.getNodeValue() and hasattr(doc, 'key'):
+ output('<p><b>Figure %s</b> %s</p>\n' % (doc.key, doc.getNodeValue()))
def xref(self, doc, level, output):
val = doc.getNodeValue()
- output('<a href="#%s">%s</a>' % (val, val) )
+ output('<a href="#%s">Figure %s</a>' % (val, val) )
--- Updated File MML.py in package Zope2 --
--- MML.py 1999/03/10 00:15:46 1.3
+++ MML.py 2001/03/30 20:17:39 1.3.124.1
@@ -82,8 +82,6 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
-'''
-$Id$'''
from StructuredText import * # :-)
--- Updated File StructuredText.py in package Zope2 --
--- StructuredText.py 2001/03/07 21:35:12 1.30.4.4
+++ StructuredText.py 2001/03/30 20:17:44 1.30.4.5
@@ -203,57 +203,7 @@
</TR>
</TABLE>
-
-$Id$'''
-# Copyright
-#
-# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
-# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
-# rights reserved. Copyright in this software is owned by DCLC,
-# unless otherwise indicated. Permission to use, copy and
-# distribute this software is hereby granted, provided that the
-# above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear. Note that
-# any product, process or technology described in this software
-# may be the subject of other Intellectual Property rights
-# reserved by Digital Creations, L.C. and are not licensed
-# hereunder.
-#
-# Trademarks
-#
-# Digital Creations & DCLC, are trademarks of Digital Creations, L.C..
-# All other trademarks are owned by their respective companies.
-#
-# No Warranty
-#
-# The software is provided "as is" without warranty of any kind,
-# either express or implied, including, but not limited to, the
-# implied warranties of merchantability, fitness for a particular
-# purpose, or non-infringement. This software could include
-# technical inaccuracies or typographical errors. Changes are
-# periodically made to the software; these changes will be
-# incorporated in new editions of the software. DCLC may make
-# improvements and/or changes in this software at any time
-# without notice.
-#
-# Limitation Of Liability
-#
-# In no event will DCLC be liable for direct, indirect, special,
-# incidental, economic, cover, or consequential damages arising
-# out of the use of or inability to use this software even if
-# advised of the possibility of such damages. Some states do not
-# allow the exclusion or limitation of implied warranties or
-# limitation of liability for incidental or consequential
-# damages, so the above limitation or exclusion may not apply to
-# you.
-#
-#
-# If you have questions regarding this software,
-# contact:
-#
-# Jim Fulton, jim@digicool.com
-#
-# (540) 371-6909
+'''
import ts_regex, regex
from ts_regex import gsub