EightMedia / styleguide.js

Generate a styleguide from your CSS, by adding YAML data
193 stars 8 forks source link

parse include tags for array of example snippets #4

Open chopstikk opened 9 years ago

chopstikk commented 9 years ago

Hey, this is a fix for those using multiple snippets with include tags in the Example YAML, like this Example:

Aratramba commented 9 years ago

I'm not sure I see how this would be used. What's the difference with this example from the readme?

/***
  title: Includes
  section: Includes
  example: |
    <div class="btn-group">
        <include title="Links" section="Buttons">
        <include title="Links" section="Buttons">
        <include id="btn-link">
    </div>
***/

Could you give a more literal example?

chopstikk commented 9 years ago

In your example the cssYaml parser generates a string, but in this example:

example:
<div>Example A <include title="Links" section="Buttons"></div>
<div>Example B <include title="Links" section="Buttons"></div>

it would generate an array. If the parseIncludeTags function is invoked with html as an array, it would currently return without replacing the include tags.

Aratramba commented 9 years ago

i'm sorry about the delay. It seems all the tests are broken since the latest update - so i can't quickly test and check if everything works okay with your changes. I haven't much time this week to fix this. @jtangelder maybe?