optimizely / scribesass-parser Goto Github PK
View Code? Open in Web Editor NEWAutomatically generate documentation for Sass files.
Automatically generate documentation for Sass files.
Providing the Sass and AST seems like to much repetition.
Some of the ASTs have newlines at the end that mess with the padding in the themes once converted to SCSS.
Compile the Sass and display the outputted color next to it.
$color: (
ui: (
white : $base-white,
faint : map-fetch($root-color, grey-03),
light : map-fetch($root-color, grey-06),
base : map-fetch($root-color, grey-12),
medium : map-fetch($root-color, grey-40),
dark : map-fetch($root-color, grey-85),
brand : map-fetch($root-color, brand),
brand-light : map-fetch($root-color, brand-light),
brand-dark : map-fetch($root-color, brand-dark),
warning : map-fetch($root-color, warning),
bad-news : map-fetch($root-color, bad-news),
good-news : map-fetch($root-color, good-news)
),
link: (
base : map-fetch($root-color, brand),
brand-light : map-fetch($root-color, brand-light),
bad-news : map-fetch($root-color, bad-news),
white : $base-white
),
background: (
base : $base-white,
white : $base-white,
faint : map-fetch($root-color, grey-03),
light : map-fetch($root-color, grey-06),
muted : map-fetch($root-color, grey-35),
medium : map-fetch($root-color, grey-50),
black : $base-black,
brand : map-fetch($root-color, brand),
brand-dark : map-fetch($root-color, brand-dark),
brand-light : #F2F7FC,
warning : #FCF8E3,
bad-news : #F9E3E4,
good-news : #E9F6C3
),
text: (
base : map-fetch($root-color, grey-85),
white : $base-white,
faint : map-fetch($root-color, grey-12),
light : map-fetch($root-color, grey-25),
muted : map-fetch($root-color, grey-35),
medium : map-fetch($root-color, grey-50),
dark : map-fetch($root-color, grey-85),
brand : map-fetch($root-color, brand),
brand-dark : map-fetch($root-color, brand-dark),
warning : map-fetch($root-color, warning),
bad-news : map-fetch($root-color, bad-news),
good-news : map-fetch($root-color, good-news)
)
);
Currently the user can define any annotation. This might be the case eventually but I'd like limit it for now.
By default, only one will be supported. The JS should be modified to support multiple.
This would be used for searching through the output for keywords. For example, an "attention" bar object could be aliased to alert.
This can be used to display a version of the SCSS that doesn't have comments.
Files can be grouped with the @group
annotation, so it would be helpful to provide a function that returns an array groups and the corresponding file objects.
Proposal:
var scribeSass = require('scribesass-parser');
scribeSass.create('main.scss', function(files) {
// Get an array of group objects containing files.
var groups = scribeSass.getGroups(files);
});
groups
would contain:
[
{
name: 'Objects',
files: [
{...},
{...}
]
}
]
File properties (name, for example) can be accessed by looping through the groups:
// Loop through the groups.
for (var i = 0; i < groups.length; i++) {
var group = groups[i];
for (var j = 0; j < group.files.length; j++) {
var file = group.files[j];
// Path to the file.
var path = file.path;
// Get object of file properties from AST.
var fileProperties = scribeSass.getFileProperties(file.ast);
}
}
Currently the parsed comments don't know what block of code they are referring to.
This relates to issue #1.
The format is:
/// @example html - Image that has a standard border around it.
/// <img src="http://fillmurray.com/100/100" class="img--border">
The JS should separate the language, description, and source.
This would not return the name of the first annotation unless a file-level comment is added.
/// Compass polyfills
/// @description Line 1
/// Line 2!
.foo {
color: red;
}
/// One more comment?
.bar {
color: blue;
}
This will actually modify the original AST instead of performing operations on a clone.
var scss = scribeSass.getScss(node.ast, true);
This comment relates to all the classes below it. There should be a way to indicate this.
/// Flex classes
.flex {
@include display(flex);
}
.flex-1 {
@include flex(1);
}
.flex-none {
@include flex(none);
}
.flex-wrap--wrap {
@include flex-wrap(wrap);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.