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: Wrap the html for properties and methods inside div tags #188

Open
tobiu opened this issue Sep 1, 2018 · 1 comment
Open

Comments

@tobiu
Copy link

tobiu commented Sep 1, 2018

Hi guys,

it is nice that JSDoc provides the ability to include / exclude certain properties and methods via the build settings (opts.access: public, protected, undefined, private, all), but from an UX perspective it would be way nicer to build the docs with all properties & methods and apply filter options inside the template.

There could be checkboxes at the top of the docs page like:
Include private
Include inherited
etc.

and when you check them show or hide the relevant entries.

screen shot 2018-09-01 at 12 17 05

This would be pretty simple:
Wrap the properties and methods dom / html into div tags like:
<div class="is-private is-inherited">

and when you uncheck the "show private" checkbox just apply a css class to a style tag like:
is-private {display:'none'}

Best regards
Tobias

@tobiu
Copy link
Author

tobiu commented Sep 1, 2018

i have never worked with .hbs files, but this is my first shot.

screen shot 2018-09-01 at 13 31 27

not sure if there is an easy way to remove the ! from the class name(s), but you get the idea.
symbol-detail.hbs:

screen shot 2018-09-01 at 13 40 17

the code formatting breaks terribly for this one, adding a screenshot (hit edit on this comment to see it...).

`{{!--
Note that we omit the labels for classes, modules, and namespaces, since these labels would
duplicate the labels for the page's main heading.
--}}
{{#if symbol.kind}}
{{#withOnly allLabels=(labels symbol)}}
{{#any allLabels}}


{{/any}}
{{/withOnly}}
{{#contains 'class' 'module' 'namespace' value=symbol.kind}}
{{else}}
{{#embed 'symbol-labels'}}{{/embed}}
{{/contains}}
{{/if}}
{{#unless symbol.hideconstructor}}

{{#with symbol}}
{{#embed 'constructor-prefix'}}{{/embed}}
<span {{cssClass '!symbol-name'}}>{{name}}
{{
#embed 'signature'}}{{/embed~}}
{{/with}}

{{~/unless}}
{{#with symbol}}
{{#unless (config 'sourceFiles.singleLink')}}
{{#unless hideconstructor}}
{{#embed 'source-file'}}{{/embed}}
{{/unless}}
{{/unless}}
{{#unless hideconstructor}}
{{#embed 'description'}}{{/embed}}
{{#embed 'examples'}}{{/embed}}
{{#embed 'params'}}{{/embed}}
{{#embed 'properties'}}{{/embed}}
{{/unless}}

{{#unless hideconstructor}}
    <dl {{~cssClass '!dl-compact'}}>
        {{#embed 'details'}}{{/embed}}
    </dl>
{{/unless}}

{{/with}}
{{#if symbol.kind}}
{{#withOnly allLabels=(labels symbol)}}
{{#any allLabels}}


{{/any}}
{{/withOnly}}
{{/if}}`

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

No branches or pull requests

1 participant