Closed feebala closed 6 years ago
Note that the styleguide was generating perfectly when I had the markdown inside my .scss files, but it was getting unwieldy and messy, so a dedicated file made more sense.
Last note: I got it working again (Very fussy on the spacing!) but only the first block renders correctly - Can a single markdown file not contain more than one component/block?
I'm able to recreate the problem based on your example above. The issue is that the closing backticks (```) need to be on their own line. Once you do that, it works as expected.
Good:
</table>
```
Bad:
</table>```
I should have noted - The closing backticks are on their own line in my code. They're inline with the closing tag here only because it was the only way to include them here (I'd need a double set of closing backticks to emulate what I have in my markdown file, and it was rendering weirdly with the double set on individual lines.)
You can use triple tildes ~~~
instead of triple backticks on GitHub. They’re equivalent and useful for cases such as yours.
You can use triple tildes ~~~ instead of triple backticks on GitHub. They’re equivalent and useful for cases such as yours.
Good to know! However, my original issue is still a problem - namely that a markdown file with multiple blocks (even with the closing back ticks on their own line) doesn't generate the correctly formatted output.
Here's the full markdown file code for reference: https://codepen.io/feebala/pen/qoLgqP
OK, I'll reopen and investigate further.
Oh, now I see what you're trying to achieve. Multiple components—not code blocks—per markdown file.
Unfortunately, multiple components per Markdown file is not supported at this time, and there are currently no plans to support it in the future. This is because we use Markdown front matter to identify a component, and front matter is a strictly one-per-file block at the beginning of a Markdown file.
In contrast, documenting multiple components in the same file is supported when you're documenting them as source code comments (ie. in your CSS/JS files).
For your situation, you'd need to split out your components into individual Markdown files—one per component.
Ah ok. Thanks for clarifying and taking the time to investigate 👍
I'm using a dedicated markdown file in the directory I'm watching to generate the styleguide - but it's not generating the guide. It registers that a change has been made to the file (so I know it's watching the .markdown file) but nothing updates on the front end. The log doesn't show any errors, i.e. in terminal, so I'm not sure if this is a bug or an issue with the markdown file itself...
My code for the file looks like a series of blocks like this: