Skip to content

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.

License

Notifications You must be signed in to change notification settings

fahimahammed/prismadocify

Repository files navigation

Logo

Generate documentation for Prisma schemas.

Prismadocify

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.

Hacktoberfest 2024 🎃🍂

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.

How to Contribute

  1. Fork this repository and create a new branch.
  2. Find an issue to work on, or propose a new feature by opening an issue.
  3. Submit your pull request before October 31st to make it count for Hacktoberfest!

Check out our CONTRIBUTING.md for detailed guidelines.


Features

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.

Installation

Prerequisites

  • Node.js (>= 16.x)
  • Yarn or npm

Install via npm

npm install prismadocify

Install via Yarn

yarn add prismadocify

Usage

After installing prismadocify, you can use it from the command line to generate documentation for your Prisma schema.

Command

prismadocify

By default, prismadocify looks for the Prisma schema file at ./prisma/schema.prisma and generates the documentation in ./prisma-docs.md.

Example

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

Contributing

We welcome contributions of all kinds! To get started, please see the CONTRIBUTING.md for guidelines on how to contribute to the project.

License

This project is licensed under the MIT License.

Acknowledgements

Thanks to the Prisma team for their awesome ORM and inspiration for this tool.

About

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.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published