doc.sh 833 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. echo "<html>"
  3. echo " <head><title>IGL LIB documentation</title></head>"
  4. echo " <body>"
  5. echo " <h1>IGL LIB</h1>"
  6. echo " <h2>Headers:</h2>"
  7. echo " <table>"
  8. echo " <tr><th>.h file</th><th>Functions</th></tr>"
  9. # loop over all headers
  10. for h in include/igl/*.h;
  11. do
  12. b=`basename $h`
  13. if [ -e $h ]
  14. then
  15. printf " <tr id='$b'><td>$b</td>"
  16. fi
  17. # portion of file inside namespace
  18. html_nsp=`cat $h | perl -ne 'BEGIN{$p = 0;$\="<br>";} $o=$p;$p ^= $_=~"[{}]";print if $o && $p;'`
  19. #html_nsp=`echo -e $nsp | sed -e "s/</\&lt;/g" | sed -e "s/>/\&gt;/g" | tr '\n' '<br>'`
  20. #html_nsp=`echo -e $nsp | sed -e "s/</\&lt;/g" | sed -e "s/>/\&gt;/g" | sed -e "s/%/%%/g"`
  21. printf "<td>$html_nsp</td>"
  22. # Try to find functions and corresponding comments
  23. echo "</tr>"
  24. done
  25. echo " </body>"
  26. echo "</html>"