jacobrask / styledocco

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

Styles are not applied to previews #116

Closed Couto closed 10 years ago

Couto commented 10 years ago

Assuming a stylus file like:

//# Buttons

// ## Base Styles

// Standard black
//
// ```
// <a class="btn" href="#/somewhereovertherainbow">Click here</a>
// ```
//
// ```
// <button class="btn">Click Here</button>
// ```

.btn
    height: 36px
    background-color: black
    border: none

and the command:

styledocco -n project --precompressor stylus --out 'docs/ui' app/styles/ui/

I get a pretty documentation website... but without any style in the previews like so:

no-styles

This process pollutes my stylus folder with the compiled css files, and if without deleting those files, I call the previous command again, I'll get the correct output in the generated website, but with every menu in duplicate like so:

with-styles (yes the buttons are black... that's the correct style)

Am I doing something wrong or is this really a bug? I've read other issues like #25 but no luck at all...

Couto commented 10 years ago

I'm closing this issue, since I should blame the grunt-task instead of the styledocco itself. Sorry for my mistake.

marrs commented 10 years ago

Thanks for raising the issue. Whether it's a fault with Styledocco or not, it's good to know what problem people are having.

Styledocco does a bad job of alerting users to incorrectly written comments (see #84 and #85). In this case it appears that you haven't indented the example HTML. Indenting the HTML should make Styledocco aware of it.

Couto commented 10 years ago

I can't physically test your point right now, so I'm just asking this out of curiosity (and a bit of lazyness I must add):

If I wrap my HTML example with the triple accent (```). Do I still have to indent the code?

If so... then yes my example is totally wrong, but I feel that should be a little more explicit in the documentation, since it referes that the users can use ``` just like in the github flavored markdown and that is not necessary on the latter. ex:

<a class="btn" href="#/somewhereovertherainbow">Click here</a>
marrs commented 10 years ago
If I wrap my HTML example with the triple accent (```). Do I still have to indent the code?

I'm pretty sure you do and I agree with you that this should be improved. I want Styledocco to be much more aware of the contents of comments and just do the right thing with them. Detecting HTML is an obvious first step. The plan for putting this in is in the milestone.

Unfortunately I've not been able to make time for Styledocco for a while, beyond curating the project so I can't promise to complete the work any time soon. Of course, your or anyone else are welcome to make contributions. If they do the job, they will probably be merged in.