aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/tools/docmaker/tohtml.py
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/src/tools/docmaker/tohtml.py')
-rw-r--r--freetype/src/tools/docmaker/tohtml.py35
1 files changed, 4 insertions, 31 deletions
diff --git a/freetype/src/tools/docmaker/tohtml.py b/freetype/src/tools/docmaker/tohtml.py
index fffa12097..7944f1c99 100644
--- a/freetype/src/tools/docmaker/tohtml.py
+++ b/freetype/src/tools/docmaker/tohtml.py
@@ -1,4 +1,4 @@
-# ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008
+# ToHTML (c) 2002, 2003, 2005-2008, 2013
# David Turner <david@freetype.org>
from sources import *
@@ -175,25 +175,6 @@ def html_quote( line ):
return result
-# same as 'html_quote', but ignores left and right brackets
-def html_quote0( line ):
- return string.replace( line, "&", "&amp;" )
-
-
-def dump_html_code( lines, prefix = "" ):
- # clean the last empty lines
- l = len( self.lines )
- while l > 0 and string.strip( self.lines[l - 1] ) == "":
- l = l - 1
-
- # The code footer should be directly appended to the last code
- # line to avoid an additional blank line.
- print prefix + code_header,
- for line in self.lines[0 : l + 1]:
- print '\n' + prefix + html_quote( line ),
- print prefix + code_footer,
-
-
class HtmlFormatter( Formatter ):
@@ -242,16 +223,6 @@ class HtmlFormatter( Formatter ):
def make_block_url( self, block ):
return self.make_section_url( block.section ) + "#" + block.name
- def make_html_words( self, words ):
- """ convert a series of simple words into some HTML text """
- line = ""
- if words:
- line = html_quote( words[0] )
- for w in words[1:]:
- line = line + " " + html_quote( w )
-
- return line
-
def make_html_word( self, word ):
"""analyze a simple word to detect cross-references and styling"""
# look for cross-references
@@ -291,6 +262,8 @@ class HtmlFormatter( Formatter ):
line = self.make_html_word( words[0] )
for word in words[1:]:
line = line + " " + self.make_html_word( word )
+ # handle hyperlinks
+ line = re_url.sub( r'<a href="\1">\1</a>', line )
# convert `...' quotations into real left and right single quotes
line = re.sub( r"(^|\W)`(.*?)'(\W|$)", \
r'\1&lsquo;\2&rsquo;\3', \
@@ -549,7 +522,7 @@ class HtmlFormatter( Formatter ):
if block.source.filename.find( f ) >= 0:
header = self.headers[f] + ' (' + f + ')'
break;
-
+
# if not header:
# sys.stderr.write( \
# 'WARNING: No header macro for ' + block.source.filename + '.\n' )