-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add groupGlobalsBy()
helper function
#87
Comments
Grouping by category is already possible.. See this folder in the testbed - have a look at the example source in |
Thanks for the feedback. I had seen that was possible, but (I think) the items have to be in a module for that to work because the group by function requires the items to be the child of something. I could not see a way to group the global identifiers, hence the new function. In my specific use case, I don't really want or need the module designation. I did try to use it just to get the grouping working, but I ran into issues. If I remember correctly, the problem was the identifiers were spread across multiple files and that was causing problems in the output. But, ultimately that was just a workaround and I'd strongly prefer to keep the identifiers in the global space for my purposes. |
Will take a deeper look.. It could still make V9 which is still in beta.. |
Was your issue partly due to the fact you were unable to modify a built-in helper (e.g. |
Nevermind, I closed the issue I just mentioned (#91) as I couldn't reproduce the issue - it is possible to override system helpers and partials. I think you could implement const overrides = {
// a system helper
inlineLinks: function (text, options) {
// the original code plus your modifications
},
// your custom helper
groupGlobalsBy: function () {
// your thing
}
}
module.exports = overrides then run jsdoc2md passing in your helper file, plus any custom partial files that reference your new helpers..
Let me know if that solves your issue.. |
Btw, you might want to test the solution i just suggested using |
I'm aware of being able to override/add helpers. My issue was more about being able to access the root dmd helpers. E.g., |
thanks for clarifying, that helped.. Could you send a link to a project where |
I've got two:
These are generated using dmd-readme-api (and a patched version of dmd, @liquid-labs/dmd, which adds the I'm not certain if |
Thanks, will come in useful.. I made a start unpicking the handlebars hellzone within dmd over the weekend, massively slowed down by issues in the dep tree (this time it's handlebars, usually it's jsdoc). Anyway, will add your plugin to my testbed and try a few things, thanks.. Btw, yes the helper methods you mentioned need factoring out of the project (again) so they can be reused elsewhere - that's the general focus of what i've been working on.. again.. (I won't bore you with the details but |
In order to support a grouping globals by category, let's add a
groupGlobalsBy(groupByFields, options)
function. Currently, you can only really group by category if the grouped identifiers are part of a module (because thegroupBy()
works explicitly with child identifiers so there must be a parent involved). AddinggroupGlobalsBy()
will allow global identifiers to be grouped by category as well.The text was updated successfully, but these errors were encountered: