docs/contribute/docs-contribute.mdx
import fork from '/snippets/fork.mdx'
We use Mintlify to host and build the Prefect documentation.
The main branch of the prefecthq/prefect GitHub repository is used to build the Prefect 3.0 docs at docs.prefect.io.
The 2.x docs are hosted at docs-2.prefect.io and built from the 2.x branch of the repository.
We provide a justfile with common commands to simplify development. We recommend using just to run these commands.
To install just:
brew install just or cargo install justcargo install just or check your package managerscoop install just or cargo install justFor more installation options, see the just documentation. </Note>
just docs to start the documentation server.Your docs should now be available at http://localhost:3000.
If you prefer not to use just, you can set up manually:
cd docs to navigate to the docs directory.nvm use node to use the correct Node.js version.npm i -g mintlify to install Mintlify.mintlify dev to start the development server.Your docs should now be available at http://localhost:3000.
See the Mintlify documentation for more information on how to install Mintlify, build previews, and use Mintlify's features while writing docs.
<Info>All documentation is written in .mdx files, which are Markdown files that can contain JavaScript and React components. </Info>
Examples are Python files that demonstrate Prefect concepts and patterns and how they work together with other tools to solve real-world problems. They live in the examples/ directory and are used to automatically generate documentation pages.
Each example should be a standalone Python file with:
YAML frontmatter (in Python comments) at the top with metadata:
# ---
# title: Your Example Title
# description: Brief description of what this example demonstrates
# icon: play # Choose from available icons (play, database, globe, etc.)
# dependencies: ["prefect", "pandas", "requests"] # Required packages
# cmd: ["python", "path/to/your_example.py"] # How to run it
# keywords: ["getting_started", "etl", "api"] # Keywords to help with search and filtering
# draft: false # Set to true to hide from docs
# ---
Explanatory comments throughout the code which will be used to generate the body of the documentation page.
Runnable code that works out of the box with the specified dependencies.
See the hello world example as a guide.
To add an example, follow these steps:
examples/ directoryjust generate-examples to update the documentation pagesOnce it all looks good, commit your changes and open a pull request.
Keep in mind the following when writing documentation.
Prefect resources can be managed in several ways, including through the CLI, UI, Terraform, Helm, and API.
When documenting a resource, consider including external references that describe how to manage the resource in other ways. Snippets are available to provide these references in a consistent format.
For example, the Deployment documentation includes a snippet for the Terraform provider:
import { TF } from "/snippets/resource-management/terraform.mdx"
import { deployments } from "/snippets/resource-management/vars.mdx"
<TF name="deployments" href={deployments.tf} />
For more information on how to use snippets, see the Mintlify documentation.