]> Git repositories of Nishi - docgen.git/commitdiff
add favicon
authorNishi <nishi@nishi.boats>
Mon, 30 Sep 2024 15:33:36 +0000 (15:33 +0000)
committerNishi <nishi@nishi.boats>
Mon, 30 Sep 2024 15:33:36 +0000 (15:33 +0000)
git-svn-id: file:///raid/svn-personal/docgen/trunk@9 44bc13e5-44cb-984e-b856-1907bf1ada44

docgen
example/docgen.conf
example/favicon.png [new file with mode: 0644]

diff --git a/docgen b/docgen
index 8d179dd2d24566db52f37a067091243cb0c08904..3ce787e9531b49f61ce23617452b7f713a58c892 100755 (executable)
--- a/docgen
+++ b/docgen
@@ -26,6 +26,7 @@ set input_directory ""
 set output_directory ""
 set title ""
 set icon ""
+set favicon ""
 set icon_height 0
 set footer ""
 set links ""
@@ -45,10 +46,18 @@ if { "$title" == "" } {
        exit 1
 }
 
+if { "$icon" != "" && "$favicon" == "" } {
+       set favicon "$icon"
+}
+
 if { "$icon" != "" && ![file exists "$icon"] } {
        puts "Icon $icon does not exist"
        exit 1
 }
+if { "$favicon" != "" && ![file exists "$favicon"] } {
+       puts "Favicon $favicon does not exist"
+       exit 1
+}
 
 if { "$links" != "" } {
        set links " | $links"
@@ -59,15 +68,15 @@ set genre_list {}
 puts "Docgen version $DOCGEN_VERSION"
 
 proc start_html {fid title toc dots} {
-       global links icon
+       global links favicon icon
        puts $fid "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
        puts $fid "<html>"
        puts $fid "     <head>"
        puts $fid "             <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
        puts $fid "             <title>$title</title>"
        puts $fid "             <link rel=\"stylesheet\" href=\"$dots/style.css\">"
-       if { "$icon" != "" } {
-               puts $fid "             <link rel=\"icon\" href=\"$dots/[file tail "$icon"]\">"
+       if { "$favicon" != "" } {
+               puts $fid "             <link rel=\"icon\" href=\"$dots/[file tail "$favicon"]\">"
        }
        puts $fid "     </head>"
        puts $fid "     <body>"
@@ -257,6 +266,10 @@ if { "$icon" != "" } {
        file copy -force "$icon" "$output_directory/[file tail "$icon"]"
 }
 
+if { "$favicon" != "" } {
+       file copy -force "$favicon" "$output_directory/[file tail "$favicon"]"
+}
+
 set fid [open "$output_directory/style.css" "w"]
 
 set COLOR_PURPLE "#600060"
@@ -301,6 +314,7 @@ puts $fid "#toc {"
 puts $fid "    float: right;"
 puts $fid "    width: 13em;"
 puts $fid "    background-color: $COLOR_LIGHTGRAY;"
+puts $fid "    margin-bottom: 1em;"
 puts $fid "}"
 puts $fid "pre {"
 puts $fid "    background-color: $COLOR_LIGHTGRAY;"
@@ -326,6 +340,7 @@ puts $fid " padding-left: 30px;"
 puts $fid "}"
 puts $fid "hr {"
 puts $fid "    border: solid 1px $COLOR_TEXT;"
+puts $fid "    clear: both;"
 puts $fid "}"
 puts $fid "h2 {"
 puts $fid "    font-size: 20px;"
index b083dd33d7cabe14d28f345ef7cdcb2b214d8a1c..1e6b6f69eb0702ac480f78c5bcae0e15b7c1d791 100644 (file)
@@ -4,6 +4,8 @@ set input_directory "input"
 set output_directory "output"
 set title "Example Project"
 set icon "icon.png"
+set favicon "favicon.png"
 set footer "Some good footer"
 set links "<a href=\"http://nishi.boats\">nishi.boats</a>"
 set icon_height 96
+set languages {jp en}
diff --git a/example/favicon.png b/example/favicon.png
new file mode 100644 (file)
index 0000000..0cd6a44
Binary files /dev/null and b/example/favicon.png differ