Comments (13)
Hi @sarahquigley!
You can define multiple sources by using multiple --kss-source
args, e.g.
styleguide --kss-source styles/*.scss --kss-source module1/styles/*.scss
It's not apparent from the documentation alone, we'll fix that, thanks for bringing it to our attention!
from sc5-styleguide.
Hi @jpbackman,
Thanks so much for your incredibly prompt reply. Your tip worked a charm - one of those things that's obvious in hindsight. It would be great to add documentation for that.
Following up from this, I had a question / suggestion. Do you have any support for a config file (perhaps a .json file), where these kind of config options for the styleguide command could be placed - lists of kss-sources, style-sources, other options etc.? This is a common set up with other tools I've used eg. Jsdoc, Karma.
If you do not support such a thing, would you consider adding support in the future for a config file like this? Though it is certainly not essential, it would be a great convenience.
Thanks again for your help - it's great to get such a quick responses!
from sc5-styleguide.
@sarahquigley currently there is no support for a config file per se, but as a workaround you could place the config options into a .json file, switch from the CLI to the gulp version, require()
the json file in your gulpfile and just pass the config keys to the styleguide gulp tasks. The current CLI module is actually just a simple wrapper for gulp, see styleguide-cli.js for example.
Also, with gulp you can pass an array of node-glob / globstar patterns to gulp.src
, with which you could list the patterns in your original example as gulp.src('**/*.scss')
, or if want to include only some dirs, you could use gulp.src('{styles,module1,module2,module3}/**/*.scss')
, etc.
from sc5-styleguide.
Hi @sarahquigley,
I encountered the same issue. My directory layout is
styles/generic/_.less
styles/generic/base/_.less
The solution with multiple --kss-source entries in command line does not seem to work for me. This is the command line I use
styleguide --kss-source styles/generic/base/.less --kss-source styles/generic/.less --style-source "assets/css
/main-styles.css" --output doc/styleguide --watch --server --overview-path=styles/styleguide.md
The tool does not give an error but hangs on 'Generating style guide to output dir:doc/styleguide'.
Any ideas on how to solve this?
I work on Windows, and styles are less stylesheets.
from sc5-styleguide.
Nevermind, it seems like a different issue, because even when I let it run on only the second folder (no multiple --kss-source) the tool seems to hangs.
from sc5-styleguide.
@kr3l Your issue could be that you are missing quotes around the paths to your --kss-source files.
Commands formatted as in the example below have given me an error:
styleguide
--kss-source styles/generic/base/.less
--kss-source styles/generic/.less
--style-source "assets/css/main-styles.css"
--output doc/styleguide --watch --server
While running commands formatted as in the example below have worked fine for me:
styleguide
--kss-source "styles/generic/base/.less"
--kss-source "styles/generic/.less "
--style-source "assets/css/main-styles.css"
--output doc/styleguide --watch --server
As I said, the key seems to be the missing quotes around the --kss-source.
from sc5-styleguide.
@jpbackman Thanks for getting back to me. The project I'm working on uses Grunt for tooling. I tried out the Grunt task in your README, but failed to get it to work. I plan to try it again in the near future.
from sc5-styleguide.
@sarahquigley It turns out a syntax error in one of the less files was the cause of the problems (I used ; instead of , to separate variables of a mixin). The less compiler didn't complain about it, but by fixing the typo I was able to run the styleguide tool.
from sc5-styleguide.
@kr3l Ah, I have encountered similar issues with .scss files.
from sc5-styleguide.
@jpbackman Have you encountered the issue I described above with the omitting the quotations around the --kss-source args? I was surprised to find this caused me issues.
from sc5-styleguide.
I am using the gulp version. I have this issue as well. What I found is that if I try to specify
gulp.src('assets/**/*.scss')
Gives the Erorr
Error: Please, pass a string to parse
it tells me that no tree exists.
If I specify -
gulp.src('assets/*.scss')
it works, but only for the files located within assets. No files that are within additional directories within assets.
gulp.src(['/assets/*.scss', '/assets/**/*.scss'])
This causes a error that tells me to pass in a string.
gulp.src(['assets/scss/*.scss', 'assets/scss/components/_teaser.scss'])
This works, for the ONE additional file ('_teaser.scss') but does not grab all the files in components.
Additionally, if I increase the number of files it also gives me the same 'Error: Please, pass a string to parse'.
gulp.src(['assets/scss/*.scss', 'assets/scss/components/_teaser.scss', 'assets/scss/components/_addthis.scss'])
Wildcard Does not work still...
gulp.src(['assets/scss/*.scss', 'assets/scss/components/*.scss'])
This goes back to not working. Apparently I can only pass ONE wildcard file. I can not pass ANY wildcard folder.
Thanks.
from sc5-styleguide.
Ok I figured out my own problem.
The issue is that if you have multiple files, and any file is blank with nothing to parse for KSS, it gives the string error pointed out above. This causes it to fail for all files if it detects one empty file.
from sc5-styleguide.
I am closing this as I believe none of the issues described here exist anymore. Do not hesitate to file new issues for any remaining problems.
from sc5-styleguide.
Related Issues (20)
- Generate static docs
- Error in Demo Build HOT 3
- Wrapper markup PUG
- Search not working to well HOT 1
- Unable to parse custom variables
- Line comments in default CSS results in parse error
- App styles not working after updating to version 2.0.4 HOT 12
- Test suite fails to run without mocha dependency HOT 1
- Markdown code block html entities HOT 2
- Element states like :hover doesn't work
- namespaced positions.
- Please publish v2.1.0 to npm HOT 5
- customColors option is breaking Gulp watch
- gulp-util is deprecated, consider replacing it to support Gulp v4 HOT 2
- After 2.1.0 update - ERROR: Unable to exclude default styles HOT 7
- Broken background-image paths
- Find DOM element with jQuery
- Prevent source files being copied inside of the destination folder
- failing unit tests
- (security alert) morgan needs to be updated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sc5-styleguide.