This guide covers how to work with and contribute to the Hayhooks documentation.
- Python 3.10+
- Hatch installed (
pip install hatch)
The documentation can be built and served using Hatch commands:
Start a local development server with live reloading using the dedicated docs environment:
# Using the dedicated docs environment (auto-installs all dependencies)
hatch run docs:serve
# With custom options
hatch run docs:serve --open --dirtyThe server will be available at http://localhost:8000/hayhooks/
Build the documentation for deployment:
# Using the docs environment (recommended)
hatch run docs:build
# Clean build (removes old files first)
hatch run docs:build --clean
# Strict build (fails on warnings)
hatch run docs:build --strictThe built site will be available in the site/ directory.
Deploy the documentation to GitHub Pages:
# Deploy to GitHub Pages
hatch run docs:deploy
# With custom options
hatch run docs:deploy --forceIf you prefer to use MkDocs directly:
# Install dependencies
pip install mkdocs-material
# Serve documentation
mkdocs serve
# Build documentation
mkdocs builddocs/
├── mkdocs.yml # Main configuration
├── index.md # Homepage
├── getting-started/ # Getting started guides
├── concepts/ # Core concepts
├── features/ # Feature documentation
├── advanced/ # Advanced topics
├── deployment/ # Deployment guides
├── examples/ # Example documentation
├── reference/ # Reference documentation
├── about/ # About information
├── assets/ # Images and static assets
├── stylesheets/ # Custom CSS
└── javascripts/ # Custom JavaScript
Add new Markdown files in the appropriate directory:
# Create a new feature document
touch docs/features/new-feature.md
# Create a new example
touch docs/examples/new-example.mdUpdate mkdocs.yml to include your new documentation in the navigation:
nav:
- Features:
- New Feature: features/new-feature.md # Add this line
- OpenAI Compatibility: features/openai-compatibility.md
- MCP Support: features/mcp-support.mdPlace images in the docs/assets/ directory:
# Add an image
mv screenshot.png docs/assets/
# Reference in Markdown
- Use clear, concise language
- Include practical examples
- Provide step-by-step instructions
- Use proper Markdown formatting
To maintain consistency and reduce maintenance burden:
-
Single Source of Truth: Each topic should have one canonical location
- README.md: Quick overview and getting started examples
- docs/concepts/: Detailed conceptual explanations
- docs/reference/: Complete API and configuration references
-
Cross-Referencing: Link to the canonical source instead of duplicating content
- Good: "For complete configuration options, see Environment Variables Reference"
- Bad: Copying all environment variables into multiple pages
-
Next Steps: Keep to 2-3 most relevant links per page
- Focus on logical next actions for the reader
- Avoid circular references (page A → page B → page A)
Use proper code block formatting:
# Python code
def example_function():
return "Hello, World!"# Shell commands
hatch run docs-serve- Internal Documentation: Use relative links (e.g.,
../concepts/pipeline-wrapper.md) - External Resources: Use absolute links (e.g.,
https://haystack.deepset.ai/) - README Links: When linking from docs to README, use absolute GitHub URLs
- Test Links: Always verify links work before committing
Always test the documentation builds successfully:
hatch run docs:build --strictCheck for broken links:
# Test locally
hatch run docs:serve
# Or use a link checker tool
pip install linkchecker
linkchecker http://localhost:8000/hayhooks/Preview your changes in the browser:
hatch run docs:serve --openNote: Automatic deployment via GitHub Actions is not yet configured. For now, documentation must be deployed manually. A GitHub Actions workflow will be added in the future.
To deploy manually:
# Deploy to GitHub Pages (builds and deploys in one command)
hatch run docs:deploy
# Or build only without deploying
hatch run docs:build
# The site is now ready in the site/ directory-
Build Fails
- Check for Markdown syntax errors
- Verify all links are valid
- Ensure image paths are correct
-
Navigation Issues
- Check
mkdocs.ymlsyntax - Verify all referenced files exist
- Test navigation structure
- Check
-
Style Issues
- Check CSS file paths
- Verify JavaScript syntax
- Test in multiple browsers
- Check MkDocs documentation: https://www.mkdocs.org/
- Review Material theme docs: https://squidfunk.github.io/mkdocs-material/
- Open an issue on GitHub: https://github.com/deepset-ai/hayhooks/issues
- Fork the repository
- Create a feature branch
- Make your documentation changes
- Test locally with
hatch run docs:serve - Submit a pull request
Thank you for contributing to Hayhooks documentation!