-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
188 lines (118 loc) · 5.76 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html>
<head>
<title>Docco</title>
<meta charset="UTF-8">
<link rel="stylesheet" media="all" href="public/stylesheets/normalize.css" />
<link rel="stylesheet" media="all" href="docs/docco.css" />
</head>
<body>
<div class="container">
<div class="page">
<div class="header">
<h1 id="docco">Docco</h1>
<div class="toc">
<h3>Table of Contents</h3>
<ol>
<li>
<a class="source" href="cli.html">
lib/cli.js
</a>
</li>
<li>
<a class="source" href="configure.html">
lib/configure.js
</a>
</li>
<li>
<a class="source" href="defaults.html">
lib/defaults.js
</a>
</li>
<li>
<a class="source" href="docco.html">
lib/docco.js
</a>
</li>
<li>
<a class="source" href="document.html">
lib/document.js
</a>
</li>
<li>
<a class="source" href="format.html">
lib/format.js
</a>
</li>
<li>
<a class="source" href="index.html">
lib/index.js
</a>
</li>
<li>
<a class="source" href="languages.html">
lib/languages.js
</a>
</li>
<li>
<a class="source" href="parse.html">
lib/parse.js
</a>
</li>
<li>
<a class="source" href="write.html">
lib/write.js
</a>
</li>
</ol>
</div>
</div>
<p><strong>Docco-ES</strong> is a quick-and-simple documentation generator, written in
<a href="https://babeljs.io/learn-es2015/">modern, ES2015+, JavaScript</a>.</p>
<p>It produces an HTML document that displays your comments intermingled with your
code. All prose is passed through
<a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a>, and code is
passed through <a href="http://highlightjs.org/">Highlight.js</a> for syntax highlighting.</p>
<p>This page is actually the result of running Docco against its own
<a href="https://github.com/abritinthebay/docco-es/blob/master/docco.js">source file</a>.</p>
<ol>
<li>Install Docco with <strong>npm</strong>: <code>npm install -g docco</code></li>
<li>Run it against your code: <code>docco src/*.js</code></li>
</ol>
<p>There is no Step 3.</p>
<p>This will generate an HTML page for each of the named
source files, with a menu linking to the other pages, saving the whole mess
into a <code>docs</code> folder (configurable).</p>
<p>The <a href="http://github.com/abritinthebay/docco-es">Docco-ES source</a> is available on GitHub,
and is released under the MIT License.</p>
<p>Docco can be used to process code written in any programming language. If it
doesn’t handle your favorite yet, feel free to
<a href="https://github.com/abritinthebay/docco-es/blob/master/resources/languages.json">add it to the list</a>.
Finally, the <a href="http://coffeescript.org/#literate">“literate” style</a> of <em>any</em>
language is also supported — just tack an <code>.md</code> extension on the end:
<code>.js.md</code>, <code>.py.md</code>, and so on.</p>
<h2 id="partners-in-crime-">Partners in Crime:</h2>
<p>Docco-ES is based on the excellent work of Jeremy Ashkenas who wrote the <a href="https://github.com/jashkenas/docco">original Docco</a>
in CoffeeScript. This fork was created to add features and to work with modern JS technologies
and language features that didn’t exist when it was original written or that
CoffeeScript does not support.</p>
<h2 id="how-we-generation-documentation">How We Generation Documentation</h2>
<p>We generate the documentation for our configured source file(s) by:</p>
<ul>
<li>copying over static assets</li>
<li>reading all the source files in</li>
<li>splitting them up into prose/code sections</li>
<li>highlighting each file in the appropriate language</li>
<li>printing them out in a template</li>
</ul>
<p>This is the index file so it mostly just sets up the code to run.
In this case we want to use ESModules, so are enabling that,
then we export the default export of the core <code>docco.js</code> file.
For a more in-depth look at the code in the other files.</p>
<div class='highlight'><pre><span class="hljs-built_in">require</span> = <span class="hljs-built_in">require</span>(<span class="hljs-string">"@std/esm"</span>)(<span class="hljs-built_in">module</span>);
<span class="hljs-built_in">module</span>.exports = <span class="hljs-built_in">require</span>(<span class="hljs-string">"./docco.js"</span>).default;</pre></div>
<div class="fleur">h</div>
</div>
</div>
</body>
</html>