Skip to content

Migrate docs to MkDocs Material + GitHub Pages#44

Merged
sbryngelson merged 11 commits intocomp-physics:masterfrom
sbryngelson:mkdocs-readthedocs
Mar 5, 2026
Merged

Migrate docs to MkDocs Material + GitHub Pages#44
sbryngelson merged 11 commits intocomp-physics:masterfrom
sbryngelson:mkdocs-readthedocs

Conversation

@sbryngelson
Copy link
Member

Summary

  • Move markdown content into docs/ directory for MkDocs/Zensical
  • Material theme with dark mode matching comp-physics.group branding
  • GitHub Actions workflow for auto-deploy to GitHub Pages
  • Fix markdown rendering: heading levels, blank lines, broken links, MathJax
  • Add markdownlint CI, spell check, link checker
  • Add .gitignore for build artifacts

Test plan

  • Run zensical serve locally
  • Enable GitHub Pages (Settings > Pages > GitHub Actions) after merge
  • Verify site at comp-physics.group/group-docs/

@sbryngelson sbryngelson marked this pull request as ready for review March 5, 2026 15:56
@sbryngelson sbryngelson merged commit 3d57f48 into comp-physics:master Mar 5, 2026
2 of 3 checks passed
@qodo-code-review
Copy link

Review Summary by Qodo

Migrate documentation to MkDocs Material theme with GitHub Pages deployment

📝 Documentation ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Migrate documentation from traditional markdown to MkDocs Material theme for improved presentation
  and maintainability
• Normalize heading levels across all syllabus documents (convert ## to # for main headings,
  ### to ## for sections) for MkDocs compatibility
• Remove auto-generated doctoc table of contents comments and manual TOC entries from all
  documentation files
• Create new MkDocs configuration (mkdocs.yml) with Material theme, dark/light mode support, and
  custom branding colors (#292929 primary, #c0995e accent)
• Add custom CSS styling (docs/assets/extra.css) for Material theme customization matching
  comp-physics.group branding
• Configure MathJax support (docs/assets/mathjax.js) for mathematical equation rendering
• Create documentation site homepage (docs/index.md) with organized navigation and links to
  resources
• Set up GitHub Actions workflows for automated deployment to GitHub Pages, markdown linting, and
  spell checking
• Update relative links to GitHub URLs for template references and external resources
• Simplify README to focus on MkDocs documentation site with minimal landing page content
• Add markdownlint configuration and Python dependencies for documentation build process
• Remove deprecated TOC generator workflow and configuration files
Diagram
flowchart LR
  A["Markdown Files<br/>with doctoc"] -->|"Normalize headings<br/>Remove TOC"| B["MkDocs<br/>Compatible Docs"]
  B -->|"Apply theme<br/>& styling"| C["Material Theme<br/>Site"]
  C -->|"GitHub Actions<br/>Deploy"| D["GitHub Pages<br/>comp-physics.group"]
  E["mkdocs.yml<br/>Configuration"] -->|"Configure"| C
  F["Custom CSS<br/>& MathJax"] -->|"Style & Render"| C
Loading

Grey Divider

File Changes

1. docs/group-syllabus/improving-your-writing.md 📝 Documentation +232/-251

Markdown heading level normalization and doctoc removal

• Removed BOM character and auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # (H2 to H1) for MkDocs compatibility
• Changed all section headings from ### to ## and subsections from #### to ###
• Fixed markdown formatting: added blank lines between sections, improved spacing around lists
• Added new reference link to "Adam Wierman: Advising" in the resources section

docs/group-syllabus/improving-your-writing.md


2. docs/group-syllabus/formatting.md 📝 Documentation +39/-54

Heading normalization and relative link conversion to GitHub URLs

• Removed auto-generated table of contents (doctoc comments and section)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized all section headings: ### to ##, #### to ###
• Updated relative links to GitHub URLs (e.g., ../templates/paper/ to full GitHub paths)
• Fixed markdown formatting: added blank lines before lists, improved spacing consistency

docs/group-syllabus/formatting.md


3. docs/group-syllabus/figures.md 📝 Documentation +38/-58

Heading structure normalization and link URL updates

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized all section headings: ### to ##, #### to ###
• Updated relative links to GitHub URLs for template references
• Fixed markdown formatting: added blank lines before lists, improved spacing

docs/group-syllabus/figures.md


View more (28)
4. docs/group-syllabus/working-with-me.md 📝 Documentation +13/-26

Markdown structure normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading to # for MkDocs H1 structure
• Normalized section headings: ### to ##, #### to ###
• Fixed markdown formatting: added blank lines before lists, improved spacing consistency
• Minor text formatting improvements (spacing around punctuation)

docs/group-syllabus/working-with-me.md


5. docs/group-syllabus/giving-talks.md 📝 Documentation +18/-29

Heading level normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized all section headings: ### to ##, #### to ###
• Fixed markdown formatting: added blank lines before lists and bullet points
• Improved spacing consistency throughout the document

docs/group-syllabus/giving-talks.md


6. docs/group-syllabus/undergraduate-specifics.md 📝 Documentation +19/-34

Heading normalization and reference link updates

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section headings: ### to ##
• Updated PURA Salary reference from relative path to PURA website link
• Fixed markdown formatting: added blank lines before lists, improved spacing

docs/group-syllabus/undergraduate-specifics.md


7. docs/group-syllabus/computers.md 📝 Documentation +13/-26

Heading normalization and HPC documentation link update

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized all section headings: ### to ##
• Fixed markdown formatting: improved spacing around lists and sections
• Updated Sandia HPC access link from /access/ssh/ to /access/

docs/group-syllabus/computers.md


8. docs/group-syllabus/doing-research.md 📝 Documentation +13/-24

Heading structure normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section headings: ### to ##
• Fixed markdown formatting: added blank lines before lists and bullet points
• Improved spacing consistency throughout the document

docs/group-syllabus/doing-research.md


9. docs/group-syllabus/intro-to-group.md 📝 Documentation +10/-24

Heading normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Restructured heading hierarchy for MkDocs compatibility
• Changed main heading to # and normalized subsection headings
• Fixed markdown formatting: added blank lines before lists, improved spacing
• Minor text improvements for clarity

docs/group-syllabus/intro-to-group.md


10. docs/group-syllabus/going-to-conferences.md 📝 Documentation +10/-22

Heading normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section headings: ### to ##
• Fixed markdown formatting: added blank lines before lists and bullet points
• Improved spacing consistency throughout the document

docs/group-syllabus/going-to-conferences.md


11. docs/group-syllabus/responding-to-reviewers.md 📝 Documentation +11/-20

Heading normalization and template link update

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section headings: ### to ##
• Updated template reference from relative path to GitHub URL
• Fixed markdown formatting: added blank lines before lists, improved spacing

docs/group-syllabus/responding-to-reviewers.md


12. readme.md 📝 Documentation +4/-61

README simplification for MkDocs migration

• Simplified README to focus on MkDocs documentation site
• Removed detailed table of contents and navigation structure
• Removed badges and contributing guidelines
• Kept only essential information: title, documentation link, and license
• Reduced from comprehensive guide to minimal landing page

readme.md


13. docs/group-syllabus/when-where-working.md 📝 Documentation +7/-16

Heading normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section headings: ### to ##
• Fixed markdown formatting: added blank lines before lists, improved spacing
• Minor text improvements for consistency

docs/group-syllabus/when-where-working.md


14. docs/group-syllabus/why-phd.md 📝 Documentation +3/-13

Heading normalization and doctoc removal

• Removed auto-generated table of contents (doctoc comments)
• Changed main heading from ## to # for MkDocs H1 structure
• Normalized section heading: ### to ##
• Fixed markdown formatting: improved spacing consistency
• Removed trailing blank lines at end of file

docs/group-syllabus/why-phd.md


15. docs/group-syllabus/publishing.md Formatting +5/-17

Normalize heading levels and remove auto-generated TOC

• Removed auto-generated doctoc table of contents comments and manual TOC entries
• Changed main heading from level 3 (##) to level 1 (#)
• Converted all section headings from level 3 (###) to level 2 (##)
• Fixed trailing whitespace issues

docs/group-syllabus/publishing.md


16. docs/group-syllabus/funding.md Formatting +6/-17

Normalize heading levels and remove auto-generated TOC

• Removed auto-generated doctoc table of contents comments and manual TOC entries
• Changed main heading from level 2 (##) to level 1 (#)
• Converted all subsection headings from level 3 (###) to level 2 (##)
• Cleaned up trailing whitespace and blank lines

docs/group-syllabus/funding.md


17. mkdocs.yml ⚙️ Configuration changes +65/-0

Add MkDocs Material theme configuration

• Created new MkDocs configuration file with Material theme setup
• Configured site metadata, URL, and repository information
• Defined dark/light mode color scheme with custom branding colors (#292929 primary, #c0995e
 accent)
• Set up navigation structure with syllabus, papers/writing, and details sections
• Configured MathJax support and custom CSS/JavaScript assets

mkdocs.yml


18. docs/index.md 📝 Documentation +37/-0

Create documentation site homepage

• Created new homepage for documentation site
• Added welcome message and navigation links organized by category
• Included links to syllabus sections, papers/writing guides, and details pages
• Added links to GitHub-hosted templates for papers, reviews, figures, and talks
• Added copyright notice for Spencer Bryngelson

docs/index.md


19. docs/group-syllabus/hardware.md Formatting +2/-9

Normalize heading level and remove auto-generated TOC

• Removed auto-generated doctoc table of contents comments
• Changed main heading from level 2 (##) to level 1 (#)
• Fixed trailing whitespace at end of file

docs/group-syllabus/hardware.md


20. docs/assets/extra.css ⚙️ Configuration changes +65/-0

Add custom CSS styling for Material theme

• Created custom CSS file for Material theme customization
• Defined CSS variables for primary color (#292929) and accent color (#c0995e)
• Styled dark mode (slate scheme) with custom background colors
• Customized header, navigation links, and footer styling
• Set logo dimensions and hid footer element

docs/assets/extra.css


21. .github/workflows/deploy.yml ⚙️ Configuration changes +41/-0

Add GitHub Actions deployment workflow

• Created GitHub Actions workflow for automatic documentation deployment
• Configured to trigger on pushes to master branch and manual workflow dispatch
• Build step installs zensical and runs zensical build command
• Upload and deploy steps push built site to GitHub Pages
• Set appropriate permissions for pages write and id-token

.github/workflows/deploy.yml


22. docs/group-syllabus/challenges.md Formatting +1/-8

Normalize heading level and remove auto-generated TOC

• Removed auto-generated doctoc table of contents comments and manual TOC entries
• Changed main heading from level 2 (##) to level 1 (#)

docs/group-syllabus/challenges.md


23. .github/workflows/markdown-lint.yml ⚙️ Configuration changes +18/-0

Add markdown linting GitHub Actions workflow

• Created new GitHub Actions workflow for markdown linting
• Configured to run on push, pull request, and manual dispatch
• Uses DavidAnson/markdownlint-cli2-action to lint all markdown files in docs/ directory

.github/workflows/markdown-lint.yml


24. docs/assets/mathjax.js ⚙️ Configuration changes +12/-0

Add MathJax configuration for math rendering

• Created MathJax configuration file for mathematical equation rendering
• Configured inline math delimiters (\(, \), $, $)
• Configured display math delimiters (\[, \], $$, $$)
• Set options to process HTML class arithmatex for math rendering

docs/assets/mathjax.js


25. .github/workflows/spelling.yml Dependencies +1/-1

Update GitHub Actions checkout version

• Updated checkout action from version 3 to version 4

.github/workflows/spelling.yml


26. .markdownlint.yaml ⚙️ Configuration changes +7/-0

Add markdownlint configuration

• Created markdownlint configuration file
• Enabled rules for heading increment (MD001), blank lines around lists (MD032), multiple blank
 lines (MD012), and trailing spaces (MD009)
• Set default to false to only enforce specified rules

.markdownlint.yaml


27. docs/requirements.txt Dependencies +1/-0

Add Python dependencies for documentation build

• Created requirements file specifying zensical as a dependency
• Used by GitHub Actions workflow to build documentation

docs/requirements.txt


28. .github/toc-generator.yml Additional files +0/-10

...

.github/toc-generator.yml


29. .github/workflows/update-toc.yml Additional files +0/-36

...

.github/workflows/update-toc.yml


30. docs/group-syllabus/faq.md Additional files +0/-24

...

docs/group-syllabus/faq.md


31. misc/mentoring-plan.md Additional files +0/-42

...

misc/mentoring-plan.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Non-reproducible docs deploy 🐞 Bug ⛯ Reliability
Description
The Pages deploy workflow installs zensical from PyPI without version pinning and ignores
docs/requirements.txt, so builds can drift/break over time and local vs CI dependencies can
diverge.
Code

.github/workflows/deploy.yml[R24-27]

+      - name: Build docs
+        run: |
+          pip install zensical
+          zensical build
Evidence
deploy.yml installs zensical directly (floating latest) and does not install from the repo
requirements file, even though docs/requirements.txt exists. This makes the deploy environment
non-deterministic and undermines the purpose of committing requirements.

.github/workflows/deploy.yml[24-31]
docs/requirements.txt[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The GitHub Pages deploy workflow installs `zensical` with `pip install zensical`, which pulls whatever the latest version is at build time. The repo also includes `docs/requirements.txt`, but CI never uses it. This creates non-reproducible deploys and can cause sudden build failures.

### Issue Context
The workflow is responsible for building and publishing the docs to GitHub Pages. For reliable docs deployments, dependency versions should be deterministic and shared between local and CI.

### Fix Focus Areas
- .github/workflows/deploy.yml[24-28]
- docs/requirements.txt[1-1]

### Suggested change
1) Change the workflow to install from requirements:
```sh
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
```
2) Pin `zensical` in `docs/requirements.txt` (e.g., `zensical==&lt;known-good-version&gt;`), or introduce a constraints file.
3) (Optional) Add caching for pip to speed builds.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Typos action not pinned 🐞 Bug ⛨ Security
Description
The spell-check workflow uses crate-ci/typos@master, which is a mutable branch reference and
increases supply-chain risk and non-deterministic CI behavior.
Code

.github/workflows/spelling.yml[R15-16]

    - name: Spell Check
      uses: crate-ci/typos@master
Evidence
Referencing a moving branch (@master) means the executed action code can change without review of
this repository, which is a common CI supply-chain risk.

.github/workflows/spelling.yml[12-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The workflow references `crate-ci/typos@master`, which can change over time and introduces supply-chain and reproducibility risk.

### Issue Context
CI workflows should avoid floating branches for actions, especially for third-party repositories.

### Fix Focus Areas
- .github/workflows/spelling.yml[15-16]

### Suggested change
Replace `@master` with either:
- a specific release tag (preferred for readability), or
- a commit SHA (preferred for immutability).

Example:
```yaml
uses: crate-ci/typos@&lt;tag-or-sha&gt;
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Deploy can race 🐞 Bug ⛯ Reliability
Description
The Pages deployment workflow lacks concurrency control; multiple pushes can overlap and deploy an
older artifact after a newer one, causing docs to temporarily regress.
Code

.github/workflows/deploy.yml[R1-15]

+name: Deploy docs
+
+on:
+  push:
+    branches:
+      - master
+  workflow_dispatch:
+
+permissions:
+  contents: read
+  pages: write
+  id-token: write
+
+jobs:
+  build:
Evidence
The workflow defines build+deploy jobs but has no concurrency stanza to ensure only the latest run
deploys. Without concurrency, multiple workflow runs can execute the deploy job out of order if runs
overlap.

.github/workflows/deploy.yml[1-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Without workflow concurrency controls, two pushes in quick succession can result in an earlier workflow run deploying after a later one, effectively publishing stale docs.

### Issue Context
GitHub Actions can run multiple instances of the same workflow in parallel. Pages deploys should generally be serialized and should prefer the most recent commit.

### Fix Focus Areas
- .github/workflows/deploy.yml[1-15]

### Suggested change
Add something like:
```yaml
concurrency:
 group: pages
 cancel-in-progress: true
```
near the top-level of the workflow (e.g., after `on:`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Unpinned external MathJax 🐞 Bug ⛨ Security
Description
MkDocs loads MathJax from unpkg.com using a floating major version (@3), which is a runtime
supply-chain risk and can introduce unexpected changes in rendering over time.
Code

mkdocs.yml[R35-37]

+extra_javascript:
+  - assets/mathjax.js
+  - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
Evidence
The config includes a remote script URL with a non-exact version selector (@3). This means site
visitors execute third-party JavaScript that can change without a corresponding change in this repo.

mkdocs.yml[35-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The docs site pulls MathJax from a CDN using a floating major version (`@3`). This is a runtime dependency that can change without review.

### Issue Context
This affects users at page render time (browser downloads and executes the script). Pinning and/or self-hosting reduces supply-chain risk and makes behavior more stable.

### Fix Focus Areas
- mkdocs.yml[35-38]

### Suggested change
Option A (pin exact version):
- Change the URL to an exact version, e.g. `.../mathjax@3.x.y/...`

Option B (self-host):
- Add the MathJax bundle under `docs/assets/` and reference it via `extra_javascript` instead of a remote URL.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

5. Markdownlint coverage gap 🐞 Bug ✧ Quality
Description
Markdownlint only runs on docs/**/*.md, so root markdown files (e.g., readme.md) won’t be
linted, allowing style issues to slip through CI.
Code

.github/workflows/markdown-lint.yml[R15-18]

+      - name: Run markdownlint
+        uses: DavidAnson/markdownlint-cli2-action@v19
+        with:
+          globs: "docs/**/*.md"
Evidence
The workflow glob is restricted to docs/**/*.md, excluding non-docs markdown files in the
repository root.

.github/workflows/markdown-lint.yml[15-18]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
markdownlint currently only checks markdown under `docs/`, leaving other markdown files unlinted.

### Issue Context
This is a quality/coverage issue rather than a functional problem.

### Fix Focus Areas
- .github/workflows/markdown-lint.yml[15-18]

### Suggested change
Adjust `globs` to include additional patterns, e.g.:
```yaml
globs: |
 *.md
 docs/**/*.md
```
(Optionally include `scripts/**/*.md`, etc., depending on desired coverage.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +24 to +27
- name: Build docs
run: |
pip install zensical
zensical build

Choose a reason for hiding this comment

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

Action required

1. Non-reproducible docs deploy 🐞 Bug ⛯ Reliability

The Pages deploy workflow installs zensical from PyPI without version pinning and ignores
docs/requirements.txt, so builds can drift/break over time and local vs CI dependencies can
diverge.
Agent Prompt
### Issue description
The GitHub Pages deploy workflow installs `zensical` with `pip install zensical`, which pulls whatever the latest version is at build time. The repo also includes `docs/requirements.txt`, but CI never uses it. This creates non-reproducible deploys and can cause sudden build failures.

### Issue Context
The workflow is responsible for building and publishing the docs to GitHub Pages. For reliable docs deployments, dependency versions should be deterministic and shared between local and CI.

### Fix Focus Areas
- .github/workflows/deploy.yml[24-28]
- docs/requirements.txt[1-1]

### Suggested change
1) Change the workflow to install from requirements:
```sh
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
```
2) Pin `zensical` in `docs/requirements.txt` (e.g., `zensical==<known-good-version>`), or introduce a constraints file.
3) (Optional) Add caching for pip to speed builds.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 15 to 16
- name: Spell Check
uses: crate-ci/typos@master

Choose a reason for hiding this comment

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

Action required

2. Typos action not pinned 🐞 Bug ⛨ Security

The spell-check workflow uses crate-ci/typos@master, which is a mutable branch reference and
increases supply-chain risk and non-deterministic CI behavior.
Agent Prompt
### Issue description
The workflow references `crate-ci/typos@master`, which can change over time and introduces supply-chain and reproducibility risk.

### Issue Context
CI workflows should avoid floating branches for actions, especially for third-party repositories.

### Fix Focus Areas
- .github/workflows/spelling.yml[15-16]

### Suggested change
Replace `@master` with either:
- a specific release tag (preferred for readability), or
- a commit SHA (preferred for immutability).

Example:
```yaml
uses: crate-ci/typos@<tag-or-sha>
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant