Generate documentation for Prisma schemas.
prismadocify
is a command-line tool that generates markdown documentation for Prisma schemas. It reads your Prisma schema file, parses the models and enums, and outputs a markdown file documenting the schema.
This project is participating in Hacktoberfest 2024!
We welcome contributions from the open-source community, whether it's bug fixes, feature implementations, or documentation improvements. Every contribution counts toward your Hacktoberfest goal.
- Fork this repository and create a new branch.
- Find an issue to work on, or propose a new feature by opening an issue.
- Submit your pull request before October 31st to make it count for Hacktoberfest!
Check out our CONTRIBUTING.md for detailed guidelines.
Here are some of the key features of prismadocify
:
- Markdown Documentation Generation: Automatically generates well-structured markdown documentation for your Prisma schemas.
- Support for Models and Enums: Document your Prisma models and enums with table-formatted output.
- Customizable Paths (coming soon): Specify custom paths for schema input and output documentation.
- Node.js (>= 16.x)
- Yarn or npm
npm install prismadocify
yarn add prismadocify
After installing prismadocify
, you can use it from the command line to generate documentation for your Prisma schema.
prismadocify
By default, prismadocify
looks for the Prisma schema file at ./prisma/schema.prisma
and generates the documentation in ./prisma-docs.md
.
Here is an example of a simple Prisma schema and the generated documentation:
Prisma Schema (schema.prisma
)
model User {
id String @id @default(uuid())
email String @unique
name String?
createdAt DateTime @default(now())
}
enum UserRole {
ADMIN
USER
}
Generated Markdown Documentation (prisma-docs.md
)
# Prisma Schema Documentation
## User
| Field | Type | List | Required | Unique |
| --------- | -------- | ---- | -------- | ------ |
| id | String | No | Yes | Yes |
| email | String | No | Yes | Yes |
| name | String? | No | No | No |
| createdAt | DateTime | No | Yes | No |
## Enums
### UserRole
ADMIN, USER
We welcome contributions of all kinds! To get started, please see the CONTRIBUTING.md for guidelines on how to contribute to the project.
This project is licensed under the MIT License.
Thanks to the Prisma team for their awesome ORM and inspiration for this tool.