Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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.
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 `<DOCUMENT_NAME>` 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/[email protected]
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: <DOCUMENT_NAME>
path: build/<DOCUMENT_NAME>.pdf
- name: Upload DOCX artifact
uses: actions/upload-artifact@v4
with:
name: <DOCUMENT_NAME>-docx
path: build/<DOCUMENT_NAME>.docx
- name: Upload HTML artifact
uses: actions/upload-artifact@v4
with:
name: <DOCUMENT_NAME>-html
path: build/<DOCUMENT_NAME>.html
```

This will run on every PR update and upload the artifacts for you to download
10 changes: 10 additions & 0 deletions doc_build/template/default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*" }