diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml new file mode 100644 index 0000000..7d52cc7 --- /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_doc_build + path: tests/build/aousd_doc_build.pdf + - name: Upload DOCX artifact + uses: actions/upload-artifact@v4 + with: + name: aousd_doc_build-docx + path: tests/build/aousd_doc_build.docx + - name: Upload HTML artifact + uses: actions/upload-artifact@v4 + with: + 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 a38005d..3d1ccfd 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,55 @@ 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` + +But replace `` with your documents output name + +```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: + path: build/.pdf + - name: Upload DOCX artifact + uses: actions/upload-artifact@v4 + with: + name: -docx + path: build/.docx + - name: Upload HTML artifact + uses: actions/upload-artifact@v4 + with: + 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 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 diff --git a/pyproject.toml b/pyproject.toml index 17a1ca8..2a82bda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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.*" }