From a515d871a5d94df8ad784d956fdbb14928a0f31b Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 09:15:16 -0800 Subject: [PATCH 1/6] Disallow floating diagrams --- doc_build/template/default.latex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc_build/template/default.latex b/doc_build/template/default.latex index 1801a54..2d18ac9 100644 --- a/doc_build/template/default.latex +++ b/doc_build/template/default.latex @@ -17,6 +17,16 @@ $endif$ $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ +% Start Disallow diagram floating +\usepackage{float} +\let\origfigure\figure +\let\endorigfigure\endfigure +\renewenvironment{figure}[1][2] { + \expandafter\origfigure\expandafter[H] +} { + \endorigfigure +} +% End Disallow diagram floating \usepackage{amsmath,amssymb} $-- $-- section numbering From abd7c660a5d90b1f7cc31725539a349279326f7e Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 09:22:59 -0800 Subject: [PATCH 2/6] Add pixi-build-api-version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 17a1ca8..a6ca594 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ channels = [ "https://prefix.dev/conda-forge", ] platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"] -preview = ["pixi-build"] +preview = ["pixi-build", "pixi-build-api-version"] [tool.pixi.package.host-dependencies] flit-core = ">=3.4" From 7d0c2f20245e7314d4a7c551d11b53bf7a15c25b Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 09:53:24 -0800 Subject: [PATCH 3/6] Use newer pixi-build --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a6ca594..2a82bda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ channels = [ "https://prefix.dev/conda-forge", ] platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"] -preview = ["pixi-build", "pixi-build-api-version"] +preview = ["pixi-build"] [tool.pixi.package.host-dependencies] flit-core = ">=3.4" @@ -40,4 +40,4 @@ librsvg = "*" tectonic = "*" [tool.pixi.package.build] -backend = { name = "pixi-build-python", version = "0.1.*" } +backend = { name = "pixi-build-python", version = "0.4.*" } From 232fdb6587b18d2236f18abcb96b2f699d937ae5 Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 10:05:12 -0800 Subject: [PATCH 4/6] Fix pixi build, fix overflow of diagrams and add CI --- .github/workflows/build_docs.yml | 40 +++++++++++++++++++++++ README.md | 54 ++++++++++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build_docs.yml diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml new file mode 100644 index 0000000..22d7a9d --- /dev/null +++ b/.github/workflows/build_docs.yml @@ -0,0 +1,40 @@ +name: build_docs.yml +on: + push: + branches: + - main + pull_request: + types: [ opened, synchronize ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.8.9 + with: + pixi-version: v0.48.1 + - name: Install DejaVu fonts + run: | + sudo apt-get update + sudo apt-get install -y fonts-dejavu + fc-cache -fv + - name: Build PDF + run: pixi run test build + - name: Upload PDF artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec + path: build/aousd_core_spec.pdf + - name: Upload DOCX artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec-docx + path: build/aousd_core_spec.docx + - name: Upload HTML artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec-html + path: build/aousd_core_spec.html \ No newline at end of file diff --git a/README.md b/README.md index a38005d..b892525 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ description = "Build scripts for my WG spec" requires-python = ">= 3.10" dependencies = [] -[tool.pixi.project] +[tool.pixi.workspace] channels = [ "conda-forge" ] platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"] preview = ["pixi-build"] @@ -105,4 +105,54 @@ methods and may or may not work. ### Dependencies -Dependencies are automatically installed by [pixi](https://pixi.sh), and should work on macOS/Linux/Windows. \ No newline at end of file +Dependencies are automatically installed by [pixi](https://pixi.sh), and should work on macOS/Linux/Windows. + +### Setting Up CI + +To automate CI in your specifications repo, add the following at `.github/workflows/build_docs.yml` + + +```yaml +name: build_docs.yml +on: + push: + branches: + - main + pull_request: + types: [ opened, synchronize ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Setup Pixi + uses: prefix-dev/setup-pixi@v0.8.9 + with: + pixi-version: v0.48.1 + - name: Install DejaVu fonts + run: | + sudo apt-get update + sudo apt-get install -y fonts-dejavu + fc-cache -fv + - name: Build PDF + run: pixi run main build + - name: Upload PDF artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec + path: build/aousd_core_spec.pdf + - name: Upload DOCX artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec-docx + path: build/aousd_core_spec.docx + - name: Upload HTML artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_core_spec-html + path: build/aousd_core_spec.html +``` + +This will run on every PR update and upload the artifacts for you to download \ No newline at end of file From 2ff37030585234ae4c2fb23fbb59197842a55b3b Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 10:07:15 -0800 Subject: [PATCH 5/6] Fix artifacts path --- .github/workflows/build_docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 22d7a9d..bfef153 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -27,14 +27,14 @@ jobs: uses: actions/upload-artifact@v4 with: name: aousd_core_spec - path: build/aousd_core_spec.pdf + path: tests/build/aousd_core_spec.pdf - name: Upload DOCX artifact uses: actions/upload-artifact@v4 with: name: aousd_core_spec-docx - path: build/aousd_core_spec.docx + path: tests/build/aousd_core_spec.docx - name: Upload HTML artifact uses: actions/upload-artifact@v4 with: name: aousd_core_spec-html - path: build/aousd_core_spec.html \ No newline at end of file + path: tests/build/aousd_core_spec.html \ No newline at end of file From 0806f4af07d30efe35526dd52bb52a93ba851897 Mon Sep 17 00:00:00 2001 From: Dhruv Govil Date: Mon, 3 Nov 2025 10:13:20 -0800 Subject: [PATCH 6/6] Update CI steps --- .github/workflows/build_docs.yml | 12 ++++++------ README.md | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index bfef153..7d52cc7 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -26,15 +26,15 @@ jobs: - name: Upload PDF artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec - path: tests/build/aousd_core_spec.pdf + name: aousd_doc_build + path: tests/build/aousd_doc_build.pdf - name: Upload DOCX artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec-docx - path: tests/build/aousd_core_spec.docx + name: aousd_doc_build-docx + path: tests/build/aousd_doc_build.docx - name: Upload HTML artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec-html - path: tests/build/aousd_core_spec.html \ No newline at end of file + name: aousd_doc_build-html + path: tests/build/aousd_doc_build.html \ No newline at end of file diff --git a/README.md b/README.md index b892525..3d1ccfd 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Dependencies are automatically installed by [pixi](https://pixi.sh), and should To automate CI in your specifications repo, add the following at `.github/workflows/build_docs.yml` +But replace `` with your documents output name ```yaml name: build_docs.yml @@ -141,18 +142,18 @@ jobs: - name: Upload PDF artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec - path: build/aousd_core_spec.pdf + name: + path: build/.pdf - name: Upload DOCX artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec-docx - path: build/aousd_core_spec.docx + name: -docx + path: build/.docx - name: Upload HTML artifact uses: actions/upload-artifact@v4 with: - name: aousd_core_spec-html - path: build/aousd_core_spec.html + name: -html + path: build/.html ``` This will run on every PR update and upload the artifacts for you to download \ No newline at end of file