typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
725 stars 177 forks source link

How to enable source code highlight in docusaurus? #691

Closed aoki-h-jp closed 2 months ago

aoki-h-jp commented 2 months ago

What package is your question related to?

docusaurus-plugin-typedoc

What would you like to ask?

hi, I'm aoki.

I use your docusaurus-plugin-typedoc. I want to show source code highlight in docusaurus. So, I implemented like this used also typedoc-plugin-inline-sources.

/**
 * GET /api/XXXX
 * `ja` example `en` example
 * @param formData `ja` example `en` example
 * @returns `ja` APIの応答 `en` API response
 * @source
 */

However, the source code highlight does not appear on docusaurus, only the title of the Source section. Is there any way to achieve Source code highlight by using only docusaurus-plugin-typedoc? I would like to know if there is such a way. If not, please consider adding such a feature.

tgreyuk commented 2 months ago

I have just tested and it does work. Can i please confirm that you have added the plugin to options config ?- i.e:

docusaurus.config:

plugins: [
    [
      "docusaurus-plugin-typedoc",
      {
        plugin: ["typedoc-plugin-inline-sources"],
        ...
aoki-h-jp commented 2 months ago

@tgreyuk Thank you for quick response. I just implement like this, it works!

    [
      'docusaurus-plugin-typedoc',
      {
        entryPoints: ['./my-external-repo/frontend/src/**/*.ts', './my-external-repo/frontend/src/**/*.tsx'],
        tsconfig: './my-external-repo/frontend/tsconfig.json',
        plugin: ["typedoc-plugin-inline-sources"]
      },
    ],

It seemed that I had just not set up the config file correctly. I apologize for waste your time.