sassdoc icon indicating copy to clipboard operation
sassdoc copied to clipboard

Markdown

Open joeldrapper opened this issue 12 years ago • 2 comments

Would love to be able to write longer descriptions with markdown and various usage examples embedded with. Not sure how this would look.

joeldrapper avatar Oct 27 '12 21:10 joeldrapper

This should be doable.

The sassdoc parser just outputs a JSON object representing your documentation.

The viewer is then just Dust templates that consume that JSON object.

So there are two places we could implement Markdown: at the parser level, or at the viewer level. Not sure which is more appropriate. I'm inclined to say in the viewer, keeping the JSON object pure and exportable. We could use something like Showdown on the JS side with the viewer.

For now, you can use the @usage block, it's just not formatted with Markdwn support... yet :)

// calculate the width of a grid block
// @function  _getGridWidth
// ...
// @usage:
// _getGridWidth(10) => the width of 10 columns
// _getGridWidth(1/3, $of: 8) => the width of 1/3 of 8 columns
// _getGridWidth(5, $indent: (10px 0px)) => subtracts the $indent from the total width

Markdown support is definitely something I've been wanting myself too.

eoneill avatar Oct 27 '12 22:10 eoneill

I see. I thought that block was for the code block. Though I guess code blocks could be defined with markdown syntax.

joeldrapper avatar Oct 30 '12 11:10 joeldrapper