Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Allow to add description to groups #520

Closed
xi opened this issue Dec 21, 2017 · 9 comments
Closed

Feature request: Allow to add description to groups #520

xi opened this issue Dec 21, 2017 · 9 comments
Labels

Comments

@xi
Copy link
Contributor

xi commented Dec 21, 2017

I would like to add an introductory text to a group. In my case, there is one group per file, so my initial idea was to use the (so far unused) poster description. However, I realize that this does not work in general.

I would be open to doing the implementation myself. Unfortunately I do not really know where to start.

@xi xi changed the title Allow to add description to groups Feature request: Allow to add description to groups Dec 21, 2017
@pascalduez
Copy link
Member

Hi,

this is currently doable by using custom annotations and theme.

For this to land into Sassdoc's core it probably means creating a new annotation or extending the current @group one, then extend the default theme to support it (or not).
It would need to gather a bit of interest and validation beforehand though.

@xi
Copy link
Contributor Author

xi commented Dec 22, 2017

Thanks for the feedback! I tried two implementations:

Do you think any of these has the potential to be included in sassdoc?

@robsonsobral
Copy link

This could be a great addition.

@midorikocak
Copy link

Can you make a pull request?

@xi
Copy link
Contributor Author

xi commented Jan 5, 2019

I am waiting for feedback from the maintainers which approach I should implement. If you would like to raise the priority of this issue a "thumbs up" is probably the best you can do.

@pascalduez
Copy link
Member

pascalduez commented Jan 5, 2019

Out of the blue, I would say extends the current @group annotation.
@xi Could you please give us samples of how this would look like?
Usage sample of the patched annotation, how it renders in the default theme etc.

Looking at current annotations we have the syntax could be:

@group name description

OR

@group name - description

WDYT?

@xi
Copy link
Contributor Author

xi commented Jan 5, 2019

I use the second option (https://github.com/xi/sassdoc-theme-default/commit/c0b542f630822ff6100935a77c84e1a92be43627) in my project sass-planifolia (source/rendered).

@pascalduez
Copy link
Member

@xi If your whiling to open a PR on the sassdoc repo, patching the @group annotation, that would be rad.

I'm just wondering about the data interface though, as I can see you introduce a new groupDescriptions key.
I'm wondering whether keeping everything on group would be better.
So
Annotation without description: string
Annotation with a description: object

{
  group: [
    'withoutDescription',
    { name: 'withDescrption', description: 'Lorem ipsum dolor sit amet' },
  ]
}

@pascalduez
Copy link
Member

sassdoc@2.6.0 Thanks a lot @xi !

Please test the feature and report any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants