Skip to content

Export Renderers from public API? #786

Answered by tgreyuk
LekoArts asked this question in Help
Discussion options

You must be logged in to vote

Routers exposed in [email protected].

Here is a pointless example:

import { ReflectionKind } from 'typedoc';
import { MemberRouter } from 'typedoc-plugin-markdown';


export function load(app) {
  app.renderer.defineRouter('custom-router', CustomRouter);
}

export class CustomRouter extends MemberRouter {

  getIdealBaseName(reflection) {
    if (reflection.kind === ReflectionKind.Class) {
      return `custom-class-directory/${reflection.name}`;
    }
    return super.getIdealBaseName(reflection);
  }


  relativeUrl(from, to) {
    return `wiki/${super.relativeUrl(from, to)}`;
  }
}

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@LekoArts
Comment options

Comment options

You must be logged in to vote
4 replies
@LekoArts
Comment options

@LekoArts
Comment options

@tgreyuk
Comment options

@LekoArts
Comment options

Answer selected by LekoArts
Comment options

You must be logged in to vote
1 reply
@tgreyuk
Comment options

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