ts4nfdi / terminology-service-suite

The Terminology Service Suite project is a collection of interactive widgets designed to ease the integration of terminology service functions into third-party applications.
https://ts4nfdi.github.io/terminology-service-suite/comp/latest/
MIT License
16 stars 2 forks source link

Provide descriptions as documentation for the widgets #135

Open jusa3 opened 2 months ago

jusa3 commented 2 months ago

To enhance the documentation, a short description of the widgets in the Storybook would be nice. Maybe at the top of the Docs tab. There is an example for the AutocompleteWidget. It is a comment in the AutocompleteWidget.tsx. Sadly, I did not find a solution yet to gather the widget descriptions in a file as with the arguments in the storyArgs.ts.

VincentKneip commented 2 months ago

You can add a description in the .stories.tsx file like this:

parameters: {
  layout: "centered",
  docs: {
    description: {
      component: "-> Here comes the description <-"
    }
  }
},

Like this, we could set component to a string constant from a file containing all descriptions. Disadvantage: Does not support Markdown

VincentKneip commented 3 weeks ago

This is also possible for individual stories. Just put the description here inside the story definition in the ...Stories.ts files:

export const <StoryName> = {
  parameters: {
    docs: {
      description: {
        story: ''
      }
    }
  },
  ...
};
VincentKneip commented 2 weeks ago

@jusa3 I linked a pull request for you to review.