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

How to hide references, generated by re-exports #1271

Closed
samchon opened this issue Apr 19, 2020 · 3 comments
Closed

How to hide references, generated by re-exports #1271

samchon opened this issue Apr 19, 2020 · 3 comments
Labels
enhancement Improved functionality

Comments

@samchon
Copy link

samchon commented Apr 19, 2020

image

As I'm using the typedoc-plugin-external-module-name, I don't need the "references" features, who are generated by re-exports. However, I can't find any option to exclude or hide the section. If there's an option for that, can you teach me how to use it? Otherwise, I want to request that feature.

@samchon samchon added the enhancement Improved functionality label Apr 19, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 20, 2020

There is no way to exclude these currently, though you could write a plugin to do this fairly easily.

I don't really want to include a toggle for this, I expect with the upcoming library mode that these will drop to very few in each project and those that remain will be important.

Simple plugin to remove references (untested)

import { Application, Converter } from 'typedoc'
export function load({ application }: { application: Application }) {
  application.converter.on(Converter.EVENT_RESOLVE_BEGIN, context => {
    for (const reflection of context.project.getReflectionsByKind(ReflectionKind.Reference)) {
      context.project.removeReflection(reflection)
    }
  })
}

@samchon
Copy link
Author

samchon commented Apr 21, 2020

@Gerrit0 Thanks for reply. Your example code is working well.

@eyworldwide
Copy link

eyworldwide commented Oct 14, 2020

The code above is not working with typedoc@0.19.2. I've written a package to fix it: https://www.npmjs.com/package/typedoc-plugin-remove-references

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

No branches or pull requests

3 participants