docs: build a documentation site with MkDocs and deploy it to Pages - #51
Merged
Merged
Conversation
The site is built from the Markdown files already in the repository and keeps their repository paths, so relative links work on the site as they do on GitHub. The Docs workflow builds it with --strict on pull requests and deploys it to GitHub Pages from main. Part of ThinkFlowLab#45. Signed-off-by: Tianyao Wu <rayroy31@gmail.com>
1 task done
Contributor
|
thanks |
Contributor
Author
|
Since this merged, the docs build passes on every push to main, but the deploy job fails because GitHub Pages isn't enabled for the repo (all five pushes so far, up to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The first part of #45: the site itself, built from the existing pages.
mkdocs.yml: MkDocs with the Material theme and its search. The navigation has the README (overview and architecture), the frontend documentation, the recipes and this contributing guide. The model and backend READMEs, which describe planned work, stay on GitHub for now.docs/hooks.py: MkDocs only builds files underdocs_dirand refuses the repository root there, so the hook sets the root after the config is checked. That publishes the existing pages where they are, instead of moving them or copying them into stubs whose relative links break, and their links work on the site as they do on GitHub. Inline links to files that are not published, and to directories without a README, go to GitHub; onmainthat covers 6 links, such as.github/workflows/ci.ymlandsrc/models/.mkdocs servewatches only the published directories, sotarget/does not trigger rebuilds..github/workflows/docs.yml: builds the site withmkdocs build --stricton pull requests, which fails on broken links and anchors in the published pages. Onmainof this repository it also deploys the site to GitHub Pages.docs/requirements.txt: exact versions. MkDocs 1.6.1 is the current release, and Material requiresmkdocs<2.The other pages in #45 follow in separate PRs.
Deploying needs Settings → Pages → Source: GitHub Actions, ideally before this merges. If it merges first, the deploy job fails with "Ensure GitHub Pages has been enabled", and running the workflow on
mainagain after enabling it deploys the site.Test Plan
mkdocs build --strictwith the pinned versions: Python 3.13 on macOS, and Python 3.10 on Ubuntu 22.04 following the new CONTRIBUTING steps. Then a crawl of everyhrefandsrcin the built site, including theme files and anchors.recipe/.mkdocs serveon Ubuntu: pages, assets and search load, and editing or adding a file underrecipe/rebuilds the site. Also acargo build --release --lockedwhile it serves.docs.ymlandci.yml, andgit diff --check.System1-Omni Version / Commit: head
396a025onb50aa28. The Ubuntu,mkdocs serveand actionlint checks ran on the same change before a rebase ontob50aa28(the merge of #12, which changes no Markdown or workflows); the strict build, the crawl and the open-PR merges ran again after it.Test Result
main.mkdocs serve: all as expected; thecargo buildcaused no rebuilds.git diff --checkare clean.main. No Rust code changed, so the Rust checks are not affected.Self-review
Before marking this PR ready for review or requesting maintainer review, complete
the self-review checklist.
Keep the PR in draft while this work is incomplete.
For agent assistance, use the optional precheck-pr skill.