diff options
Diffstat (limited to 'src/3rdparty/freetype/src/tools/docmaker')
-rw-r--r-- | src/3rdparty/freetype/src/tools/docmaker/content.py | 14 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/tools/docmaker/sources.py | 10 | ||||
-rw-r--r-- | src/3rdparty/freetype/src/tools/docmaker/tohtml.py | 106 |
3 files changed, 99 insertions, 31 deletions
diff --git a/src/3rdparty/freetype/src/tools/docmaker/content.py b/src/3rdparty/freetype/src/tools/docmaker/content.py index c10a4edb8..0d76d19de 100644 --- a/src/3rdparty/freetype/src/tools/docmaker/content.py +++ b/src/3rdparty/freetype/src/tools/docmaker/content.py @@ -1,4 +1,5 @@ -# Content (c) 2002, 2004, 2006, 2007, 2008 David Turner <david@freetype.org> +# Content (c) 2002, 2004, 2006, 2007, 2008, 2009 +# David Turner <david@freetype.org> # # This file contains routines used to parse the content of documentation # comment blocks and build more structured objects out of them. @@ -153,7 +154,7 @@ class DocField: if mode == mode_code: m = re_code_end.match( l ) if m and len( m.group( 1 ) ) <= margin: - # that's it, we finised the code sequence + # that's it, we finished the code sequence code = DocCode( 0, cur_lines ) self.items.append( code ) margin = -1 @@ -321,7 +322,7 @@ class DocSection: self.blocks[block.name] = block def process( self ): - # lookup one block that contains a valid section description + # look up one block that contains a valid section description for block in self.defs: title = block.get_markup_text( "title" ) if title: @@ -539,9 +540,10 @@ class DocBlock: while start < end and not string.strip( source[end] ): end = end - 1 - source = source[start:end + 1] - - self.code = source + if start == end: + self.code = [] + else: + self.code = source[start:end + 1] def location( self ): return self.source.location() diff --git a/src/3rdparty/freetype/src/tools/docmaker/sources.py b/src/3rdparty/freetype/src/tools/docmaker/sources.py index dcfbf7dae..7b68c0701 100644 --- a/src/3rdparty/freetype/src/tools/docmaker/sources.py +++ b/src/3rdparty/freetype/src/tools/docmaker/sources.py @@ -1,4 +1,4 @@ -# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008 +# Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009 # David Turner <david@freetype.org> # # @@ -179,14 +179,14 @@ re_source_keywords = re.compile( '''\\b ( typedef | ## ## SOURCE BLOCK CLASS ## -## A SourceProcessor is in charge or reading a C source file +## A SourceProcessor is in charge of reading a C source file ## and decomposing it into a series of different "SourceBlocks". ## each one of these blocks can be made of the following data: ## ## - A documentation comment block that starts with "/**" and ## whose exact format will be discussed later ## -## - normal sources lines, include comments +## - normal sources lines, including comments ## ## the important fields in a text block are the following ones: ## @@ -255,7 +255,7 @@ class SourceBlock: ## ## SOURCE PROCESSOR CLASS ## -## The SourceProcessor is in charge or reading a C source file +## The SourceProcessor is in charge of reading a C source file ## and decomposing it into a series of different "SourceBlock" ## objects. ## @@ -301,7 +301,7 @@ class SourceProcessor: self.process_normal_line( line ) else: if self.format.end.match( line ): - # that's a normal block end, add it to lines and + # that's a normal block end, add it to 'lines' and # create a new block self.lines.append( line ) self.add_block_lines() diff --git a/src/3rdparty/freetype/src/tools/docmaker/tohtml.py b/src/3rdparty/freetype/src/tools/docmaker/tohtml.py index 7e5c60866..fffa12097 100644 --- a/src/3rdparty/freetype/src/tools/docmaker/tohtml.py +++ b/src/3rdparty/freetype/src/tools/docmaker/tohtml.py @@ -15,9 +15,11 @@ html_header_1 = """\ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>""" +<title>\ +""" -html_header_2= """ API Reference</title> +html_header_2 = """\ + API Reference</title> <style type="text/css"> body { font-family: Verdana, Geneva, Arial, Helvetica, serif; color: #000000; @@ -45,16 +47,44 @@ html_header_2= """ API Reference</title> </style> </head> <body> -<center><h1>""" +""" + +html_header_3 = """ +<table align=center><tr><td><font size=-1>[<a href="\ +""" + +html_header_3i = """ +<table align=center><tr><td width="100%"></td> +<td><font size=-1>[<a href="\ +""" + +html_header_4 = """\ +">Index</a>]</font></td> +<td width="100%"></td> +<td><font size=-1>[<a href="\ +""" + +html_header_5 = """\ +">TOC</a>]</font></td></tr></table> +<center><h1>\ +""" + +html_header_5t = """\ +">Index</a>]</font></td> +<td width="100%"></td></tr></table> +<center><h1>\ +""" -html_header_3=""" API Reference</h1></center> +html_header_6 = """\ + API Reference</h1></center> """ # The HTML footer used by all generated pages. html_footer = """\ </body> -</html>""" +</html>\ +""" # The header and footer used for each section. section_title_header = "<center><h1>" @@ -110,12 +140,23 @@ chapter_footer = '</li></ul></td></tr></table>' index_footer_start = """\ <hr> <table><tr><td width="100%"></td> -<td><font size=-2>[<a href=" +<td><font size=-2>[<a href="\ """ index_footer_end = """\ ">TOC</a>]</font></td></tr></table> """ +# TOC footer. +toc_footer_start = """\ +<hr> +<table><tr><td><font size=-2>[<a href="\ +""" +toc_footer_end = """\ +">Index</a>]</font></td> +<td width="100%"></td> +</tr></table> +""" + # source language keyword coloration/styling keyword_prefix = '<span class="keyword">' @@ -159,22 +200,39 @@ class HtmlFormatter( Formatter ): def __init__( self, processor, project_title, file_prefix ): Formatter.__init__( self, processor ) - global html_header_1, html_header_2, html_header_3, html_footer + global html_header_1, html_header_2, html_header_3 + global html_header_4, html_header_5, html_footer if file_prefix: file_prefix = file_prefix + "-" else: file_prefix = "" - self.headers = processor.headers - self.project_title = project_title - self.file_prefix = file_prefix - self.html_header = html_header_1 + project_title + html_header_2 + \ - project_title + html_header_3 - - self.html_footer = "<center><font size=""-2"">generated on " + \ - time.asctime( time.localtime( time.time() ) ) + \ - "</font></center>" + html_footer + self.headers = processor.headers + self.project_title = project_title + self.file_prefix = file_prefix + self.html_header = html_header_1 + project_title + \ + html_header_2 + \ + html_header_3 + file_prefix + "index.html" + \ + html_header_4 + file_prefix + "toc.html" + \ + html_header_5 + project_title + \ + html_header_6 + + self.html_index_header = html_header_1 + project_title + \ + html_header_2 + \ + html_header_3i + file_prefix + "toc.html" + \ + html_header_5 + project_title + \ + html_header_6 + + self.html_toc_header = html_header_1 + project_title + \ + html_header_2 + \ + html_header_3 + file_prefix + "index.html" + \ + html_header_5t + project_title + \ + html_header_6 + + self.html_footer = "<center><font size=""-2"">generated on " + \ + time.asctime( time.localtime( time.time() ) ) + \ + "</font></center>" + html_footer self.columns = 3 @@ -227,7 +285,7 @@ class HtmlFormatter( Formatter ): return html_quote( word ) def make_html_para( self, words ): - """ convert a paragraph's words into tagged HTML text, handle xrefs """ + """ convert words of a paragraph into tagged HTML text, handle xrefs """ line = "" if words: line = self.make_html_word( words[0] ) @@ -237,6 +295,8 @@ class HtmlFormatter( Formatter ): line = re.sub( r"(^|\W)`(.*?)'(\W|$)", \ r'\1‘\2’\3', \ line ) + # convert tilde into non-breakable space + line = string.replace( line, "~", " " ) return para_header + line + para_footer @@ -338,7 +398,7 @@ class HtmlFormatter( Formatter ): # Formatting the index # def index_enter( self ): - print self.html_header + print self.html_index_header self.index_items = {} def index_name_enter( self, name ): @@ -371,6 +431,8 @@ class HtmlFormatter( Formatter ): self.file_prefix + "toc.html" + \ index_footer_end + print self.html_footer + self.index_items = {} def index_dump( self, index_filename = None ): @@ -383,7 +445,7 @@ class HtmlFormatter( Formatter ): # Formatting the table of content # def toc_enter( self ): - print self.html_header + print self.html_toc_header print "<center><h1>Table of Contents</h1></center>" def toc_chapter_enter( self, chapter ): @@ -402,7 +464,7 @@ class HtmlFormatter( Formatter ): def toc_chapter_exit( self, chapter ): print "</table>" - print chapter_footer + print chapter_footer def toc_index( self, index_filename ): print chapter_header + \ @@ -410,6 +472,10 @@ class HtmlFormatter( Formatter ): chapter_inter + chapter_footer def toc_exit( self ): + print toc_footer_start + \ + self.file_prefix + "index.html" + \ + toc_footer_end + print self.html_footer def toc_dump( self, toc_filename = None, index_filename = None ): |