Skip to content

Commit be61043

Browse files
committed
add support for "make publish"
1 parent 68ee1e0 commit be61043

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Thumbs.db
2222
log.lammps
2323
log.cite
2424

25+
/.current-branch
26+
/publish.sh
2527
/html
2628
/epub
2729
/latex

Makefile

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ endif
3434

3535
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
3636

37-
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check char_check role_check fasthtml
37+
.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check char_check role_check fasthtml publish
3838

3939
# ------------------------------------------
4040

@@ -46,7 +46,7 @@ help:
4646
@echo " epub create ePUB format manual for e-book readers"
4747
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
4848
@echo " (requires ebook-convert tool from calibre)"
49-
@echo " fasthtml approximate HTML page creation in fasthtml dir (for development)"
49+
@echo " publish create HTML pages and publish on GitHub"
5050
@echo " clean remove all intermediate files"
5151
@echo " clean-all reset the entire build environment"
5252
@echo " anchor_check scan for duplicate anchor labels"
@@ -144,20 +144,6 @@ anchor_check : $(ANCHORCHECK)
144144
deactivate ;\
145145
)
146146

147-
style_check : $(VENV)
148-
@(\
149-
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
150-
python utils/check-styles.py -s ../src -d src ;\
151-
deactivate ;\
152-
)
153-
154-
package_check : $(VENV)
155-
@(\
156-
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
157-
python utils/check-packages.py -s ../src -d src ;\
158-
deactivate ;\
159-
)
160-
161147
char_check :
162148
@( env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst && exit 1 || : )
163149

@@ -171,6 +157,13 @@ link_check : $(VENV) html
171157
deactivate ;\
172158
)
173159

160+
publish : $(VENV) html
161+
@(\
162+
cp $(BUILDDIR)/utils/publish.sh $(BUILDDIR) ; \
163+
$(SHELL) $(BUILDDIR)/publish.sh ; \
164+
rm $(BUILDDIR)/publish.sh; \
165+
)
166+
174167
# ------------------------------------------
175168

176169
$(VENV):

utils/publish.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
test -x html || exit 1
4+
git branch --show-current > .current-branch
5+
git checkout github-docs
6+
git add html
7+
git commit -m 'update website'
8+
git push
9+
git checkout `cat .current-branch`
10+
rm -f .current-branch

0 commit comments

Comments
 (0)