jacobrask / styledocco

Automatically generate a style guide from your stylesheets.
http://jacobrask.github.com/styledocco/
MIT License
1.07k stars 119 forks source link

Improve support of Compass #20

Open piouPiouM opened 12 years ago

piouPiouM commented 12 years ago

I'm a regular user of Compass and I realize that its support by StyleDocco is not obvious :-/ The limitations currently encountered are:

  1. Compass do not output the result of compilations in stdout but in separate files.
  2. The output of Compass look like the following:

    [31m   remove assets/img/main-sbcd23b880c.png
    [32m   create assets/img/main-sbcd23b880c.png
       remove assets/img/picto-sb2089cb79e.png
       create assets/img/picto-sb2089cb79e.png
    identical assets/css/style.css

    This output is inserting in the HTML document as a style tag instead of the generate CSS file.

  3. Compass projects frequently uses a configuration file to define the source files and the destination directory.
  4. The case of partial files is difficult to manage. Indeed, no individual CSS file is generated and therefore no example really applicable.
jacobrask commented 12 years ago

I have added an "--preprocessor none" option, could you use that and then @import your projects main CSS output file(s) from docs.css to solve 1, 2 and 4?

aripalo commented 12 years ago

I have to "+1" this issue about Compass support as well.

Importing Compass to my SASS project just gives errors when trying to create StyleDocco documentation.

I am currently getting around the issue by generating the documentation from compiled CSS rather than SCSS files. Unfortunately that isn't a perfect solution either, since it means:

  1. I have to use CSS comments /* */ which are slower/annoying to type
  2. There might be huge differences with the original SCSS and compiled CSS (and I'd really like to document the original SCSS)
  3. My documentation/styleguide section for single CSS file gets really, really long.

As my original SCSS is very modular and split into many smaller files, it would be a lot easier to navigate and understand the stylesheets if one could just view the single partial SCSS file.

jacobrask commented 12 years ago

I'd like to help out with this but I'm not really sure where to start as I haven't used Compass myself.

Could you point me to some project on GitHub that I could checkout as a test case?

leandono commented 12 years ago

Sass can work with Compass with the option --compass. So, to compile the documentation with Styledocco, the command is styledocco --preprocessor "sass --compass" sass/ (and works very well ;))

jina commented 12 years ago

Yes, I'd love for this to work with Compass, as well as other vendor Sass frameworks like Susy or Singularity (as it throws errors since they're vendor code coming from a gem, not stylesheets directly in my project directory). :)

Also, @dzignus I did what you said and it no longer barks about Compass not being found, but it doesn't seem to understand the compass mixins I'm using. So it's not working quite as well for me. :)

leandono commented 12 years ago

Hi, i just upload an example of the use of styledocco with Sass & Compass. The repository is https://github.com/dzignus/compass-styledocco-example regards

crccheck commented 12 years ago

I think I'm having the same issue. I'm trying to create styledocco docs of a SASS partial/include. I'm using --include to pull in the compiled css, but styledocco is still parsing the SASS partial. So the moment I include a mixin it breaks. I don't need any special support. I just need a way to turn off the preprocessor. StyleDocco v0.6.1

Update: If I just pass in a dummy preprocessor it works for me! (--preprocessor ls was the second one I tried, --preprocessor none was the first.)

marrs commented 11 years ago

@crccheck can you create a gist that shows what you are trying to do and what you expect from styledocco. I'm not fully understanding the problem right now.

yuvilio commented 11 years ago

Experiencing various kinks as well. Command I try. Tried various variants above

$ styledocco --verbose --out htdocs/docs --preprocessor "$(which compass)"   htdocs/scss/styles.scss

Also, using some functions like like compass-env() (for envrinoment detection) seems to throw it off and break styles. Using styledocco 0.6.2.