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

can system helpers be overridden? #91

Closed
augusttty opened this issue May 29, 2023 · 2 comments
Closed

can system helpers be overridden? #91

augusttty opened this issue May 29, 2023 · 2 comments

Comments

@augusttty
Copy link

I need to override system helpers, I override the default "link" helper by creating a plugin. But it didn't work.

@75lb 75lb transferred this issue from jsdoc2md/jsdoc-to-markdown Aug 27, 2024
@75lb
Copy link
Member

75lb commented Aug 31, 2024

I double-checked - the system helpers can be overriden. I created this file with overrides for two system helpers:

const overrides = {
  inlineLinks: function () {
    return 'some link text'
  },

  orphans: function () {
    return 'whatever'
  }
}

module.exports = overrides

I then ran dmd with the path to my custom helpers.

const output = await dmd(fixture, { helper: 'test/overrides/helpers.js' })
console.log(output)

The output looked as expected:

## Functions

<dl>
<dt><a href="#customFunction">customFunction()</a></dt>
<dd><p>some link text</p>
</dd>
<dt><a href="#firesError">firesError()</a></dt>
<dd><p>some link text</p>
</dd>
<dt><a href="#firesMany">firesMany()</a></dt>
<dd><p>some link text</p>
</dd>
<dt><a href="#firesDefinedEvent">firesDefinedEvent()</a></dt>
<dd><p>some link text</p>
</dd>

etc
etc

I override the default "link" helper by creating a plugin. But it didn't work.

It should have worked - could you post some example code please that fails to work correct, I will check it.

@75lb
Copy link
Member

75lb commented Aug 31, 2024

Closing this, I can't reproduce the issue - existing system helpers and partials can be overriden by passing in options.helper, options.partial or a plugin.. If you still have issues, please post some code I can run to reproduce and debug the issue.

@75lb 75lb closed this as completed Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants