https://github.com/optimizely/scribesass-parser
Automatically generate documentation for Sass files.
https://github.com/optimizely/scribesass-parser
Last synced: 10 months ago
JSON representation
Automatically generate documentation for Sass files.
- Host: GitHub
- URL: https://github.com/optimizely/scribesass-parser
- Owner: optimizely
- Archived: true
- Created: 2015-07-28T18:13:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-25T06:41:30.000Z (over 6 years ago)
- Last Synced: 2025-03-16T13:42:15.385Z (12 months ago)
- Language: JavaScript
- Size: 63.5 KB
- Stars: 3
- Watchers: 104
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ScribeSass
Parse SCSS comments and return a JSON object.
## Usage
Require `scribesass-parser` and provide it a path to a `.scss` file.
```js
var scribeSass = require('scribesass-parser');
// Provide path to a file and receive an array of files containing `path` and `ast` properties.
scribeSass.create('main.scss', function(err, files) {
// Get an object of group objects containing file objects.
var groups = scribeSass.getGroups(files);
// Loop through the files.
for (var i = 0; i < files.length; i++) {
// Path to the file.
var path = files[i].path;
// Get SCSS from an AST.
var scss = scribeSass.getScss(files[i].ast);
// Get object of file properties from AST.
var fileProperties = scribeSass.getFileProperties(files[i].ast);
// Get array of parsed comment objects and ASTs from AST.
// ```js
// comments = [{
// properties = {...},
// ast = {...},
// }]
// ```
var comments = scribeSass.getComments(files[i].ast);
}
});
```