diff --git a/Manual_tools/src/cc_anchor_filter.lex b/Manual_tools/src/cc_anchor_filter.lex index 2b4e9df4bd0..62e293d3e28 100644 --- a/Manual_tools/src/cc_anchor_filter.lex +++ b/Manual_tools/src/cc_anchor_filter.lex @@ -91,7 +91,10 @@ int linknesting; Dictionary dict_labels, dict_bib, dict_anchormode_bib, dict_cc, dict_internal; -string output_path; +const string reference_icon = ""; + +string output_path, reftext; ofstream output_file; bool @@ -190,7 +193,7 @@ CCletter [a-zA-Z_] LT "<" GT ">" CCidfier ({CCletter}({CCletter}|{digit})*) -CCidfier1 {CCidfier}({CCidfier}|[ ]?({LT}[ ]?)+{CCidfier}|([ ]?{GT})*[ ]?"::"[ ]?{CCidfier}|{CCidfier}[ ]?","[ ]?{CCidfier})*([ ]?{GT})* +CCidfier1 {CCidfier}({CCidfier}|[ ]?({LT}[ ]?)+{CCidfier}|([ ]?{GT})*[ ]?"::"[ ]?{CCidfier}|[ ]?[,][ ]?{CCidfier})*([ ]?{GT})* ws [ \t\n\r]* par {ws}("<"[pP]">"{ws})* glue {ws}("<"[pP]">"{ws})*""{ws}("<"[pP]">"{ws})* @@ -261,14 +264,25 @@ cccend "[cccend]" "<"[^ \t\n\r] { BEGIN(ANCHORMODE); ECHO; } [^>]*[>] { BEGIN(INITIAL); ECHO; } +[\[]reftext[:][^\]]+[\]] { + yytext [ yyleng - 1 ] = '\0'; // cut off trailing ] + reftext = string(yytext + 9); // skip \reftext: +} + [\[]ref[:][^\]]+[\]] { yytext [ yyleng - 1 ] = '\0'; // cut off trailing ] const char *my_yytext = yytext + 5; // skip [ref:" if( dict_labels.is_defined( my_yytext ) ) { //cerr << " !! label [" << my_yytext << "] is defined as [" << dict_labels[ my_yytext ] << endl; - output_file << dict_labels[ my_yytext ]; + output_file << ""; + if( reftext != string() ) + output_file << reftext; + else + output_file << reference_icon; + output_file << ""; } else cerr << " !! Warning: undefined label \"" << my_yytext << "\"" << endl; + reftext = string(); } [\[]internal[:][^\]]+[\]] { @@ -279,16 +293,9 @@ cccend "[cccend]" output_file << dict_internal[ my_yytext ]; } -{CCidfier1} { - /*stringstream s_stream; - - // remove all spaces - for( const char *s = yytext; *s != '\0'; ++s ) - if( *s != ' ' && *s != '\n' && *s != '\r' && *s != '\t') - s_stream << *s;*/ - - //match_cc_idfier( s_stream.str() ); - match_cc_idfier( yytext, &output_file ); +{CCidfier1} { + //output_file << "matched [" << yytext << "] as ccidfieR" << std::endl; + match_cc_idfier( yytext, &output_file ); } [<][^>]+[>] { ECHO; } // do not crosslink inside html tags . { ECHO; } diff --git a/Manual_tools/src/cc_extract_html.C b/Manual_tools/src/cc_extract_html.C index 407990b8871..72de2cb2cec 100644 --- a/Manual_tools/src/cc_extract_html.C +++ b/Manual_tools/src/cc_extract_html.C @@ -38,12 +38,6 @@ using namespace std; const string prog_name = "cc_extract_html"; const string prog_release = "$Id$"; - -/* Constant string used for referencing. */ -/* ===================================== */ -const string reference_icon = ""; - /* Configurable command line options */ /* ================================= */ Switch V_switch = NO_SWITCH; @@ -81,7 +75,6 @@ void init_commandline_args() { insertInternalGlobalMacro( "\\lciConfigPath", config_path); insertInternalGlobalMacro( "\\lciTmpPath", tmp_path); insertInternalGlobalMacro( "\\lciExtractHtmlRelease", prog_release); - insertInternalGlobalMacro( "\\lciReferenceIcon", reference_icon); insertInternalGlobalMacro( "\\lciManualDate", manual_date); // check for date format as provided by latex_to_html if ( std::count( manual_date.begin(), manual_date.end(), ',') == 2) { diff --git a/Manual_tools/src/config.h b/Manual_tools/src/config.h index ac09f478886..61e2c3aa485 100644 --- a/Manual_tools/src/config.h +++ b/Manual_tools/src/config.h @@ -46,7 +46,6 @@ extern Switch onlyheader_switch; extern const string prog_name; extern const string prog_release; -extern const string reference_icon; diff --git a/Manual_tools/src/latex_converter_config/html/latex.sty b/Manual_tools/src/latex_converter_config/html/latex.sty index 0da6a79a63c..66b17aeafbe 100644 --- a/Manual_tools/src/latex_converter_config/html/latex.sty +++ b/Manual_tools/src/latex_converter_config/html/latex.sty @@ -1743,13 +1743,15 @@ \newcommand{\ref}[1]{\lcAsciiToHtml{[ref:#1]}} \newcommand{\pageref}[1]{\lcAsciiToHtml{[ref:#1]}} +\newcommand{\ref@om}{\lcAsciiToHtml{[reftext:#1][ref:#2]}} + \newcommand{\label}[1]{\lcRawHtml{}% \edef\lciOut{\lciOutputBasename}% \edef\lciOutPath{\lciReplaceWithCurrentPathToken}% \lciPushOutput{anchor}% - \lciLabel{#1}{\lciOutPath}{\lciOut}{\lciReferenceIcon}\lciPopOutput} + \lciLabel{#1}{\lciOutPath}{\lciOut}\lciPopOutput} -\newcommand{\lciLabel}[4]{\lciRawOutput{l #C1 #X4 +\newcommand{\lciLabel}[3]{\lciRawOutput{l #C1 #XC2#XC3###C1 }} % +-------------------------------------------------------------------------- diff --git a/Manual_tools/src/latex_to_html b/Manual_tools/src/latex_to_html index 7ce68631cc0..20b9e94c601 100755 --- a/Manual_tools/src/latex_to_html +++ b/Manual_tools/src/latex_to_html @@ -846,7 +846,7 @@ done # Cleanup # ------- -if [ $KeepTmp -eq 0 ]; then +if [ $KeepTmp -eq 0 ]; then \rm -r ${TmpDir} else echo "NOTE: The tmp directory '${TmpDir}' was kept." 1>&2