-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable hierarchy in documented modules #50
Comments
@webholics the need to have nesting/groupings makes a lot of sense. That said, I don't like the idea of nesting in the JSON output (it starts to look like nested callbacks, which are ugly). To keep things nice and shallow, I've contemplated the idea of a default The For now, you can still accomplish this by writing comments similar to: //
// @name Buttons
// @description There are multiple button types.
//
...
//
// @name Regular Button
// @description Your standard form button.
// @extends Buttons
//
// @state :hover - Highlights when hovering.
// @state :disabled - Dims the button when disabled.
//
// @markup
// <button>This is a button</button>
//
...
//
// @name Special Button
// @description A special button.
// @extends Buttons
//
// @state :hover - Highlights when hovering.
// @state :disabled - Dims the button when disabled.
//
// @markup
// <button>This is a button <strong>with a fancy label</strong></button>
//
... And then use the extends: function(i, line, block){
// ...
} |
Extending via |
+1 |
Similar to #51, I may write a custom parser to show how this is done as it seems like it would be something people want to do. Not sure if I'll bake it into the defaults we provide just yet but we'll see. |
This has been around for about a year now @darcyclarke. Are you still actively looking at improving DSS? |
I like the syntax of DSS very much, especially when compared to KSS ( http://warpspire.com/kss/) because its more strict. But KSS has the advantage that it allows to express a hierarchical relationship between modules (through Styleguide X.X.... annotation). This makes it possible to group modules into logical chunks.
It would be nice to have some kind of syntactic sugar to express hierarchical relationships in DSS, too.
What I don't like in KSS is that the explicit numbering of the annotations is given by the author through
Styleguide 1.5.
. This leads to regular refactoring in bigger projects.One possible solution would be to just allow the annotation of the group depth in which the module should sit, e.g.
The above code should then generate a hierarchical JSON output similar to:
The text was updated successfully, but these errors were encountered: