Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

styledocco

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styledocco - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

docs/docs.html

10

cli.js

@@ -91,11 +91,7 @@ 'use strict';

// Get custom or default template file
var templateFile = readFirstFile(
// Compile custom or default template
var template = jade.compile(readFirstFile(
options.resources + '/docs.jade',
defaultResourceDir + '/docs.jade'
);
// Compile the template
var template = jade.compile(templateFile, {
filename: templateFile
});
));

@@ -102,0 +98,0 @@ // Get custom or default CSS file

@@ -6,3 +6,3 @@ {

"author": "Jacob Rask <jacob@jacobrask.net>",
"version": "0.4.0",
"version": "0.4.1",
"homepage": "http://jacobrask.github.com/styledocco/",

@@ -9,0 +9,0 @@ "licenses": [ { "type": "MIT", "url": "http://github.com/jacobrask/styledocco/raw/master/LICENSE" } ],

@@ -11,8 +11,6 @@ ```

Stylesheet comments will be parsed through [Markdown](http://en.wikipedia.org/wiki/Markdown) and displayed in a generated HTML document. You can write code examples prefixed with 4 spaces (or between <code>```</code>, [GitHub code fences](http://github.github.com/github-flavored-markdown/)) in your comments, and StyleDocco both renders the HTML and shows the code example.
Stylesheet comments will be parsed through [Markdown](http://en.wikipedia.org/wiki/Markdown) and displayed in a generated HTML document. You can write code examples prefixed with 4 spaces or between [code fences](http://github.github.com/github-flavored-markdown/) (<code>```</code>) in your comments, and StyleDocco both renders the HTML and shows the code example.
An important philosophy of StyleDocco is to introduce as little custom syntax as possible, maintaining the stylesheet comments readable and useful even without StyleDocco.
The document is automatically split into a new sections when it encounters a horizontal rule. Only comments at the beginning of new lines are included so put some whitespace before a comment to exlude it from the style guide.
Suggestions, feature requests and bug reports are very welcome, either at [GitHub](https://github.com/jacobrask/styledocco/issues) or on Twitter ([@jacobrask](https://twitter.com/jacobrask)).

@@ -75,5 +73,10 @@

### Tips and tricks
* Put some whitespace before a comment block to exclude it from the documentation.
* Horizontal rules (`-----`, `* * *`, etc) will automatically create a new section in the documentation.
## 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 [Knyle Style Sheets](https://github.com/kneath/kss) have also been sources of inspiration for StyleDocco.

@@ -41,3 +41,4 @@ 'use strict';

var formatCode = function(str) {
return str + '\n';
// Truncate base64 encoded strings
return str.replace(/(;base64,)[^\)]*/, '$1...') + '\n';
};

@@ -106,12 +107,21 @@

.reduce(function(sections, cur) {
// Split into sections with headers as delimiters.
// Split into sections with hr's as delimiters.
var doc;
var docs = cur.docs;
// TODO: Make more elegant and easy to follow.
while (docs.length) {
if (sections.length === 0 || docs[0].type === 'hr') {
if (docs[0].type === 'hr') {
if (sections.length === 0) {
// First section
sections.push({ docs: [ docs.shift() ], code: '' });
} else if (docs[0].type === 'hr') {
// New section, ignore the hr.
docs.shift();
}
sections.push({ docs: [ docs.shift() ], code: '' });
if (docs.length) {
sections.push({ docs: [ docs.shift() ], code: '' });
} else {
// Nothing more after the hr in the doc block, start new section.
sections.push({ docs: [], code: '' });
}
} else {
// Add the documentation to the last section.
sections[sections.length-1].docs.push(docs.shift());

@@ -118,0 +128,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc