styledocco
Advanced tools
Comparing version 0.2.8 to 0.2.9
(function() { | ||
var cssFile, cssFileOut, file, files, findit, fs, generateFile, getSections, jade, key, langs, link, menu, mkdirp, optimist, options, parser, parts, path, readme, sections, sources, templateFile, writeFile, _, _i, _len; | ||
var file, files, findit, fs, generateFile, getResourcePath, getSections, jade, key, langs, link, menu, mkdirp, optimist, options, parser, parts, path, readme, sections, sources, templateFile, writeFile, writeStaticFile, _, _i, _len; | ||
@@ -26,5 +26,11 @@ fs = require('fs'); | ||
templateFile = path.existsSync(path.join(options.tmpl, 'docs.jade')) ? path.join(options.tmpl, 'docs.jade') : path.resolve(__dirname, '../resources/docs.jade'); | ||
getResourcePath = function(fileName) { | ||
if (path.existsSync(path.join(options.tmpl, fileName))) { | ||
return path.join(options.tmpl, fileName); | ||
} else { | ||
return path.resolve(__dirname, path.join('../resources', fileName)); | ||
} | ||
}; | ||
cssFile = path.existsSync(path.join(options.tmpl, 'docs.css')) ? path.join(options.tmpl, 'docs.css') : path.resolve(__dirname, '../resources/docs.css'); | ||
templateFile = getResourcePath('docs.jade'); | ||
@@ -134,9 +140,15 @@ getSections = function(filename) { | ||
cssFileOut = path.join(options.out, 'docs.css'); | ||
writeStaticFile = function(fileName) { | ||
var outPath; | ||
outPath = path.join(options.out, fileName); | ||
if (options.overwrite || !path.existsSync(outPath)) { | ||
fs.writeFileSync(outPath, fs.readFileSync(getResourcePath(fileName), 'utf-8')); | ||
return console.log("styledocco: writing " + outPath); | ||
} | ||
}; | ||
if (options.overwrite || !path.existsSync(cssFileOut)) { | ||
fs.writeFileSync(cssFileOut, fs.readFileSync(cssFile, 'utf-8')); | ||
console.log("styledocco: writing " + cssFileOut); | ||
} | ||
writeStaticFile('docs.css'); | ||
writeStaticFile('docs.js'); | ||
}).call(this); |
@@ -9,3 +9,3 @@ { | ||
"author": "Jacob Rask <jacob@jacobrask.net>", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"homepage": "http://jacobrask.github.com/styledocco/", | ||
@@ -12,0 +12,0 @@ "licenses": [ |
@@ -1,8 +0,6 @@ | ||
``` | ||
_______ __ __ _____ | ||
<pre><samp> _______ __ __ _____ | ||
| __| |_.--.--| |-----.| \-----.----.----.-----. | ||
|__ | _| | | | -__|| -- | _ | __| __| _ | | ||
|_______|____|___ |__|_____||_____/_____|____|____|_____| | ||
|_____| | ||
``` | ||
|_____|</samp></pre> | ||
@@ -22,7 +20,7 @@ StyleDocco generates documentation and style guide documents from your stylesheets. | ||
StyleDocco requires [Node.js](http://nodejs.org). | ||
StyleDocco requires [Node.js](http://nodejs.org). When you have Node.js installed, run | ||
`npm install -g styledocco` | ||
<pre><kbd>npm install -g styledocco</kbd></pre> | ||
or check out this repository. | ||
or clone the [GitHub repository](https://github.com/jacobrask/styledocco). | ||
@@ -61,18 +59,30 @@ StyleDocco is free software, released under the [MIT license](https://raw.github.com/jacobrask/styledocco/master/LICENSE). | ||
/* | ||
<button class="btn primary">Primary</button> | ||
### Stylesheet | ||
<pre><code>/* | ||
<button class="btn primary">Primary</button> | ||
Provides extra visual weight and identifies the primary action in a set of buttons. */ | ||
.btn.primary { | ||
background: steelblue; | ||
color: snow; | ||
border: 1px solid steelblue; | ||
}</code></pre> | ||
Provides extra visual weight and identifies the primary action in a set of buttons. */ | ||
.btn.primary { | ||
background: blue; | ||
color: white; | ||
} | ||
<!-- Special case for this readme example only --><style> | ||
.btn.primary { background: steelblue; color: snow; border: 2px outset steelblue; }</style> | ||
Would display the description, a button as well as the example HTML code. The CSS will be included in the `style` element of the document. | ||
### Output | ||
See the `examples` folder for more in-depth examples. | ||
Provides extra visual weight and identifies the primary action in a set of buttons. | ||
<button class="btn primary">Primary</button> | ||
This page is an example itself, as it was generated from the StyleDocco readme file. The [docs](resources/docs.html) file is the documentation of the default StyleDocco CSS file. | ||
An additional example was generated from a modified file of the [Twitter Bootstrap](examples/bootstrap/docs/less/buttons.html) project. | ||
## Acknowledgements | ||
A lot of the heavy lifting in StyleDocco is done by the excellent [Marked](https://github.com/chjj/marked) module by Christopher Jeffrey. The original [Docco](https://github.com/jashkenas/docco) by Jeremy Ashkenas and [Docco Husky](https://github.com/mbrevoort/docco-husky) by Mike Brevoort were also of great help to this project. [Knyle Style Sheets](https://github.com/kneath/kss) is a similar project written in Ruby, and has also been an inspiration to StyleDocco. | ||
<a href="https://github.com/jacobrask/styledocco" id="styledocco-fork-me"><img style="position:fixed;top:0;right:0;border:0;" src="https://a248.e.akamai.net/assets.github.com/img/7afbc8b248c68eb468279e8c17986ad46549fb71/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
375751
59
1845
87