jsdoc-baseline icon indicating copy to clipboard operation
jsdoc-baseline copied to clipboard

Feature Request: Wrap the html for properties and methods inside div tags

Open tobiu opened this issue 7 years ago • 1 comments

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 avatar Sep 01 '18 10:09 tobiu

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~}}`

tobiu avatar Sep 01 '18 11:09 tobiu