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

repeated sections when i tagged my functions with @group #547

Closed marcog83 closed 10 months ago

marcog83 commented 10 months ago

Hi, thanks for the great job. i'm using this plugin to create md files, and when i add @group tag to my functions it doesn't group by the tag. instead it repeats the name of the group, as if it creates different groups for each tag

image
tgreyuk commented 10 months ago

This output doesn't look familiar. For context would you mind copying and pasting in the source code that produces the example and your configuration please?

marcog83 commented 10 months ago

Hi sure, below you can find my configuration and the how i commented each file.

index.ts is my entry point.

// from useCreateOrUpdateByApplication.ts

/**
 * @group Hooks
 * A hook to create or update all the user preferences for an `application`
 */

export const useCreateOrUpdateByApplication = …

// from useCreateOrUpdateByPreferenceName.ts

/**
 * @group Hooks
 * A hook to create or update a user preferences
 *
 * */
export const useCreateOrUpdateByPreferenceName = …

// from UserPreferencesProvider.ts

/**
 * @category Providers
 *
 * @typeParam ApiConfig
 */
export const UserPreferencesProvider:FC<ApiConfig> =

// index.ts

export { useCreateOrUpdateByApplication } from './hooks/use-create-update-by-application';
export { useCreateOrUpdateByPreferenceName } from './hooks/use-create-update-by-preference-name';

export { useUserPreferences, UserPreferencesProvider } from '@contexts/user-preferences';

// from typedoc.json

{
  // Comments are supported, like tsconfig.json
    "entryPoints": ["src/index.ts"],
    "out": "dist/md",
    "plugin": ["typedoc-plugin-markdown"],
    "categorizeByGroup":true,
  "hideBreadcrumbs":true,
  "hidePageTitle":true,
  "hideMembersSymbol":true
}
marcog83 commented 10 months ago

Hi @tgreyuk , i played a bit with the configuration and it was my configuration's fault. the plugin works great :). I think you can close this "no-issue". sorry for bother you

At the end I switched from @group to @category.

this is my new configuration

{
  // Comments are supported, like tsconfig.json
    "entryPoints": ["src/index.ts"],
    "out": "dist/md",
    "categorizeByGroup":false,
    "plugin": ["typedoc-plugin-markdown"],

   "hideBreadcrumbs":true,
  "hidePageTitle":true,
  "categoryOrder": [
    "Providers",
    "Hooks",
    "Options Type",
    "*"
  ]
}

One thing to highlight is that the tag @category must be the last one in the comment, otherwise typedoc seems to consider also the lines below as part of the category.


 // DOESN'T WORK
/**
@category Hooks
this is my hook description
*/

 // IT WORKS
/**

this is my hook description 
@category Hooks
*/
tgreyuk commented 10 months ago

ok thanks for clarification. i have checked the @group tags behaviour and I 'think' it is doing what it's supposed to do. Please do re-open though if you come across anything else.