Skip to content

Enable hierarchy in documented modules #50

@webholics

Description

@webholics

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.

//
// @name Buttons
// @description There are multiple button types.
// @depth 1
// 

... CSS code

//
// @name Regular Button
// @description Your standard form button.
// @depth 2
// 
// @state :hover - Highlights when hovering.
// @state :disabled - Dims the button when disabled.
// 
// @markup
//   <button>This is a button</button>
// 

... CSS code

//
// @name Special Button
// @description A special button.
// @depth 2
// 
// @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>
// 

... CSS code

The above code should then generate a hierarchical JSON output similar to:

{
  "name": "Buttons",
  "description": "There are multiple button types.",
  children: [{
    "name": "Regular Button",
    "description": "Your standard form button.",
    ...
  }, {
    "name": "Special Button",
    "description": "A special button",
    ...
  }]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions