From 7e670c317b92d98a573d43c5c1602b1edb6d9a4a Mon Sep 17 00:00:00 2001 From: Andreas Meyer Date: Tue, 20 Feb 2007 12:30:06 +0000 Subject: [PATCH] * switched to xml output for comments (makes transition easier from doc_tex to doxygen) * bugfix (html): made footnotes always appear _after_ alphabetical list of refpages * bugfix: ccReferToExampleCode is now typeset in alltt --- Manual_tools/src/cc_extract_html.C | 4 +-- Manual_tools/src/cpp_formatting.C | 36 +++++++++++++------ .../latex_converter_config/html/cc_manual.sty | 28 +++++++++------ .../src/latex_converter_config/html/latex.sty | 21 +++++------ Manual_tools/src/latex_to_html | 2 +- Manual_tools/src/output.C | 2 +- Manual_tools/sty/cc_manual.sty | 2 +- 7 files changed, 56 insertions(+), 39 deletions(-) diff --git a/Manual_tools/src/cc_extract_html.C b/Manual_tools/src/cc_extract_html.C index e2b33da56e0..ff8bcbc7823 100644 --- a/Manual_tools/src/cc_extract_html.C +++ b/Manual_tools/src/cc_extract_html.C @@ -417,7 +417,7 @@ main( int argc, char **argv) { macroX( "\\lciContentsFilename")); short_contents_stream = open_file_for_write( tmp_path + macroX( "\\lciShortContentsFilename")); - comments_stream = open_file_for_write( tmp_path + "comments.txt" ); + comments_stream = open_file_for_write( tmp_path + "comments.xml" ); package_overview_stream = open_file_for_write( tmp_path + macroX( "\\lciPkgOverviewFilename") ); @@ -564,7 +564,7 @@ main( int argc, char **argv) { assert_file_write( *HREF_stream, macroX( "\\lciHREFFilename")); delete HREF_stream; - assert_file_write( *comments_stream, "comments.txt" ); + assert_file_write( *comments_stream, "comments.xml" ); delete comments_stream; diff --git a/Manual_tools/src/cpp_formatting.C b/Manual_tools/src/cpp_formatting.C index a2fd371f4b9..b49f468132f 100644 --- a/Manual_tools/src/cpp_formatting.C +++ b/Manual_tools/src/cpp_formatting.C @@ -1883,63 +1883,77 @@ void format_constructor( const char* signature) { void handle_two_column_layout( char key, const char* decl) { if ( current_ostream) { *current_ostream << "[cccbegin]"; + (*comments_stream) << " " << std::endl + << " "; decl = handle_template_layout( *current_ostream, decl, false); switch ( key) { case 'A': format_class_declaration( decl); - (*comments_stream) << "\\class@"; + (*comments_stream) << "class"; break; case 'B': format_struct( decl); - (*comments_stream) << "\\struct@"; + (*comments_stream) << "struct"; break; case 'C': format_nested_type( decl); - (*comments_stream) << "\\nested_type@"; + (*comments_stream) << "nested_type>"; break; case 'D': format_enum( decl); - (*comments_stream) << "\\enum@"; + (*comments_stream) << "enum>"; break; case 'E': format_constructor( decl); - (*comments_stream) << "\\constructor@"; + (*comments_stream) << "constructor>"; break; default: printErrorMessage( UnknownKeyError); } *current_ostream << "[cccend]"; } - (*comments_stream) << decl << "@" << std::endl; + string my_decl = decl; + crop_string( my_decl ); + (*comments_stream) << "" << std::endl + << " "; + print_ascii_to_html( *comments_stream, my_decl.c_str() ); + (*comments_stream) << "" << std::endl; } void handle_three_column_layout( char key, const char* decl, bool empty) { if ( current_ostream) { *current_ostream << "[cccbegin]"; + (*comments_stream) << " " << std::endl + << " "; decl = handle_template_layout( *current_ostream, decl, true); switch ( key) { case 'L': // member function format_function( true, decl, empty); - (*comments_stream) << "\\memberfunction@"; + (*comments_stream) << "memberfunction"; break; case 'M': // function format_function( false, decl, empty); - (*comments_stream) << "\\function@"; + (*comments_stream) << "function"; break; case 'N': format_variable( decl, empty); - (*comments_stream) << "\\variable@"; + (*comments_stream) << "variable>"; break; case 'O': // typedef format_variable( decl, empty, true); - (*comments_stream) << "\\typedef@"; + (*comments_stream) << "typedef"; break; default: printErrorMessage( UnknownKeyError); } *current_ostream << "[cccend]"; } - (*comments_stream) << decl << "@" << std::endl; + string my_decl = decl; + crop_string( my_decl ); + (*comments_stream) << "" << std::endl + << " "; + print_ascii_to_html( *comments_stream, my_decl.c_str() ); + (*comments_stream) << "" << std::endl; } diff --git a/Manual_tools/src/latex_converter_config/html/cc_manual.sty b/Manual_tools/src/latex_converter_config/html/cc_manual.sty index 86d5b2b90e2..c20bd2de649 100644 --- a/Manual_tools/src/latex_converter_config/html/cc_manual.sty +++ b/Manual_tools/src/latex_converter_config/html/cc_manual.sty @@ -259,9 +259,11 @@ } \newcommand{\ccReferToExampleCode}[1]{% +\begin{alltt}% \lcRawHtml{}% \input{#1.filename}% \lcRawHtml{}% +\end{alltt}% } @@ -575,7 +577,7 @@ \gdef{\lciIfHtmlClassIndex}{\lcTrue}% \gdef{\lciIfHtmlRefLinks}{\lcTrue}% \gdef{\lciIfHtmlRefIndex}{\lcTrue}% - \lciPushOutput{comments}\lcRawHtml{\end + \lciPushOutput{comments}\lcRawHtml{ } \lciPopOutput @@ -606,18 +608,21 @@ \lciRefDeclDefFilenameX{\ccPureRefScope}{#1}{\ccRefCategory}% {\ccRefPureGlobalScope}{\lciCCParameter}} + +\newcommand{\lciPrintToComments}[2]{% +\lcRawHtml{<}#1\lcRawHtml{>}\lcAsciiToHtml{#2}\lcRawHtml{}% +} % #1 = local scope (may be empty) % #2 = classname (functioname etc.) without template parameters % #3 = Ref category % #4 = global scope (may be empty) \newcommand{\lciRefDeclDefFilenameX}[5]{% \lciPushOutput{comments}% -\lcRawHtml{\localscope@#XC1@} -\lcRawHtml{\id@#XC2@} -\lcRawHtml{\refcat@#XC3@} -\lcRawHtml{\globalscope@#XC4@} -\lcRawHtml{\other@#XC5@ -} + \lcRawHtml{} + \lciPrintToComments{localscope}{#XC1} + \lciPrintToComments{refcat}{#XC3} + \lciPrintToComments{globalscope}{#XC4} + \lciPrintToComments{other}{#XC5} \lciPopOutput \newcommand{\ccPureClassName}{#XC1#C2}% @@ -640,6 +645,7 @@ \gdef{\lciIfHtmlRefLinks}{\lcFalse}% \gdef{\lciIfHtmlRefIndex}{\lcFalse}% \lciParseUntilDelimiter{\lciSkipOneParameter}@}% skip remaining part + \newcommand{\lciRefDeclOpenFilenameX}[3]{\begin{ccReferenceFile}{#1#GXC2}{#3}} %% Args: ccCategory, ccRefName @@ -865,8 +871,8 @@ \gdef{\lciIfHtmlLinks}{\lcTrue}% \gdef{\lciIfHtmlIndex}{\lcTrue}% \lciPushOutput{comments}% -\lcRawHtml{\comment@#C2@ -} +\lcRawHtml{ }\lciPrintToComments{comment}{#C2} + \lcRawHtml{} \lciPopOutput } @@ -908,8 +914,8 @@ \gdef{\lciIfHtmlIndex}{\lcTrue}% \gdef\ccIsFunctionTemplate{\ccFalse}% \lciPushOutput{comments}% -\lcRawHtml{\comment@#C2@ -} +\lcRawHtml{ }\lciPrintToComments{comment}{#C2} + \lcRawHtml{} \lciPopOutput } diff --git a/Manual_tools/src/latex_converter_config/html/latex.sty b/Manual_tools/src/latex_converter_config/html/latex.sty index 809786a6ed2..f55420caf32 100644 --- a/Manual_tools/src/latex_converter_config/html/latex.sty +++ b/Manual_tools/src/latex_converter_config/html/latex.sty @@ -256,9 +256,10 @@ td.TocChapter { font-weight: normal; } \lcRawHtml{

Package Overview

} \lcRawHtml{} \lciPopOutput% + \lciPushOutput{comments}% +\lcRawHtml{} +\lciPopOutput% }{% - % print remaining footnotes at the end of the conversion - \lciPrintFootnotes\lciResetFootnotes % close all parts, chapters, and sections at the end of the conversion \lciEndPart % finish table of contents @@ -274,6 +275,9 @@ td.TocChapter { font-weight: normal; } \lciHtmlNavigationBottom \lciHtmlFileFooter% \lciPopOutput% + \lciPushOutput{comments}% +\lcRawHtml{} +\lciPopOutput% } % Args: tmp-path, main-rootname: reads *.auxtmp file created by latex_to_html @@ -1133,12 +1137,7 @@ td.TocChapter { font-weight: normal; } \gdef{\lciIfHtmlIndex}{\lcTrue}% \lciHtmlPartHeader{}{#1}} -\newcommand{\lciEndPart}{% - \lciEndChapter - \lciIfDefined{\lciTheFirstPartHasAlreadyBeenProcessedFlag}{ % check for first part - \lciPrintFootnotes\lciResetFootnotes - }{\newcommand{\lciTheFirstPartHasAlreadyBeenProcessedFlag}{}}% -} +\newcommand{\lciEndPart}{\lciEndChapter} \gdef\lciReplaceWithCurrentPathToken{REPLACE_WITH_CURRENT_PATH}% @@ -1204,8 +1203,7 @@ td.TocChapter { font-weight: normal; } \lciPopFootnotes % navigation footer \addtocounter{createdfiles}{1}% - \lcRawHtml{[internal:Next_#GC1_link_}\value{part}\_\value{createdfiles}\lcRawHtml{] -} + \lcRawHtml{[internal:Next_#GC1_link_}\value{part}\_\value{createdfiles}\lcRawHtml{]} \lciHtmlNavigationBottom \lciHtmlFileFooter \lciPopOutput @@ -1231,8 +1229,7 @@ td.TocChapter { font-weight: normal; } \lcRawHtml{ -}% + \lcRawHtml{">}\lciRemoveNewlines{#1}\lcRawHtml{} \lcRawHtml{i Up_chapter_link_}\value{part}\_\value{createdfiles}% \lcRawHtml{