Skip to content

Class Methods as separate files/pages #2963

Answered by LekoArts
LekoArts asked this question in Q&A
Discussion options

You must be logged in to vote

In case anyone is interested, here's how I got it working (most basic version of it):

// @ts-check
import * as td from "typedoc";

/** @param {td.Application} app */
export function load(app) {
  app.renderer.defineRouter('custom', CustomRouter)
}

/**
 * @param {td.Reflection} reflection
 */
function isMethod(reflection) {
  return reflection.kind === td.ReflectionKind.Method;
}

class CustomRouter extends td.KindRouter {
  /**
   * @param {td.Reflection} reflection
   */
  getIdealBaseName(reflection) {
    // ADDITION
    if (isMethod(reflection)) {
      const className = reflection.parent ? reflection.parent.name : '';
      const methodName = reflection.name;

      return `classes/${

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LekoArts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants