jsdoc2md / dmd

The default output template for jsdoc2md
MIT License
39 stars 50 forks source link

Should support an option to turn off the index #6

Closed adam-lynch closed 10 years ago

adam-lynch commented 10 years ago

I have one file with one class and I was getting rundant stuff like:

class x

members: x (which linked to "class X" above" new x() (linked to constructor below) aMethod anotherMethod

I used a template like this to get what I wanted:

{{heading-depth-bump~}}
{{#if (constructorHasDocs)}}{{set "isConstructor" true~}}{{>function}}{{/if~}}
{{~#each (groupByKind (children))~}}
    {{#if (equal kind "member")}}{{>member}}{{/if~}}
    {{#if (equal kind "function")}}{{>function}}{{/if~}}
    {{#if (equal kind "namespace")}}{{>namespace}}{{/if~}}
    {{#if (equal kind "constant")}}{{>constant}}{{/if~}}
    {{#if (equal kind "typedef")}}{{>typedef}}{{/if~}}
    {{#if (equal kind "event")}}{{>event}}{{/if~}}
    {{~#if (equal kind "class")~}}
        {{set "isConstructor" false~}}
        {{~#unless (equal kind "class")~}}
            {{>head~}}
        {{/unless~}}
        {{>body~}}
        {{>members~}}
    {{/if~}}
    {{#if (equal kind "module")}}{{>module}}{{/if~}}
{{/each~}}
{{heading-depth-drop~}}

It was painful to debug through a few our your modules and eventually through dmd's templates to find the right bit of handlebars markup to use.

75lb commented 10 years ago

hey.. sorry i have been slow to respond @adam-lynch , been up to my neck in it with "real work".. anyway, i'm back..

listen, you don't need to go through all the shit you did to get your customised docs, it's easy - i just haven't documented it yet.. that's my next job! will keep you posted.

adam-lynch commented 10 years ago

cool :+1: Yeah it was awkward alright

75lb commented 10 years ago

btw, you shouldn't have seen an index if your input source code only contained one class.. i have a feeling you might have been using an old version.. were you using jsdoc2md? or the grunt or gulp plugin when you saw this output? Could you send a gist or something of your input source code so i can reproduce? Thanks..

adam-lynch commented 10 years ago

grunt-jsdoc-to-markdown. See https://github.com/edjafarov/node-webkit-updater