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

Add group globals by helper #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zanerock
Copy link

Adds a groupGlobalsBy(groupFields, options) helper function. See #87 for use case/purpose. Also implemented a test, which necessitated (I believe) adding 'mock-require' as a dev dependency.

Closes #87

@75lb
Copy link
Member

75lb commented Aug 26, 2024

I will take a look, thanks.. In general, i try to avoid hard-coding personalisations (e.g. doMyRequiredThing()) into the stable core of a project - i prefer to offer extension points using which the user can add their own customisations, that's why it's possible to pass handlebars helpers into dmd.. however, I realise this dmd codebase is 10 years old and not straight-forward to work on - simplification required..

@zanerock
Copy link
Author

zanerock commented Aug 29, 2024

Yeah, I tried to find a way to write the function into my own plugin (dmd-readme-api). The problem is I couldn't find a way to get access to the helper functions in the base 'dmd' package, so to get the groupGlobalsBy working, I would have to replicate a ton of helper methods.

I did think one could break the helper functions into a separate package like '@jsdoc2md/dmd-helpers' or something, and then 'dmd' and 3rd party plugin packages could use the helpers package as needed. I'd be happy to work on that, but of course it'd be your call if that makes sense or not.

And of course, I could be overlooking something.

@75lb
Copy link
Member

75lb commented Aug 29, 2024

The helpers did used to live in their own project, for code-sharing reasons, but got pulled into dmd as a simplification for one of many reasons (which I'll document at some point soon). Dmd/jsdoc2md was written in 2014, a lot has changed in JS since then.. Although next to nothing has changed in the jsdoc project - one of my main blockers (as a consumer of jsdoc data).

Will get back to you regarding groupGlobalsBy - it's next on my list..

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

Successfully merging this pull request may close these issues.

Add groupGlobalsBy() helper function
2 participants