SassDoc / sassdoc

Release the docs!
http://sassdoc.com
MIT License
1.41k stars 56 forks source link

Markdown in descriptions #115

Closed valeriangalliat closed 10 years ago

valeriangalliat commented 10 years ago

We document here that SassDoc will parse description strings as Markdown.

This is not really true; today it's the theme responsibility to parse the description as markdown.

This will make all themes require a Markdown module to decently display descriptions, and it's an overhead I think we can avoid (and we can also make it clear that the description is Markdown, and this won't be the theme's choice).

I propose we require some Markdown package in sassdoc (there's a lot of Markdown packages, I don't know which one to choose), rename the current description keys in rawDescription (to keep the original Markdown text), and put the generated HTML in description.

KittyGiraudel commented 10 years ago

Agreed. Who takes it?

KittyGiraudel commented 10 years ago

Tagged as 1.2.

FWeinb commented 10 years ago

I will take this! Will use marked to parse the markdown.

FWeinb commented 10 years ago

@valeriangalliat You might want to merge this: https://github.com/SassDoc/sassdoc/pull/118

valeriangalliat commented 10 years ago

Merged, I'm going to update the themes to use the pre-rendered documentation directly.

valeriangalliat commented 10 years ago

Hmm, looks like some other strings are parsed as Markdown in the views.

views/includes/annotations/todo.html.swig:      <li>{{ todo | markdown }}</li>
views/includes/annotations/parameters.html.swig:          <td data-label="desc">{{ parameter.description | markdown | default('&mdash;<span class="visually-hidden"> none</span>') | safe }}</td>
views/includes/annotations/author.html.swig:      <li>{{ author | markdown }}</li>
views/includes/annotations/throws.html.swig:      <li>{{ _throw | markdown }}</li>
views/includes/annotations/returns.html.swig:  <p class="sassdoc__item-description">{% if item.returns[0].description %}{{ item.returns[0].description | markdown }}{% endif %}
views/includes/partials/header.html.swig:      {{ package.description | markdown }}

I'm not sure what to do about this, maybe they should all be preprocessed as Markdown?

@HugoGiraudel, what do you think?

KittyGiraudel commented 10 years ago

They should.

FWeinb commented 10 years ago

Will fix these as well.

KittyGiraudel commented 10 years ago

Great. Then we'll be ready to release 1.2?

FWeinb commented 10 years ago

Did this directly on develop

valeriangalliat commented 10 years ago

Nice, so todo, author, _throw are all HTML strings? I'm updating the themes.

FWeinb commented 10 years ago
todo
parameters
author
throws
returns
package.description

These are all HTML.

valeriangalliat commented 10 years ago

Okay, I upgraded sassdoc-theme-{light,dark}.

valeriangalliat commented 10 years ago

There's a problem... the title is wrapped with a <p> but we display it in a header tag...

FWeinb commented 10 years ago

Which title?

valeriangalliat commented 10 years ago

Oops my bad, wait a minut... :(

valeriangalliat commented 10 years ago

The theme was not updated, I think because I installed with npm install and it was not in the package.json, false alert.