mpetrovich / stylemark

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

Allow documentation for a single component to be split across multiple files #29

Closed mpetrovich closed 4 years ago

mpetrovich commented 6 years ago

Prompted by https://github.com/nextbigsoundinc/stylemark/pull/13

The documentation would be combined into a single doc as if it had always existed in a single file.

Example

example-1.md:

---
name: Example
category: Examples
---
This is the first example.
```example-1.html
<em>Hello, world!</em>
```

example-2.md:

---
name: Example
category: Examples
---
This is the second example.
```example-2.html
<em>Hello, again!</em>
```

This should be handled equivalently to:

---
name: Example
category: Examples
---
This is the first example.
```example-1.html
<em>Hello, world!</em>
```
This is the second example.
```example-2.html
<em>Hello, again!</em>
```

Open questions

  1. In what order should files be combined?

    • Alphabetically?
  2. How should conflicting sets of front matter be handled?

    • Use only the first one?
    • Merge all, with the first (or last) values taking precedence if there are conflicts?