enzonotario / vitepress-openapi

Generate VitePress API Docs from OpenAPI specifications
https://vitepress-openapi.vercel.app
MIT License
54 stars 9 forks source link

Add tags slot #120

Open stereobooster opened 1 week ago

stereobooster commented 1 week ago

What would you like?

List of tags underneath the title

Why is this needed?

Would be handy with tags pages, if one doesn't show tags in the sidebar (without itemsByTags)

How could it be implemented?

I use following workaround

<OAOperation :operationId="operationId" :isDark="isDark" >
  <template #description="description">
    <div>
      <Badge type="info" v-for="tag in operation.tags">
        <!-- hardocde prefix, tell me if you know better way -->
        <a :href="`/tags/${tag}`">{{ tag }}</a>
      </Badge>
    </div>
  </template>
</OAOperation>

But would be nice to have

useTheme({
    operation: {
        slots: ['tags']
   }
})

Other information

Related: it would be nice to have more compact representation of endpoints lists for tags pages. For now I use

import { useTheme } from 'vitepress-openapi'
useTheme({
    operation: {
        slots: [
            'header',
            'path',
            'description',
        ],
        cols: 2,
    },
})

Which looks a bit strange