0032156: Documentation, gendoc.tcl - wrong processing of 'mathjax' option
authorkgv <kgv@opencascade.com>
Mon, 1 Nov 2021 06:53:12 +0000 (09:53 +0300)
committerinv <inv@opencascade.com>
Mon, 1 Nov 2021 15:12:14 +0000 (18:12 +0300)
Fixed handling of -s=<search_mode> option.
Fixed handling of -mathjax=<path> option.

adm/gendoc.tcl

index d8999ec4cba2d16f94450d9fa5d97bb0d4f042c8..ef4745578350c6e40fc6c542bdb77782e6ef1f73 100644 (file)
@@ -236,9 +236,11 @@ proc gendoc {args} {
         return -1
       }
     } elseif {$arg_n == "s"} {
-      if { [ lsearch $args_names "pdf" ] == -1 } {
+      if { [ lsearch $args_names "pdf" ] != -1 } {
+        puts "Warning: search is not used with PDF and will be ignored."
         continue
       }
+
       if {$args_values(s) != "NULL"} {
         set SEARCH_MODE $args_values(s)
       } else {
@@ -247,16 +249,16 @@ proc gendoc {args} {
       }
     } elseif {$arg_n == "mathjax"} {
       if { [ lsearch $args_names "pdf" ] != -1 } {
-        set possible_mathjax_loc $args_values(mathjax)
-        if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
-          set MATHJAX_LOCATION $args_values(mathjax)
-          puts "$MATHJAX_LOCATION"
-        } else {
-          puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
-          puts "         MathJax will be used from $MATHJAX_LOCATION"
-        }
+        puts "Warning: MathJax is not used with PDF and will be ignored."
+      }
+
+      set possible_mathjax_loc $args_values(mathjax)
+      if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
+        set MATHJAX_LOCATION $args_values(mathjax)
+        puts "$MATHJAX_LOCATION"
       } else {
-        puts "Warning: MathJax is not used with pdf and will be ignored."
+        puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
+        puts "         MathJax will be used from $MATHJAX_LOCATION"
       }
     } else {
       puts "\nWrong argument: $arg_n"