From c52882ab72aba303fac900388ecca4e3c27c7c29 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 27 Nov 2014 08:01:25 +0100 Subject: [PATCH] [docmaker] Produce better HTML code. * src/tools/docmaker/tohtml.py: Always use double quotes for attribute values. (source_footer): Close `td' and `tr' groups. --- ChangeLog | 8 ++++++ src/tools/docmaker/tohtml.py | 50 ++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f9f012cb..be5acaee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-11-27 Werner Lemberg + + [docmaker] Produce better HTML code. + + * src/tools/docmaker/tohtml.py: Always use double quotes for + attribute values. + (source_footer): Close `td' and `tr' groups. + 2014-11-27 Werner Lemberg Use better way to disable creation of .pyc files for `make refdoc'. diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py index 8861633df..aa4ccbe78 100644 --- a/src/tools/docmaker/tohtml.py +++ b/src/tools/docmaker/tohtml.py @@ -64,18 +64,18 @@ html_header_2 = """\ """ html_header_3 = """ - - + -
[
[
[
[Index] [[

- -
[
[Index] [[TOC]
""" # Description header/footer. -description_header = '
' +description_header = '
' description_footer = "

" # Marker header/inter/footer combination. -marker_header = '
' +marker_header = '
' marker_inter = "
" marker_footer = "
" # Header location header/footer. -header_location_header = '
' +header_location_header = '
' header_location_footer = "

" # Source code extracts header/footer. -source_header = '
\n'
-source_footer = "\n

" +source_header = '
\n'
+source_footer = "\n

" # Chapter header/inter/footer. -chapter_header = '

' +chapter_header = '

' chapter_inter = '

  • ' chapter_footer = '
' @@ -154,7 +154,7 @@ chapter_footer = '

' index_footer_start = """\
-
[[TOC]
@@ -163,7 +163,7 @@ index_footer_end = """\ # TOC footer. toc_footer_start = """\
- @@ -230,7 +230,7 @@ class HtmlFormatter( Formatter ): + html_header_5t + project_title + html_header_6 ) self.html_footer = ( - "
generated on " + '
generated on ' + time.asctime( time.localtime( time.time() ) ) + "
" + html_footer ) @@ -317,7 +317,7 @@ class HtmlFormatter( Formatter ): def print_html_field( self, field ): if field.name: - print( "
[[Index]
" + print( '
' + field.name + "" ) @@ -360,15 +360,15 @@ class HtmlFormatter( Formatter ): def print_html_field_list( self, fields ): print "

" - print "" + print '
' for field in fields: if len( field.name ) > 22: - print( "" ) - print "
" + print( '
' + field.name + "
" + print '
' else: - print( "
" + print( '
' + field.name + "" ) @@ -411,7 +411,7 @@ class HtmlFormatter( Formatter ): count = len( self.block_index ) rows = ( count + self.columns - 1 ) / self.columns - print "" + print '
' for r in range( rows ): line = "" for c in range( self.columns ): @@ -451,10 +451,10 @@ class HtmlFormatter( Formatter ): def toc_chapter_enter( self, chapter ): print chapter_header + string.join( chapter.title ) + chapter_inter - print "
" + print '
' def toc_section_enter( self, section ): - print '
' + print '
' print( '' + section.title + '' ) @@ -507,7 +507,7 @@ class HtmlFormatter( Formatter ): if maxwidth <> 0: # print section synopsis print section_synopsis_header - print "" + print '
' columns = width / maxwidth if columns < 1: