Permalink
Browse files

Doc generator: first attempt (thanks Node!)

  • Loading branch information...
1 parent d917a5c commit becc34a4bcf23bf8b0a8bd3da746132adcf705a5 @bpierre committed Nov 15, 2011
Showing with 1,877 additions and 0 deletions.
  1. +27 −0 Makefile
  2. +243 −0 doc/doc.css
  3. +22 −0 doc/template.html
  4. +137 −0 tools/doctool/doctool.js
  5. +1,448 −0 tools/doctool/markdown.js
View
@@ -0,0 +1,27 @@
+NODE_BIN = /usr/bin/env node
+
+all: doc
+
+clean:
+ rm -rf out
+
+docs_out = out/doc
+docs_md = $(wildcard doc/*.md)
+docs_html = $(addprefix out/,$(docs_md:.md=.html))
+
+doc: $(docs_out) $(docs_html)
+
+$(docs_out):
+ mkdir -p $@
+ mkdir -p $@/assets
+ cp doc/doc.css out/doc/assets/doc.css
+
+out/doc/%: doc/%
+ cp $< $@
+
+out/doc/%.html: doc/%.md
+ $(NODE_BIN) tools/doctool/doctool.js doc/template.html $< > $@
+
+.DEFAULT_GOAL := all
+
+.PHONY: clean
View
@@ -0,0 +1,243 @@
+/*--------------------- Layout and Typography ----------------------------*/
+body {
+ font-family: Georgia, FreeSerif, Times, serif;
+ font-size: 0.9375em;
+ line-height: 1.4667em;
+ color: #222;
+ margin: 0; padding: 0;
+}
+a {
+ color: #0050c0;
+ text-decoration: underline;
+}
+ a:visited {
+ color: #b950b7;
+ text-decoration: underline;
+ }
+ a:hover, a:focus {
+ text-decoration: none;
+ }
+
+ code a:hover {
+ background: none;
+ color: #b950b7;
+ }
+
+#changelog #gtoc {
+ display: none;
+}
+
+.notice {
+ display: block;
+ padding: 1em;
+ margin: 1.4667em 0 2.9334em;
+ background:#FFF6BF;
+ color:#514721;
+ border:1px solid #FFD324;
+}
+ .notice p {
+ margin: 0;
+ }
+
+ul.plain {
+ list-style: none;
+}
+
+abbr {
+ border-bottom: 1px dotted #454545;
+}
+
+p {
+ margin: 0 0 1.4667em 0;
+ position: relative;
+ text-rendering: optimizeLegibility;
+}
+
+ol, ul, dl {
+ margin: 0 0 1em 0;
+ padding: 0;
+}
+
+ol ul, ol ol, ol dl,
+ul ul, ul ol, ul dl,
+dl ul, dl ol, dl dl {
+ margin-bottom: 0;
+}
+
+ol p:first-child, ul p:first-child, dl p:first-child {
+ margin-bottom: 0;
+}
+
+ul, ol {
+ margin-left: 2em;
+}
+
+
+dl dt {
+ position: relative;
+ margin: 1.5em 0 0;
+}
+
+dl dd {
+ position: relative;
+ margin: 0 1em 0;
+}
+
+dd + dt.pre {
+ margin-top: 1.6em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: Georgia, FreeSerif, Times, serif;
+ color: #000;
+ text-rendering: optimizeLegibility;
+ position: relative;
+}
+
+h1 {
+ font-size: 2.55em;
+ line-height: 1.375em;
+}
+
+h2 {
+ font-size: 1.9em;
+ line-height: 1.227em;
+ margin: 0 0 0.5em;
+}
+
+h3 {
+ font-size: 1.5em;
+ line-height: 1.0909em;
+ margin: 1.5em 0 0.5em;
+}
+
+h3 + h3 {
+ margin: 0 0 0.5em;
+}
+
+h4 {
+ font-size: 1.3em;
+ line-height: 1.1282em;
+ margin: 2.2em 0 0.5em;
+}
+
+h4 + h4 {
+ margin: 0 0 0.5em;
+}
+
+ h3 a,
+ h4 a {
+ font-size: 0.8em;
+ float: right;
+ color: #000;
+ text-decoration: none;
+ opacity: 0.3;
+ }
+
+h5 {
+ font-size: 1.125em;
+ line-height: 1.4em;
+}
+
+h6 {
+ font-size: 1em;
+ line-height: 1.4667em;
+}
+
+ pre, tt, code {
+ font-size: 0.95em;
+ line-height: 1.5438em;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ margin: 0; padding: 0;
+ }
+
+ .pre {
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ line-height: 1.5438em;
+ font-size: 0.95em;
+ }
+
+ pre {
+ padding: 2em 1.6em 2em 1.2em;
+ vertical-align: top;
+ background: #f8f8f8;
+ border: 1px solid #e8e8e8;
+ border-width: 1px 1px 1px 6px;
+ margin: -0.5em 0 1.1em;
+ }
+
+ pre + h3 {
+ margin-top: 2.225em;
+ }
+
+code.pre {
+ white-space: pre;
+}
+
+#container {
+ position: relative;
+ padding: 6em;
+ max-width: 50em;
+ text-align: left;
+}
+
+#container header {
+ margin: 1.25em -0.5em 1.3em;
+ padding: 0 0.5em 0.225em;
+}
+
+hr {
+ background: none;
+ border: medium none;
+ border-bottom: 1px solid #ccc;
+ margin: 5em 0 2em;
+}
+
+#container header hr {
+ margin: 0;
+ padding: 0;
+}
+
+#toc {
+
+}
+
+ #toc h2 {
+ font-size: 1em;
+ line-height: 1.4em;
+ }
+
+ #toc h2 a {
+ float: right;
+ }
+
+ #toc hr {
+ margin: 1em 0 2em;
+ }
+
+p tt, p code {
+ background: #f8f8ff;
+ border: 1px solid #dedede;
+ padding: 0 0.2em;
+}
+
+a.octothorpe {
+ text-decoration: none;
+ color: #777;
+ position: absolute;
+ top: 0; left: -1.4em;
+ padding: 1px 2px;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+}
+ p:hover > a.octothorpe,
+ dt:hover > a.octothorpe,
+ dd:hover > a.octothorpe,
+ h1:hover > a.octothorpe,
+ h2:hover > a.octothorpe,
+ h3:hover > a.octothorpe,
+ h4:hover > a.octothorpe,
+ h5:hover > a.octothorpe,
+ h6:hover > a.octothorpe {
+ opacity: 1;
+ }
View
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8" />
+ <title>{{section}}modul.io documentation</title>
+ <link type="image/x-icon" rel="icon" href="/favicon.ico" />
+ <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico" />
+ <link rel="stylesheet" href="assets/doc.css" type="text/css" media="all" />
+</head>
+<body>
+ <div id="container">
+ <header>
+ <h1>modul.io documentation</h1>
+ <div id="gtoc">
+ <p><a href="./">Index</a></p>
+ </div>
+ <hr />
+ </header>
+ {{content}}
+ </div>
+</body>
+</html>
Oops, something went wrong.

0 comments on commit becc34a

Please sign in to comment.