Skip to content

Conversation

@petercrocker
Copy link
Contributor

@petercrocker petercrocker commented Dec 20, 2025

This PR improves the documentation for setting up new repositories to sync their docs to the infrahub-docs aggregation site, and adds automation tooling to simplify the process.

Changes

Improved README documentation:

  • Rewrote the "How to Setup a New Repo" section with clearer, step-by-step instructions
  • Added prerequisites section
  • Split instructions into three parts: source repo setup, infrahub-docs setup, and final steps
  • Added detailed file structure showing exactly what needs to be copied
  • Added specific configuration guidance for each file that needs modification
  • Added troubleshooting section for common issues
  • Documented the proper ordering of PR merges (infrahub-docs first)

Added setup automation script (scripts/setup-docs-repo.py):

  • Automates copying template files to new source repositories
  • Applies placeholder substitutions for project name, display name, and sidebar names
  • Creates placeholder files and sidebar config in infrahub-docs
  • Generates docusaurus plugin configuration snippets to copy/paste
  • Supports setting up source repo only, infrahub-docs only, or both at once

Added bundled templates (scripts/templates/):

  • Complete Docusaurus site template with placeholder substitutions
  • Linting configuration (Vale, markdownlint, yamllint)
  • GitHub Actions workflows (sync-docs.yml, CI file filters)
  • No external repository dependency required

Usage

# Setup both repos at once
python scripts/setup-docs-repo.py \
  --source-repo /path/to/my-new-project \
  --infrahub-docs-repo /path/to/infrahub-docs \
  --display-name "My New Project"

# Setup source repo only
python scripts/setup-docs-repo.py \
  --source-repo /path/to/my-new-project \
  --display-name "My New Project"

# Setup infrahub-docs only
python scripts/setup-docs-repo.py \
  --infrahub-docs-repo /path/to/infrahub-docs \
  --project-name my-new-project \
  --display-name "My New Project"

Template placeholders

The bundled templates use these placeholders that get substituted automatically:

  • {{PROJECT_NAME}} - e.g., my-new-project
  • {{PROJECT_PASCAL}} - e.g., MyNewProject (for sidebar names)
  • {{PROJECT_DISPLAY_NAME}} - e.g., My New Project (for UI labels)

Rewrote the "How to Setup a New Repo" section with clearer,
step-by-step instructions including:
- Prerequisites section
- Detailed file structure showing what to copy
- Specific configuration guidance for each file
- Complete plugin configuration examples for infrahub-docs
- Troubleshooting section for common issues
- Proper ordering of PR merges
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 20, 2025

Deploying infrahub-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8ddd6d0
Status: ✅  Deploy successful!
Preview URL: https://1cb4e0e9.infrahub-docs.pages.dev
Branch Preview URL: https://pmc-20251220-new-repo-docs.infrahub-docs.pages.dev

View logs

Add a Python script (scripts/setup-docs-repo.py) that automates setting up
documentation syncing for new OpsMill repositories. The script:

- Copies bundled template files to the source repository
- Applies placeholder substitutions for project name, display name, etc.
- Creates placeholder files in infrahub-docs
- Generates docusaurus plugin configuration snippets

Templates are bundled in scripts/templates/ so no external repo dependency
is needed. Template files use {{PLACEHOLDER}} syntax for substitutions:
- {{PROJECT_NAME}} - e.g., 'my-new-project'
- {{PROJECT_PASCAL}} - e.g., 'MyNewProject'
- {{PROJECT_DISPLAY_NAME}} - e.g., 'My New Project'

Also updated README.md to document the automated setup as the recommended
approach, keeping manual instructions as reference.
@petercrocker petercrocker requested review from a team and fatih-acar December 20, 2025 23:56
]

# CI workflow jobs that can be added to an existing ci.yml
CI_WORKFLOW_JOBS = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would to be good to have a reusable workflow instead of duplicating it... can be done separately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, could use help with what the right solution/approach is here when you're bored @fatih-acar ! But this is an infrequent task, so little urgency. At least someone can figure out the work to be done now.

@petercrocker petercrocker merged commit d296c28 into main Dec 23, 2025
6 checks passed
@petercrocker petercrocker deleted the pmc-20251220-new-repo-docs branch December 23, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants