Skip to content

Commit e4f14cf

Browse files
authored
Merge pull request #214 from bckohan/docs
fix pdf docs build
2 parents 6c7f0a6 + ac8d17c commit e4f14cf

9 files changed

Lines changed: 85 additions & 70 deletions

File tree

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
persist-credentials: false
2626

2727
- name: "Run analysis"
28-
uses: ossf/scorecard-action@v2.4.3
28+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a
2929
with:
3030
results_file: results.sarif
3131
results_format: sarif
@@ -47,7 +47,7 @@ jobs:
4747
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4848
# format to the repository Actions tab.
4949
- name: "Upload artifact"
50-
uses: actions/upload-artifact@v7
50+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
5151
with:
5252
name: SARIF file
5353
path: results.sarif
@@ -56,6 +56,6 @@ jobs:
5656
# Upload the results to GitHub's code scanning dashboard (optional).
5757
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
5858
- name: "Upload to code-scanning"
59-
uses: github/codeql-action/upload-sarif@v4
59+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e
6060
with:
6161
sarif_file: results.sarif

.github/workflows/test.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ jobs:
6262
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
6363
with:
6464
persist-credentials: false
65-
- uses: actions/setup-node@v4
66-
with:
67-
node-version: 22
6865
- name: Set up Python ${{ matrix.python-version }}
6966
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
7067
id: sp
@@ -142,9 +139,6 @@ jobs:
142139
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
143140
with:
144141
persist-credentials: false
145-
- uses: actions/setup-node@v4
146-
with:
147-
node-version: 22
148142
- name: Set up Python ${{ matrix.python-version }}
149143
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
150144
id: sp
@@ -225,9 +219,6 @@ jobs:
225219
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
226220
with:
227221
persist-credentials: false
228-
- uses: actions/setup-node@v4
229-
with:
230-
node-version: 22
231222
- name: Set up Python ${{ matrix.python-version }}
232223
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
233224
id: sp

.github/workflows/update_coc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
24+
with:
25+
persist-credentials: false
2426

2527
- name: Fetch CODE_OF_CONDUCT.md from django-commons
2628
run: |

.github/workflows/zizmor.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
paths:
8+
- ".github/workflows/**/*.yml"
89
schedule:
910
# Run weekly
1011
- cron: '0 0 * * 0'
@@ -28,24 +29,36 @@ jobs:
2829
persist-credentials: false
2930

3031
- name: Set up Rust
31-
uses: actions-rust-lang/setup-rust-toolchain@v1
32-
32+
uses: actions-rust-lang/setup-rust-toolchain@a0b538fa0b742a6aa35d6e2c169b4bd06d225a98
33+
- name: Install jq
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y jq
3337
- name: Install Zizmor
3438
run: |
3539
cargo install --locked zizmor
3640
3741
- name: Run Zizmor analysis
3842
run: |
39-
zizmor --format sarif .github/workflows/ > results.sarif
43+
zizmor --format sarif .github/workflows/ > zizmor.sarif
4044
4145
- name: Upload analysis results
42-
uses: actions/upload-artifact@v7
46+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
4347
with:
4448
name: zizmor-results
45-
path: results.sarif
49+
path: zizmor.sarif
4650
retention-days: 7
4751

4852
- name: Upload to code-scanning
49-
uses: github/codeql-action/upload-sarif@v4
53+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e
5054
with:
51-
sarif_file: results.sarif
55+
sarif_file: zizmor.sarif
56+
57+
- name: Fail on Findings
58+
run: |
59+
count="$(
60+
jq '([.runs[]? | (.results // [])[] | select(.level != "note")] | length) // 0' \
61+
zizmor.sarif
62+
)"
63+
echo "Zizmor findings: $count"
64+
test "$count" -eq 0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,4 @@ cython_debug/
159159
/render_static/tests/examples/static
160160
requirements.txt
161161
uv.lock
162+
zizmor.sarif

doc/.readthedocs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ build:
2020
# Build documentation in the docs/ directory with Sphinx
2121
sphinx:
2222
configuration: doc/source/conf.py
23+
24+
# Optionally build your docs in additional formats such as PDF and ePub
25+
formats:
26+
- pdf

doc/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
# so a file named "default.css" will overwrite the builtin "default.css".
7575
html_static_path = []
7676

77+
latex_engine = 'xelatex'
78+
7779
todo_include_todos = True
7880

7981
# js_source_path = (

doc/source/index.rst

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,55 @@
22
Introduction
33
============
44

5-
.. image:: https://img.shields.io/badge/License-MIT-blue.svg
6-
:target: https://lbesson.mit-license.org/
7-
:alt: License: BSD
8-
9-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
10-
:target: https://github.com/astral-sh/ruff
11-
:alt: Ruff
12-
13-
.. image:: https://badge.fury.io/py/django-render-static.svg
14-
:target: https://pypi.python.org/pypi/django-render-static/
15-
:alt: PyPI version
16-
17-
.. image:: https://img.shields.io/pypi/pyversions/django-render-static.svg
18-
:target: https://pypi.python.org/pypi/django-render-static/
19-
:alt: PyPI pyversions
20-
21-
.. image:: https://img.shields.io/pypi/djversions/django-render-static.svg
22-
:target: https://pypi.org/project/django-render-static/
23-
:alt: PyPI Django versions
24-
25-
.. image:: https://img.shields.io/pypi/status/django-render-static.svg
26-
:target: https://pypi.python.org/pypi/django-render-static
27-
:alt: PyPI status
28-
29-
.. image:: https://img.shields.io/pypi/types/django-render-static.svg
30-
:target: https://pypi.python.org/pypi/django-render-static
31-
:alt: PyPi Typed
32-
33-
.. image:: https://readthedocs.org/projects/django-render-static/badge/?version=latest
34-
:target: http://django-render-static.readthedocs.io/?badge=latest/
35-
:alt: Documentation Status
36-
37-
.. image:: https://img.shields.io/codecov/c/github/bckohan/django-render-static/main.svg
38-
:target: https://codecov.io/github/bckohan/django-render-static?branch=main
39-
:alt: Code Coverage
40-
41-
.. image:: https://github.com/bckohan/django-render-static/actions/workflows/test.yml/badge.svg?branch=main
42-
:target: https://github.com/bckohan/django-render-static/actions/workflows/test.yml?query=branch:master
43-
:alt: Test Status
44-
45-
.. image:: https://github.com/bckohan/django-render-static/actions/workflows/lint.yml/badge.svg?branch=main
46-
:target: https://github.com/bckohan/django-render-static/actions/workflows/lint.yml?query=branch:master
47-
:alt: Lint Status
48-
49-
.. image:: https://img.shields.io/badge/Published%20on-Django%20Packages-0c3c26
50-
:target: https://djangopackages.org/packages/p/django-render-static/
51-
:alt: Published on Django Packages
5+
.. only:: html
6+
7+
.. image:: https://img.shields.io/badge/License-MIT-blue.svg
8+
:target: https://lbesson.mit-license.org/
9+
:alt: License: BSD
10+
11+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
12+
:target: https://github.com/astral-sh/ruff
13+
:alt: Ruff
14+
15+
.. image:: https://badge.fury.io/py/django-render-static.svg
16+
:target: https://pypi.python.org/pypi/django-render-static/
17+
:alt: PyPI version
18+
19+
.. image:: https://img.shields.io/pypi/pyversions/django-render-static.svg
20+
:target: https://pypi.python.org/pypi/django-render-static/
21+
:alt: PyPI pyversions
22+
23+
.. image:: https://img.shields.io/pypi/djversions/django-render-static.svg
24+
:target: https://pypi.org/project/django-render-static/
25+
:alt: PyPI Django versions
26+
27+
.. image:: https://img.shields.io/pypi/status/django-render-static.svg
28+
:target: https://pypi.python.org/pypi/django-render-static
29+
:alt: PyPI status
30+
31+
.. image:: https://img.shields.io/pypi/types/django-render-static.svg
32+
:target: https://pypi.python.org/pypi/django-render-static
33+
:alt: PyPi Typed
34+
35+
.. image:: https://readthedocs.org/projects/django-render-static/badge/?version=latest
36+
:target: http://django-render-static.readthedocs.io/?badge=latest/
37+
:alt: Documentation Status
38+
39+
.. image:: https://img.shields.io/codecov/c/github/bckohan/django-render-static/main.svg
40+
:target: https://codecov.io/github/bckohan/django-render-static?branch=main
41+
:alt: Code Coverage
42+
43+
.. image:: https://github.com/bckohan/django-render-static/actions/workflows/test.yml/badge.svg?branch=main
44+
:target: https://github.com/bckohan/django-render-static/actions/workflows/test.yml?query=branch:master
45+
:alt: Test Status
46+
47+
.. image:: https://github.com/bckohan/django-render-static/actions/workflows/lint.yml/badge.svg?branch=main
48+
:target: https://github.com/bckohan/django-render-static/actions/workflows/lint.yml?query=branch:master
49+
:alt: Lint Status
50+
51+
.. image:: https://img.shields.io/badge/Published%20on-Django%20Packages-0c3c26
52+
:target: https://djangopackages.org/packages/p/django-render-static/
53+
:alt: Published on Django Packages
5254

5355
Use Django's template engines to render static files that are collected during the
5456
:django-admin:`collectstatic` routine and likely served above Django at runtime. Files rendered by

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ clean: clean-docs clean-git-ignored clean-env
9393

9494
# build html documentation
9595
build-docs-html:
96-
@just run --group docs --all-extras --isolated --exact sphinx-build --fresh-env --builder html --doctree-dir ./doc/build/doctrees ./doc/source ./doc/build/html
96+
@just run --no-default-groups --group docs --all-extras --isolated --exact sphinx-build --fresh-env --builder html --doctree-dir ./doc/build/doctrees ./doc/source ./doc/build/html
9797

9898
[script]
9999
_open-pdf-docs:
100100
import webbrowser
101101
from pathlib import Path
102-
webbrowser.open(f"file://{Path('./doc/build/pdf/django-render-static.pdf').absolute()}")
102+
webbrowser.open(f"file://{Path('./doc/build/pdf/djangorenderstatic.pdf').absolute()}")
103103

104104
# build pdf documentation
105105
build-docs-pdf:
106-
@just run --group docs --all-extras --isolated --exact sphinx-build --fresh-env --builder latex --doctree-dir ./doc/build/doctrees ./doc/source ./doc/build/pdf
106+
@just run --no-default-groups --group docs --all-extras --isolated --exact sphinx-build --fresh-env --builder latex --doctree-dir ./doc/build/doctrees ./doc/source ./doc/build/pdf
107107
make -C ./doc/build/pdf
108108
@just _open-pdf-docs
109109

0 commit comments

Comments
 (0)