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

docgen
example/docgen.conf

diff --git a/docgen b/docgen
index 48e1bc16daba02c95b9f209735c74060b97b3ff6..b75c26c6a21919a27ef2a87ee5045ed83a32d5e7 100755 (executable)
--- a/docgen
+++ b/docgen
@@ -26,6 +26,7 @@ set input_directory ""
 set output_directory ""
 set title ""
 set icon ""
+set icon_height 0
 set footer ""
 set links ""
 
@@ -58,7 +59,7 @@ set genre_list {}
 puts "Docgen version $DOCGEN_VERSION"
 
 proc start_html {fid title toc dots} {
-       global links
+       global links 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>"
@@ -67,6 +68,10 @@ proc start_html {fid title toc dots} {
        puts $fid "             <link rel=\"stylesheet\" href=\"$dots/style.css\">"
        puts $fid "     </head>"
        puts $fid "     <body>"
+       if { "$icon" != "" } {
+               puts $fid "<img src=\"$dots/[file tail "$icon"]\" alt=\"logo\" style=\"position: absolute;left: 50px;\">"
+               puts $fid "             <div id=\"space\"></div>"
+       }
        puts $fid "             <div id=\"title\">$title</div>"
        puts $fid "             <a href=\"$dots\">Root</a>$links"
        puts $fid "             <div id=\"doc\">"
@@ -333,6 +338,11 @@ puts $fid "        padding: 5px 0;"
 puts $fid "    padding-left: 10px;"
 puts $fid "    text-align: left;"
 puts $fid "}"
+if { "$icon" != "" } {
+       puts $fid "#space {"
+       puts $fid "     height: [expr $icon_height - 40]px;"
+       puts $fid "}"
+}
 
 close $fid
 
index d6dd20b5e84d468b8a06d86fe70b87b83b1b12e6..b083dd33d7cabe14d28f345ef7cdcb2b214d8a1c 100644 (file)
@@ -6,3 +6,4 @@ set title "Example Project"
 set icon "icon.png"
 set footer "Some good footer"
 set links "<a href=\"http://nishi.boats\">nishi.boats</a>"
+set icon_height 96