From 27864e812866b41689a6e794b2db6914492deae7 Mon Sep 17 00:00:00 2001 From: Rob Gowin Date: Fri, 30 May 2025 14:59:48 -0400 Subject: [PATCH 1/2] Add flow to generate docs using MkDocs. Source/Doc/Makefile: - add steps to 'deploy_mkdocs' target to generate MkDocs input. - change default image extension for GFM output to SVG. Source/Doc/mkdocs.yaml: New config file for 'mkdocs build.' --- Source/Doc/Makefile | 17 +++++++++++++++-- Source/Doc/mkdocs.yml | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 Source/Doc/mkdocs.yml diff --git a/Source/Doc/Makefile b/Source/Doc/Makefile index 8abe81f6..a6f19e74 100644 --- a/Source/Doc/Makefile +++ b/Source/Doc/Makefile @@ -31,12 +31,12 @@ all :: deploy pandoc $< -f markdown -t dokuwiki -s -o $@ --default-image-extension=pdf %.gfm : %.tmp - pandoc $< -f markdown -t gfm-yaml_metadata_block -s -o $@ --default-image-extension=pdf + pandoc $< -f markdown -t gfm-yaml_metadata_block -s -o $@ --default-image-extension=svg %.txt : %.tmp pandoc $< -f markdown -t plain -s -o $@ --default-image-extension=pdf -deploy : +deploy : deploy_mkdocs cp Introduction.gfm "../../ReadMe.md" cp Introduction.txt "../../ReadMe.txt" cp Introduction.pdf "../../Doc/RomWBW Introduction.pdf" @@ -45,3 +45,16 @@ deploy : cp Applications.pdf "../../Doc/RomWBW Applications.pdf" cp Catalog.pdf "../../Doc/RomWBW Disk Catalog.pdf" cp Hardware.pdf "../../Doc/RomWBW Hardware.pdf" + +deploy_mkdocs : Introduction.gfm UserGuide.gfm SystemGuide.gfm Applications.gfm Catalog.gfm Hardware.gfm + rm -rf mkdocs + mkdir -p mkdocs/UserGuide/Graphics mkdocs/SystemGuide/Graphics + cp Introduction.gfm mkdocs/Introduction.md + cp UserGuide.gfm mkdocs/UserGuide.md + cp SystemGuide.gfm mkdocs/SystemGuide.md + cp Applications.gfm mkdocs/Applications.md + cp Catalog.gfm mkdocs/Catalog.md + cp Hardware.gfm mkdocs/Hardware.md + cp ReadMe.md mkdocs/README.md + cp Graphics/*.svg mkdocs/UserGuide/Graphics + cp Graphics/*.svg mkdocs/SystemGuide/Graphics diff --git a/Source/Doc/mkdocs.yml b/Source/Doc/mkdocs.yml new file mode 100644 index 00000000..c6d32454 --- /dev/null +++ b/Source/Doc/mkdocs.yml @@ -0,0 +1,16 @@ +site_name: RomWBW Documentation V3.6 +repo_url: https://github.com/wwarthen/RomWBW +edit_uri: "" +docs_dir: mkdocs +nav: + - Introduction: Introduction.md + - User Guide: UserGuide.md + - System Guide: SystemGuide.md + - Applications: Applications.md + - Catalog: Catalog.md + - Hardware: Hardware.md +theme: + name: mkdocs + color_mode: auto + user_color_mode_toggle: true + navigation_depth: 3 From eaca39b557f6f69aa5c5a3b2da6840dc372c638c Mon Sep 17 00:00:00 2001 From: Rob Gowin Date: Fri, 30 May 2025 15:01:47 -0400 Subject: [PATCH 2/2] Add steps to commit GH action to deploy docs to GitHub Pages. --- .github/workflows/commit.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 2110be86..c83d0a6c 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -25,9 +25,12 @@ jobs: - name: Build run: | export TZ='America/Los_Angeles' - sudo apt-get install srecord + sudo apt-get install srecord gpp pandoc + pip install mkdocs make distlog rm -rf .git* + make -C Source/Doc deploy_mkdocs + mkdocs build -f Source/Doc/mkdocs.yml - name: List Output run: | @@ -35,6 +38,13 @@ jobs: ls -l find -type f -exec md5sum '{}' \; + - name: Deploy Docs + uses: peaceiris/actions-gh-pages@v4 + if: github.ref == 'refs/heads/master' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: Source/Doc/site + - name: Upload Artifact uses: actions/upload-artifact@v4.3.0 with: