mpetrovich / stylemark

Generate interactive style guides from Markdown.
MIT License
218 stars 35 forks source link

Multiple sources of documentation for the same item #13

Closed dragoonDorise closed 6 years ago

dragoonDorise commented 6 years ago

This change allows us to split the component's documentation in more than one file to keep things organized.

Example:

1st source of documentation ( CSS ):

component.css -> Component Name + HTML example


---
name: Accordion
category: Components
---

Your description

2nd source of documentation ( JS ):

component.js - > Component JS methods, API, etc.

---
name: Accordion // Same name as in the CSS file
category: Components // Same name as in the CSS file
---
#Methods
| Name  | Description   |
|---|---|
|  $('#id').collapse() |  It toogles beetwen hidden / visible |
|  $('#id').collapse('show') |  It shows the collapse |
|  $('#id').collapse('hide')   | It hides the collapse  |

This would create a double item both in the sidebar and in the content, this jQuery hides the duplicated item in the sidebar and changes the style of the duplicated items in the content so the documentation appears as is the same item.

This could be better done editing the node.js files and handlebars to add a "subcategory" option but this is a, albeit dirty, faster way to implement it.

mpetrovich commented 6 years ago

Nice workaround!

However, a better solution will be to handle this during styleguide generation. I've created a separate issue to track this feature request, so please follow and comment if you'd like: https://github.com/nextbigsoundinc/stylemark/issues/29