This documentation defines the annual data update process for the PAT (Procurement Analysis Tool) Master DataBook. It contains guidance on data collection, cleaning, integration, tab-specific updates, and maintenance procedures.
- Python 3.7+
- pip (Python package manager)
-
Clone: From the desired directory where you want to have the repo...
git clone https://github.com/PabloBotinGP/PAT-Documentation.git
-
Create a Python virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install MkDocs and Material theme:
pip install mkdocs mkdocs-material
-
Verify installation:
mkdocs --version
To preview the documentation while editing:
mkdocs serveThis will start a local web server at http://localhost:8000. The site will auto-reload when you make changes to Markdown files.
To generate the static HTML site (output goes to site/ directory):
mkdocs buildTo build with strict mode (catches missing links/anchors):
mkdocs build --strictPAT-Documentation/
├── mkdocs.yml # MkDocs configuration (site name, theme, nav, plugins)
├── README.md # This file
├── docs/ # Source Markdown files (canonical documentation)
│ ├── index.md # Home page
│ ├── introduction.md # PAT and Master DataBook overview
│ ├── data_architecture.md # Folder structure and data organization
│ ├── update_process.md # Overview and high-level update workflow
│ ├── utilities_update.md # Utilities tab updates, Competitive Suppliers, CCA, PPA notes
│ ├── competitive_suppliers.md # Competitive Suppliers tab guidance (deprecated: now in utilities_update.md)
│ ├── other_updates.md # Other tabs: Utilities, States, Information, Update Tracker, Documentation
│ ├── source_list.md # Recurring and random sources to monitor
│ ├── javascripts/ # Custom JS (if any)
│ └── stylesheets/ # Custom CSS (if any)
└── site/ # Generated static HTML (created by `mkdocs build`)
├── index.html
├── introduction/
├── ...
└── search/
The docs are organized as follows:
- Home (index.md): Overview and links to main sections.
- Introduction: Background on PAT and the Master DataBook.
- Data Architecture: Folder organization, Master DataBook structure, and key principles.
- Update Process: High-level overview with sections on Data Collection, Data Cleaning, Data Integration, and Tab-Specific Updates.
- Utilities Update (utilities_update.md): Workflow for the Options with Utilities tab, Competitive Suppliers tab, Community Choice Aggregation, and PPA price mappings.
- Other Updates (other_updates.md): Guidance for Utilities, States, Information, Update Tracker, and Documentation tabs.
- Source List: Recurring and random data sources to check for updates.
The mkdocs.yml file controls the site configuration:
- site_name: "PAT Documentation"
- theme: Material theme with navigation tabs and search highlighting
- nav: Navigation structure (Home, Introduction, Data Architecture, Update Process with dropdowns, Source List)
- plugins: Search plugin enabled
- markdown_extensions: Admonition, attribute lists, TOC with permalinks, code highlighting
Edit mkdocs.yml to add/remove pages or adjust the nav hierarchy:
nav:
- Home: index.md
- Introduction: introduction.md
- Update Process:
- Overview: update_process.md
- Utilities Update: utilities_update.md
- Other: other_updates.md
- Source List: source_list.md- Markdown format: All docs use standard Markdown. See Markdown Guide.
- File naming: Use lowercase with underscores (e.g.,
data_architecture.md). - Internal links: Reference files using relative paths (e.g.,
[Link](source_list.md)) or anchor links (e.g.,[Link](#section-heading)). - Code blocks: Use triple backticks with language tags for syntax highlighting.
## Section Heading
Paragraph text here.
- Bullet point
- Another bullet
> **Tip:** Use blockquotes for tips and notes.
### Subsection
[Link to another page](utilities_update.md)
[Link to section](#data-collection)
\`\`\`bash
# Code example
mkdocs serve
\`\`\`mkdocs buildThis creates the site/ directory with all generated HTML, CSS, and JS files.
To make the site accessible from other machines:
mkdocs serve -a 0.0.0.0:8000Then access it at http://<your-machine-ip>:8000.
If the repository is on GitHub, you can deploy the site automatically:
- Ensure the repository has GitHub Pages enabled (Settings > Pages).
- Use GitHub Actions or manually push the
site/directory to agh-pagesbranch.
Example GitHub Actions workflow (.github/workflows/deploy.yml):
name: Deploy Docs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: pip install mkdocs mkdocs-material
- run: mkdocs build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./siteTo deploy to a web server:
- Run
mkdocs buildto generate thesite/directory. - Copy the contents of
site/to your web server's document root. - Ensure the web server is configured to serve
site/index.htmlas the default page.
MkDocs includes a convenient command to build the site and publish it to GitHub Pages in one step. This is useful for small or manual deployments:
# Build and push the site to the default `gh-pages` branch on the `origin` remote
mkdocs gh-deployCommon options:
# Specify a different remote branch (if you use a different pages branch)
mkdocs gh-deploy --remote-branch gh-pages
# Force push the site (use with caution)
mkdocs gh-deploy --forceNotes:
- Ensure you have push permission to the repository and that the remote
originis set correctly. - The command will build the
site/directory and publish its contents to the configured GitHub Pages branch.
When updating content:
- Edit the relevant
.mdfile in thedocs/folder. - Run
mkdocs serveto preview changes locally. - Verify links and formatting are correct.
- Commit changes to the repository:
git add . git commit -m "Update documentation: [brief description]" git push
If port 8000 is already in use, specify a different port:
mkdocs serve -a localhost:8001Build with strict mode to catch issues:
mkdocs build --strictThis will report any broken links or missing anchor references.
Ensure the Material theme is installed:
pip install --upgrade mkdocs-materialClear the build cache:
rm -rf site/
mkdocs buildTo add or update documentation:
- Follow the Markdown conventions outlined above.
- Test your changes locally with
mkdocs serve. - Use descriptive commit messages.
- Ensure all links are valid and internal references use relative paths.
This documentation is part of the PAT (Procurement Analysis Tool) project. Please refer to the project's LICENSE file for details.
For questions about the documentation or the PAT project, contact the project maintainers or refer to the project's main repository.