@@ -42,7 +42,7 @@ <h1 id="docco">Docco</h1>
42
42
source files, with a menu linking to the other pages, saving the whole mess
43
43
into a < code > docs</ code > folder (configurable).</ p >
44
44
< p > The < a href ="http://github.com/jashkenas/docco "> Docco source</ a > is available on GitHub,
45
- and is released under the < a href ="http://opensource .org/licenses/MIT " > MIT license </ a > .</ p >
45
+ and is released under the < a href ="http://lillicense .org/v1.html " > Lil License </ a > .</ p >
46
46
< p > Docco can be used to process code written in any programming language. If it
47
47
doesn’t handle your favorite yet, feel free to
48
48
< a href ="https://github.com/jashkenas/docco/blob/master/resources/languages.json "> add it to the list</ a > .
@@ -238,7 +238,12 @@ <h2 id="main-documentation-generation-functions">Main Documentation Generation F
238
238
< div class ='highlight '> < pre > < span class ="hljs-function "> < span class ="hljs-title "> write</ span > = < span class ="hljs-params "> (source, sections, config)</ span > -></ span >
239
239
< span class ="hljs-function ">
240
240
< span class ="hljs-title "> destination</ span > = < span class ="hljs-params "> (file)</ span > -></ span >
241
- path.join(config.output, path.basename(file, path.extname(file)) + < span class ="hljs-string "> '.html'</ span > )</ pre > </ div >
241
+ path.join(config.output, path.dirname(file), path.basename(file, path.extname(file)) + < span class ="hljs-string "> '.html'</ span > )
242
+ < span class ="hljs-function ">
243
+ < span class ="hljs-title "> relative</ span > = < span class ="hljs-params "> (file)</ span > -></ span >
244
+ to = path.dirname(path.resolve(file))
245
+ < span class ="hljs-keyword "> from</ span > = path.dirname(path.resolve(destination(source)))
246
+ path.join(path.relative(< span class ="hljs-keyword "> from</ span > , to), path.basename(file))</ pre > </ div >
242
247
243
248
244
249
@@ -251,12 +256,13 @@ <h2 id="main-documentation-generation-functions">Main Documentation Generation F
251
256
first = marked.lexer(firstSection.docsText)[< span class ="hljs-number "> 0</ span > ] < span class ="hljs-keyword "> if</ span > firstSection
252
257
hasTitle = first < span class ="hljs-keyword "> and</ span > first.type < span class ="hljs-keyword "> is</ span > < span class ="hljs-string "> 'heading'</ span > < span class ="hljs-keyword "> and</ span > first.depth < span class ="hljs-keyword "> is</ span > < span class ="hljs-number "> 1</ span >
253
258
title = < span class ="hljs-keyword "> if</ span > hasTitle < span class ="hljs-keyword "> then</ span > first.text < span class ="hljs-keyword "> else</ span > path.basename source
259
+ css = relative path.join(config.output, path.basename(config.css))
254
260
255
- html = config.template {sources: config.sources, css: path.basename(config.css) ,
256
- title, hasTitle, sections, path, destination,}
261
+ html = config.template {sources: config.sources, css,
262
+ title, hasTitle, sections, path, destination, relative }
257
263
258
264
< span class ="hljs-built_in "> console</ span > .log < span class ="hljs-string "> "docco: < span class ="hljs-subst "> #{source}</ span > -> < span class ="hljs-subst "> #{destination source}</ span > "</ span >
259
- fs.writeFileSync destination(source), html</ pre > </ div >
265
+ fs.outputFileSync destination(source), html</ pre > </ div >
260
266
261
267
262
268
0 commit comments