Fork the repository
All contributions to Prefect need to start on a fork of the repository. Once you have successfully forked the Prefect repo, clone a local version to your machine:Set up your local environment
We provide ajustfile
with common commands to simplify development. We recommend using just to run these commands.
Installing justTo install just:
- macOS:
brew install just
orcargo install just
- Linux:
cargo install just
or check your package manager - Windows:
scoop install just
orcargo install just
Using just (recommended)
- Clone this repository.
- Run
just docs
to start the documentation server.
http://localhost:3000
.
Manual setup
If you prefer not to use just, you can set up manually:- Clone this repository.
- Make sure you have a recent version of Node.js installed. We recommend using nvm to manage Node.js versions.
- Run
cd docs
to navigate to the docs directory. - Run
nvm use node
to use the correct Node.js version. - Run
npm i -g mintlify
to install Mintlify. - Run
mintlify dev
to start the development server.
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.
All documentation is written in
.mdx
files, which are Markdown files that can contain JavaScript and React components. Contributing examples
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 theexamples/
directory and are used to automatically generate documentation pages.
Example structure
Each example should be a standalone Python file with:-
YAML frontmatter (in Python comments) at the top with metadata:
- 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.
Adding an example
To add an example, follow these steps:- Create your Python file in the
examples/
directory - Follow the structure above with frontmatter and comments
- Test that your example runs successfully
- Run
just generate-examples
to update the documentation pages - Review the generated documentation to ensure it renders correctly