Browse Source

better auto doc

Former-commit-id: e45a70c44ef6812069ded2e0f3df1ef20bc446fc
Alec Jacobson (jalec 11 years ago
parent
commit
3cc36dd0b2
2 changed files with 25 additions and 6 deletions
  1. 16 5
      scripts/doc.sh
  2. 9 1
      style.css

+ 16 - 5
scripts/doc.sh

@@ -9,17 +9,26 @@ echo "  <head>"
 echo "    <title>libigl auto-documentation</title>"
 echo '    <link href="./style.css" rel="stylesheet" type="text/css">'
 echo "  </head>"
-echo "  <body class=article_body>"
-echo "  <div class=article>"
+echo "  <body>"
+echo "  <div id=container>"
+echo "  <div class=article_outer>"
+echo "  <div class=article_inner>"
 echo "    <a href=.><img src=libigl-logo.jpg alt='igl logo' class=center></a>"
 echo "    <h1>libigl</h1>"
 echo "    Automatically generated documentation for <a href=.>libigl</a>."
 echo "    <h2>Headers:</h2>"
-echo "    <table>"
-echo "      <tr><th>.h file</th><th>Functions</th></tr>"
+echo "    <table class=full>"
+echo "      <colgroup>"
+echo "        <col span="1" style="width:300px">"
+echo "      </colgroup>"
+echo "      <tr class=header><th>.h file</th><th>Functions</th></tr>"
 # loop over all headers
 odd="0"
-for h in include/igl/*.h;
+HEADERS=`ls include/igl/*.h | \
+  ruby -ne 'puts $_.split("").map{|e| (e>="a"?e.upcase():e.downcase())}.join' | \
+  sort | \
+  ruby -ne 'puts $_.split("").map{|e| (e>="a"?e.upcase():e.downcase())}.join'`
+for h in $HEADERS
 do
   b=`basename $h`
   # only consider files that exist as proper .h/.cpp files (Those that don't
@@ -45,5 +54,7 @@ echo "    </table>"
 echo "    <p>See also: <a href=tutorial.html>tutorial</a>, <a href=style_guidelines.html>style guidelines</a>, <a href=file-formats/index.html>file formats</a></p>"
 echo "    <p>Automatically generated on `date` by scripts/doc.sh.</p>"
 echo "  </div>"
+echo "  </div>"
+echo "  </div>"
 echo "  </body>"
 echo "</html>"

+ 9 - 1
style.css

@@ -2,6 +2,13 @@ table
 {
   border-spacing: 0px;
 }
+
+table.full
+{
+  width: 100%;
+  table-layout: fixed;
+}
+
 tr.header th
 {
   border-bottom: 1px solid; 
@@ -48,9 +55,9 @@ tr.gotcha2 td
 tr pre
 {
   background-color: inherit;
+  border: 1px dashed #888;
   overflow: auto;
   padding: none;
-  border: none;
 }
 
 .note:before
@@ -188,3 +195,4 @@ li li { font-size: 90% }
 li li li { font-size: 80% }
 li li li li { font-size: 70% }
 li li li li li { font-size: 60%}
+