Skip to content

Commit c485ce3

Browse files
committed
Set up docs action
1 parent f7fb3be commit c485ce3

File tree

7 files changed

+65
-35
lines changed

7 files changed

+65
-35
lines changed

.github/workflows/docs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: docs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.13"
15+
- run: make init
16+
- run: make test
17+
- run: make docs
18+
- uses: actions/upload-pages-artifact@v3
19+
with:
20+
path: docs/html/
21+
22+
deploy:
23+
needs: build
24+
permissions:
25+
pages: write
26+
id-token: write
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Deploy to GitHub Pages
33+
id: deployment
34+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
deps
44
dist
5-
docs/*.html
6-
docs/*.css
7-
docs/dist
8-
docs/plot
5+
docs/html
96
node_modules
107
test/flottplot.js
118
test/*.json

Makefile

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -71,45 +71,45 @@ test/flottplot.js: src/bundles/flottplot-test.ts | deps/
7171

7272
# Documentation
7373

74-
DOCS := \
75-
docs/ \
76-
docs/index.html \
77-
docs/tutorial.html \
78-
docs/elements.html \
79-
docs/values.html \
80-
docs/python.html \
81-
docs/docs.css \
82-
docs/convert.js \
83-
docs/dist/flottplot-min.js \
84-
docs/dist/flottplot.css \
85-
docs/dist/flottplot-scan-min.js \
86-
docs/plot/sin-1x.png \
87-
docs/plot/sin-2x.png \
88-
docs/plot/sin-3x.png \
89-
docs/plot/cos-3x.png \
90-
docs/plot/cos-2x.png \
91-
docs/plot/cos-3x.png \
92-
docs/plot/adv_fwd_000.png \
93-
docs/plot/adv_bwd_000.png \
94-
docs/plot/adv_lag_000.png
95-
96-
docs: $(DOCS)
97-
98-
docs/%.css: docs/src/%.less
74+
DOCS_HTML := \
75+
docs/html/ \
76+
docs/html/index.html \
77+
docs/html/tutorial.html \
78+
docs/html/elements.html \
79+
docs/html/values.html \
80+
docs/html/python.html \
81+
docs/html/docs.css \
82+
docs/html/convert.js \
83+
docs/html/dist/flottplot-min.js \
84+
docs/html/dist/flottplot.css \
85+
docs/html/dist/flottplot-scan-min.js \
86+
docs/html/plot/sin-1x.png \
87+
docs/html/plot/sin-2x.png \
88+
docs/html/plot/sin-3x.png \
89+
docs/html/plot/cos-3x.png \
90+
docs/html/plot/cos-2x.png \
91+
docs/html/plot/cos-3x.png \
92+
docs/html/plot/adv_fwd_000.png \
93+
docs/html/plot/adv_bwd_000.png \
94+
docs/html/plot/adv_lag_000.png
95+
96+
docs: $(DOCS_HTML)
97+
98+
docs/html/%.css: docs/src/%.less
9999
npx lessc $< $@
100100

101-
docs/%.html: docs/util/build.py docs/src/template.html docs/src/%.html
101+
docs/html/%.html: docs/util/build.py docs/src/template.html docs/src/%.html
102102
python3 $+ > $@
103103

104-
docs/dist/%: dist/% | docs/dist/
104+
docs/html/dist/%: dist/% | docs/html/dist/
105105
cp $^ $@
106106

107-
docs/plot/sin-%x.png: docs/util/plot-trigonometric.py | docs/plot/
107+
docs/html/plot/sin-%x.png: docs/util/plot-trigonometric.py | docs/html/plot/
108108
python3 $< "sin" $* $@
109109

110-
docs/plot/cos-%x.png: docs/util/plot-trigonometric.py | docs/plot/
110+
docs/html/plot/cos-%x.png: docs/util/plot-trigonometric.py | docs/html/plot/
111111
python3 $< "cos" $* $@
112112

113-
docs/plot/adv_%_000.png: docs/util/plot-advection.py | docs/plot/
113+
docs/html/plot/adv_%_000.png: docs/util/plot-advection.py | docs/html/plot/
114114
python3 $< $* $(dir $@)
115115

docs/.nojekyll

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)