From b916b1e53fb4cc759ce64e4b0a8ad0f259c4f9ad Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 31 May 2000 07:54:45 +0000 Subject: [PATCH] updated the DocMaker tool to produce HTML pages There is still some work on it to allow the following: - multiple input files - block classification according to block's first markers (e.g. types, functions, constants, etc..) - indexing and cross-linking - better layout ;-) --- docs/docmaker.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/docs/docmaker.py b/docs/docmaker.py index 1560ad814..5a6ea0e7b 100644 --- a/docs/docmaker.py +++ b/docs/docmaker.py @@ -327,6 +327,33 @@ class DocContent: if field: print " " + def dump_html(self): + n = len(self.fields) + for i in range(n): + field = self.fields[i] + if field==[]: + print "

" + for paras in self.texts[i]: + print "

" + paras.dump() + print "

" + else: + if i==1: + print "" + if n > 1: + print "
" + else: + print "
" + + print ""+field+"" + + for paras in self.texts[i]: + print "

" + paras.dump() + print "

" + + print "
" + ###################################################################################### # @@ -439,6 +466,36 @@ def dump_doc_contents( block_list ): print "" print "" +def dump_html_1( block_list ): + + print "" + types = [ 'Type', 'Struct', 'FuncType', 'Function', 'Constant', 'Enumeration' ] + for block in block_list: + docblock = DocBlock(block) + print "
" + for i in range(len(docblock.markers)): + marker = docblock.markers[i] + content = docblock.contents[i] + dcontent = DocContent( content ) + + if marker=="Description": + print "" + + elif marker in types: + print "

"+content[0]+"

" + else: + print "

"+marker+"

" + print "" + + print "" + + print "
" + + def main(argv): """main program loop""" print "extracting comment blocks from sources .." @@ -449,8 +506,10 @@ def main(argv): # dump_doc_blocks( list ) # print "dumping block contents .." - dump_doc_contents(list) +# dump_doc_contents(list) + dump_html_1(list) + # dump_single_content(list) # If called from the command line