]> OCCT Git - occt-copy.git/commitdiff
0028950: Generation of draw_test_harness and upgrade pdf files is crashed
authorabv <abv@opencascade.com>
Wed, 26 Jul 2017 10:47:04 +0000 (13:47 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 27 Jul 2017 11:00:03 +0000 (14:00 +0300)
Template for LaTeX header used in generation of PDF manuals is corrected to avoid multiple errors during processing by LaTeX (which can eventually lead to LaTeX aborting if their count exceeds 100).

Names of log files generated by gendoc command are made dependent on target format and (for PDF output) document name.

Formatting bug is fixed in DRAW User Guide

adm/gendoc.tcl
dox/resources/occt_pdf_template.tex
dox/resources/occt_ug_pdf.doxyfile
dox/user_guides/draw_test_harness/draw_test_harness.md

index 226a58749169089aa43d8c4982cbbed4a18eecda..e422fd09f5a9ff7125b94d6dac7c3d57db1a4bbb 100644 (file)
@@ -303,13 +303,6 @@ proc gendoc {args} {
 
   puts ""
 
-  # Clean logfiles
-  set DOXYLOG [OCCDoc_GetRootDir]/doc/doxygen_warnings_and_errors.log
-  set PDFLOG  [OCCDoc_GetRootDir]/doc/pdflatex_warnings_and_errors.log
-
-  file delete -force $PDFLOG
-  file delete -force $DOXYLOG
-  
   # Start main activities
   if { $GEN_MODE != "PDF_ONLY" } {
     if { [OCCDoc_GetProdRootDir] == ""} {
@@ -330,15 +323,15 @@ proc gendoc {args} {
       }
     }
   } else {
-    puts "Generating OCCT User Guides in PDF format...\n"
+    puts "Generating OCCT User Guides in PDF format..."
     foreach pdf $DOCFILES {
 
-      puts "Info: Processing file $pdf\n"
+      puts "\nInfo: Processing file $pdf"
 
       # Some values are hardcoded because they are related only to PDF generation
       OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
     }
-    puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
+    puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
   }
 }
 
@@ -465,23 +458,31 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
   set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
 
   if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
+    set LOGPREFIX "html_"
     puts "$starttimestamp Generating HTML files..."
 
     # Copy index file to provide fast access to HTML documentation
     file copy -force $INDIR/resources/index.html $DOCDIR/index.html
   } elseif { $generatorMode == "CHM_ONLY" } {
+    set LOGPREFIX "chm_"
     puts "$starttimestamp Generating CHM file..."
   } elseif { $generatorMode == "PDF_ONLY" } {
+    set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
     puts "$starttimestamp Generating PDF file..."
   }
 
-  set DOXYLOG $OUTDIR/doxygen_warnings_and_errors.log
-  set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $OUTDIR/doxygen_out.log} DOX_ERROR] 
+  # Clean logfiles  
+  set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
+  set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
+  file delete -force $DOXYLOG
+  file delete -force $DOXYOUT
+
+  set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR] 
   if {$RESULT != 0} {
     set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
     if {$NbErrors > 0} {
-      puts "\nWarning: Doxygen reported $NbErrors messages."
-      puts "See log in $DOXYLOG\n"
+      puts "Warning: Doxygen reported $NbErrors messages."
+      puts "See log in $DOXYLOG"
       set DOX_ERROR_FILE [open $DOXYLOG "a"]
       if {$generatorMode == "PDF_ONLY"} {
         puts $DOX_ERROR_FILE "\n===================================================="
@@ -503,7 +504,7 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
     if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
       puts "$curtime Generation completed."
       puts "\nInfo: doxygen log file is located in:"
-      puts "$OUTDIR/doxygen_out.log."
+      puts "${DOXYOUT}."
       puts "\nReference Manual is generated in \n$DOCDIR"
     }
   } elseif { $docType == "OVERVIEW" } {
@@ -570,25 +571,29 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
             puts "Info: Executing $LATEXDIR/Makefile..."
           }
         }
-        set PDFLOG $OUTDIR/pdflatex_warnings_and_errors.log
+
+        set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
+        set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
+        file delete -force $PDFLOG
+        file delete -force $PDFOUT
 
         if {"$is_win" == "yes"} {
-          set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
+          set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
         } else {
-          set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
+          set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
 
           # Small workaround for *nix stations
           set prev_loc [pwd]
           cd $LATEXDIR
-          set RESULT [catch {eval exec "pdflatex refman.tex" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
+          set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
           cd $prev_loc
         }
 
         if {$RESULT != 0} {
           set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
           if {$NbErrors > 0} {
-            puts "\nWarning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG\n"
-            set LaTeX_ERROR_FILE [open $PDFLOG "a"]
+            puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
+            set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
             puts $LaTeX_ERROR_FILE "\n===================================================="
             puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
             puts $LaTeX_ERROR_FILE "====================================================\n"
@@ -621,6 +626,7 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
           set TEX "$PDFNAME"
         }
         file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
+        puts "Generated $destFolder/$TEX.pdf"
       }
     } elseif { $generatorMode == "CHM_ONLY" } {
       if { [OCCDoc_GetProdRootDir] == ""} {
@@ -632,13 +638,10 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
     cd $INDIR
 
     if { $generatorMode == "HTML_ONLY" } {
-      puts "\nHTML documentation is generated in \n$DOCDIR"
-    }
-    if { $generatorMode == "CHM_ONLY" } {
-      puts "\nGenerated CHM documentation is in \n$OUTDIR/overview.chm"
+      puts "HTML documentation is generated in \n$DOCDIR"
+    } elseif { $generatorMode == "CHM_ONLY" } {
+      puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
     }
-
-    puts ""
   }
 
   # Remove temporary Doxygen files
@@ -647,8 +650,6 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
     file delete $file
   }
 
-  puts "\nPDF files are generated in \n[file normalize $OUTDIR]"
-
   return 0
 }
 
index c2e13920fe2860bed89f2e20d3bf8ec071ef28ac..ff6ec5488b0f5811fffd3fab6402814e7dd7c7e6 100644 (file)
@@ -31,6 +31,7 @@
   \fontseries{bc}\selectfont%
   \color{darkgray}%
 }
+\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}
 
 % Page & text layout
 \usepackage{geometry}
 \makeatletter
 \renewcommand{\paragraph}{%
   \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
-\normalfont\normalsize\bfseries\SS@parafont%
+    \normalfont\normalsize\bfseries\SS@parafont%
   }%
 }
 \renewcommand{\subparagraph}{%
   \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
-\normalfont\normalsize\bfseries\SS@subparafont%
+    \normalfont\normalsize\bfseries\SS@subparafont%
   }%
 }
 \makeatother
 \newcommand{\clearemptydoublepage}{%
   \newpage{\pagestyle{empty}\cleardoublepage}%
 }
-\n
-%===== C O N T E N T S =====\n
+
+
+%===== C O N T E N T S =====
+
 \begin{document}
+
 % Titlepage & ToC
 \hypersetup{pageanchor=false}
 \pagenumbering{roman}
index 01f79dd138fc004bdcb7575811590e9a39509ca9..b158bef3b10c877e73942281da83c350caea3da9 100644 (file)
@@ -41,7 +41,7 @@ GENERATE_TREEVIEW      = NO
 PREDEFINED             = PDF_ONLY
 GENERATE_LATEX         = YES
 COMPACT_LATEX          = YES
-PDF_HYPERLINKS         = NO
+PDF_HYPERLINKS         = YES
 USE_PDFLATEX           = YES
 LATEX_BATCHMODE        = YES
 LATEX_OUTPUT           = latex
index e6114a5c5e753491d265ca5291860b44d002a6d1..37afc26001dc822efa6b1858ee516047d6fdf6a9 100644 (file)
@@ -391,7 +391,7 @@ puts ;negative;
 Syntax:                  
 
 
-~~~~~~
+~~~~~
 while condition script 
 for init condition reinit script 
 foreach varname list script