JordyPouw / michelangelo

kss-node living styleguide theme.
http://jordypouw.github.io/michelangelo/
MIT License
52 stars 22 forks source link

`Deprecated:` prefix not supported #5

Closed ghost closed 6 years ago

ghost commented 6 years ago

The following markup contains a "deprecated" prefix in the description.

// Primary
//
// These buttons should be used in most cases.
//
// Deprecated:
// These buttons should be replaced with btn-primary buttons.
//
// Markup:
// <a href="#" class="button-red" role="button">Button</a>
// <a href="#" class="button-red active" role="button">Button Active</a>
// <a href="#" class="button-red disabled" role="button">Button Disabled</a>
//
// Weight: 1
//
// Style guide: Buttons.Primary

However, it gets rendered as a normal <p> with no additional classes:

<article class="kss-section__content">
  <p class="kss-section__source">Source: <span>components/buttons.less</span>, line <span>16</span></p>
  <a class="kss-section__permalink" href="#kssref-buttons-primary">
    <h3 class="kss-section__item kss-section__item--depth-2">
      <span class="kss-section__ref">3.1</span>
      <span class="kss-section__name">Primary</span>
    </h3>
  </a>
  <div class="kss-section__description">
    <p>These buttons should be used in most cases.</p>
    <p>Deprecated:
      These buttons should be replaced with btn-primary buttons.
    </p>
  </div>
</article>
JordyPouw commented 6 years ago

@steigenTI Where did you find this 'deprecated' prefix in the kss-node documentation?

ghost commented 6 years ago

Not sure if documentation for this exists in the kss-node docs. However, it is part of the original KSS docs. There are actually two prefixes: deprecated and experimental.

https://github.com/kss-node/kss/blob/spec/SPEC.md

To describe the status of a set of rules, you should prefix the description with Experimental or Deprecated.

Experimental indicates CSS rules that apply to experimental styling. This can be useful when testing out new designs before they launch (staff only), alternative layouts in A/B tests, or beta features.

// Experimental: An alternative signup button styling used in AB Test #195.
Deprecated indicates that the rule is slated for removal. Rules that are deprecated should not be used in future development. This description should explain what developers should do when encountering this style.
// Deprecated: Styling for legacy wikis. We’ll drop support for these wikis on
// July 13, 2007.

I also found the relevant parts of the kss-node parser:

https://github.com/kss-node/kss-node/blob/8f209380eacf9669b9bb0108a458237c0405ca82/lib/parse.js#L186-L188

https://github.com/kss-node/kss-node/blob/8f209380eacf9669b9bb0108a458237c0405ca82/lib/parse.js#L440-L451

JordyPouw commented 6 years ago

Added support for 'deprecated' and 'experimental'. @steigenTI Thank you for noticing. Will see if i can add some indicator in the navigation later on, so you got a quick overview of what is deprecated or experimental in your styleguide.

Current implementation: schermafbeelding 2018-06-15 om 15 07 56

schermafbeelding 2018-06-15 om 15 10 59