]> Nishi Git Mirror - docgen.git/commitdiff
add \noindex
authorNishi <nishi@nishi.boats>
Wed, 16 Oct 2024 09:22:15 +0000 (09:22 +0000)
committerNishi <nishi@nishi.boats>
Wed, 16 Oct 2024 09:22:15 +0000 (09:22 +0000)
git-svn-id: file:///raid/svn-personal/docgen/trunk@16 44bc13e5-44cb-984e-b856-1907bf1ada44

docgen

diff --git a/docgen b/docgen
index 468b84c0ed7908aed8cfaafbdd4c6d36111dee42..a17db91fd30415c3686c4cb99d84270d763b9afc 100755 (executable)
--- a/docgen
+++ b/docgen
@@ -1,7 +1,7 @@
 #!/usr/bin/env tclsh
 # $Id$
 
-set DOCGEN_VERSION "1.02"
+set DOCGEN_VERSION "1.03"
 set INPUT "docgen.conf"
 set dowhat ""
 set language "en"
@@ -144,6 +144,7 @@ proc parse_markdown {path _result} {
        set result(toc) ""
        set result(genre) ""
        set result(render) 1
+       set result(index) 1
 
        set fid [open "$path" "r"]
 
@@ -192,6 +193,8 @@ proc parse_markdown {path _result} {
                                        set ignore 1
                                }
                        } elseif { "$ignore" == 1 } {
+                       } elseif { [regexp -- {^\\noindex$} "$line"] } {
+                               set result(index) 0
                        } elseif { [regexp -- {^\\error .+$} "$line"] } {
                                regexp -- {^\\error (.+)$} "$line" -> error
                                error "$error"
@@ -298,16 +301,18 @@ proc rescan {path dots append} {
                        parse_markdown "$input_directory/$path/$name" result
 
                        if { "$result(render)" == 1 } {
-                               set esc "[regsub -all { } "$result(genre)" _]"
-                               set gname "genre_$esc"
-                               global $gname
-                               if { [lsearch $genre_list "$esc"] == -1 } {
-                                       lappend genre_list "$esc"
-                               }
-                               if { "[file rootname "[file tail "$name"]"]" == "index" } {
-                                       lappend "$gname" "$path" "$result(title)";
-                               } else {
-                                       lappend "$gname" "$path/[file rootname "[file tail "$name"]"].html" "$result(title)";
+                               if { "$result(index)" == 1 } {
+                                       set esc "[regsub -all { } "$result(genre)" _]"
+                                       set gname "genre_$esc"
+                                       global $gname
+                                       if { [lsearch $genre_list "$esc"] == -1 } {
+                                               lappend genre_list "$esc"
+                                       }
+                                       if { "[file rootname "[file tail "$name"]"]" == "index" } {
+                                               lappend "$gname" "$path" "$result(title)";
+                                       } else {
+                                               lappend "$gname" "$path/[file rootname "[file tail "$name"]"].html" "$result(title)";
+                                       }
                                }
        
                                set outfid [open "$output_directory/$append/$path/[file rootname "[file tail "$name"]"].html" "w"]