histoire-dev / histoire-dev/histoire

Extract props/slots/events documentation from source code

Open
#126 15 comments 15 reactions 1 assignee Claimed by @elevatebart View on GitHub
enhancement
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Clear and concise description of the problem

I would like Histoire to extract the props/slots/events documentation from the source code and display it as documentation within Histoire. By reusing the documentation in the source code it will prevent me from having to write it again somewhere else. This will ensure there is a single source of truth for the documentation of these props/slots/events.

### Suggested solution

There is a package which can extract this information from your Vue source code, it is called [vue-docgen-api](https://github.com/vue-styleguidist/vue-styleguidist/tree/dev/packages/vue-docgen-api). This outputs an object containing the information it was able to find in the code. With this object it should be possible to show the documentation for props/slots/events in Histoire.

### Alternative

_No response_

### Additional context

_No response_

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that requests the same feature to avoid creating a duplicate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.