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

plugin documentation need #2279

Closed
rookiefront opened this issue May 11, 2023 · 1 comment
Closed

plugin documentation need #2279

rookiefront opened this issue May 11, 2023 · 1 comment
Labels
question Question about functionality

Comments

@rookiefront
Copy link

rookiefront commented May 11, 2023

Search terms

Whether a complete plug-in development documentation is available

Question

import typedoc from 'typedoc'
import  {MyPlugin} from './typedoc-plugin-a1.js'
/**
 * 生成 typedoc 文档
 * @constructor
 */
export async function GenerateTypeDoc() {
  const app = new typedoc.Application()

  app.options.addReader(new typedoc.TSConfigReader())

  // app.renderer.
  app.renderer.addComponent("typedoc-plugin-a1",new MyPlugin(app.renderer))
  app.options.addReader(new typedoc.TypeDocReader())
  app.bootstrap({
    entryPoints: ['packages/utils/index.ts'],
    // 设置自定义的主题
    plugin: [
      'typedoc-plugin-a1'
    ]
  })

  const project = app.convert()
  if (project) {
    const outputDir = "doc/utils"
    // 生成文档
    await app.generateDocs(project, outputDir)
    // 生成json
    await app.generateJson(project, outputDir + "/documentation.json")
  }
}
GenerateTypeDoc()
import { Component, RendererComponent } from 'typedoc/dist/lib/output/components';

export  class MyPlugin extends RendererComponent {
  initialize() {
    console.log('MyPlugin: Initialized');
    super.initialize();
  }

  render() {
    console.log('MyPlugin: Rendered');
  }
}

I think I need a complete document,

@rookiefront rookiefront added the question Question about functionality label May 11, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 13, 2023

There is not much documentation available, #521 tracks that task.

https://typedoc.org/guides/development/ has some info, I recommend looking at the source of plugins listed at https://typedoc.org/guides/plugins/ for examples.

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

No branches or pull requests

2 participants