build_html_preview.sh 774 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # needs to be run in the directory the html snippets are in
  3. [[ "$1" == "-f"* ]] && cat <<EOF || echo "<style>"
  4. <html><head><meta http-equiv="content-type" content="text/html">
  5. <style type="text/css" media="screen">
  6. body { margin: 5% 20%; }
  7. EOF
  8. cat <<EOF
  9. .author, pre, .block { font-family: monospace; }
  10. .block { display: inline-block; font-size: 13px; font-weight: bold; padding: 10px 13px; margin: 0 3px 6px 0; }
  11. pre {
  12. font-size: 14px;
  13. padding: 8px 16px;
  14. border-width:0
  15. }
  16. .previewbox { display: inline-block; width: 49%; margin:0; padding:1px; border-width:1px }
  17. </style>
  18. EOF
  19. [[ "$1" == "-f"* ]] && echo "<body>"
  20. echo "<div id=toc><ul>"
  21. cat *.listitem
  22. echo "</ul></div>"
  23. cat *.html
  24. [[ "$1" == "-f"* ]] && echo "</body></html>"
  25. exit 0