How to use the typedoc.UrlMapping function in typedoc

To help you get started, we’ve selected a few typedoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tom-grey / typedoc-plugin-markdown / src / theme.ts View on Github external
buildUrls(reflection: DeclarationReflection, urls: UrlMapping[]): UrlMapping[] {
    const mapping = MarkdownTheme.getMapping(reflection);
    if (mapping) {
      if (!reflection.url || !MarkdownTheme.URL_PREFIX.test(reflection.url)) {
        const url = this.toUrl(mapping, reflection);
        urls.push(new UrlMapping(url, reflection, mapping.template));
        reflection.url = url;
        reflection.hasOwnDocument = true;
      }
      for (const child of reflection.children || []) {
        if (mapping.isLeaf) {
          this.applyAnchorUrl(child, reflection);
        } else {
          this.buildUrls(child, urls);
        }
      }
    } else if (reflection.parent) {
      this.applyAnchorUrl(reflection, reflection.parent);
    }
    return urls;
  }
github IBM / report-toolkit / scripts / typedoc-plugin-markdown-gatsby-theme / theme.js View on Github external
getUrls(project) {
    const urls = [];
    const entryPoint = this.getEntryPoint(project);
    const url = this.indexName + this.fileExt;
    entryPoint.url = url;
    urls.push(
      this.application.options.getValue('readme') === 'none'
        ? new UrlMapping(url, entryPoint, 'reflection.hbs')
        : new UrlMapping(url, project, 'index.hbs')
    );
    if (entryPoint.children) {
      entryPoint.children.forEach(child => {
        if (child instanceof DeclarationReflection) {
          this.buildUrls(child, urls);
        }
      });
    }
    return urls;
  }
};
github tom-grey / typedoc-plugin-markdown / src / theme.ts View on Github external
getUrls(project: ProjectReflection): UrlMapping[] {
    const urls: UrlMapping[] = [];
    const entryPoint = this.getEntryPoint(project);
    if (this.application.options.getValue('readme') === 'none') {
      entryPoint.url = this.indexName + this.fileExt;
      urls.push(new UrlMapping(this.indexName + this.fileExt, entryPoint, 'reflection.hbs'));
    } else {
      entryPoint.url = 'globals' + this.fileExt;
      urls.push(new UrlMapping('globals' + this.fileExt, entryPoint, 'reflection.hbs'));
      urls.push(new UrlMapping(this.indexName + this.fileExt, project, 'index.hbs'));
    }
    if (entryPoint.children) {
      entryPoint.children.forEach((child: Reflection) => {
        if (child instanceof DeclarationReflection) {
          this.buildUrls(child, urls);
        }
      });
    }
    return urls;
  }
github tom-grey / typedoc-plugin-markdown / src / theme.ts View on Github external
getUrls(project: ProjectReflection): UrlMapping[] {
    const urls: UrlMapping[] = [];
    const entryPoint = this.getEntryPoint(project);
    if (this.application.options.getValue('readme') === 'none') {
      entryPoint.url = this.indexName + this.fileExt;
      urls.push(new UrlMapping(this.indexName + this.fileExt, entryPoint, 'reflection.hbs'));
    } else {
      entryPoint.url = 'globals' + this.fileExt;
      urls.push(new UrlMapping('globals' + this.fileExt, entryPoint, 'reflection.hbs'));
      urls.push(new UrlMapping(this.indexName + this.fileExt, project, 'index.hbs'));
    }
    if (entryPoint.children) {
      entryPoint.children.forEach((child: Reflection) => {
        if (child instanceof DeclarationReflection) {
          this.buildUrls(child, urls);
        }
      });
    }
    return urls;
  }
github IBM / report-toolkit / scripts / typedoc-plugin-markdown-gatsby-theme / theme.js View on Github external
getUrls(project) {
    const urls = [];
    const entryPoint = this.getEntryPoint(project);
    const url = this.indexName + this.fileExt;
    entryPoint.url = url;
    urls.push(
      this.application.options.getValue('readme') === 'none'
        ? new UrlMapping(url, entryPoint, 'reflection.hbs')
        : new UrlMapping(url, project, 'index.hbs')
    );
    if (entryPoint.children) {
      entryPoint.children.forEach(child => {
        if (child instanceof DeclarationReflection) {
          this.buildUrls(child, urls);
        }
      });
    }
    return urls;
  }
};