0.0.1 • Published 7 years ago

docss-parser v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Docss parser

This is utility parser for CSS, LESS, STYLUS, SASS and SCSS code. This project does static file analysis and parsing to generate data to be used by docss.

Examples

Example Comment Block Format
/*doc
---
title: Buttons
name: button
category: Base CSS
---

Button styles can be applied to any element. Typically you'll want to use either a `<button>` or an `<a>` element:

```html_example
<button class="btn btnDefault">Click</button>
```
*/
Simple Usage
// Requirements
const fs = require( 'fs' )
const parser = require('docss-parser')

// Get file contents
const fileContents = fs.readFileSync('styles.css')

// Run the Parser on the file contents
parser(fileContents)
Example Output
[{
  "title": "Input fields",
  "name": "input",
  "category": "Base CSS",
  "content": "\nButton styles can be applied to any element. Typically you'll want to use either a `<button>` or an `<a>` element:\n\n```html_example\n<button class=\"btn btnDefault\">Click</button>```"
}]