From acab1f58da9e1da8bb040b15d756b5cd53d90532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 21 Nov 2017 16:46:35 +0800 Subject: [PATCH] * Added the dist and allsync target for local synchronization and source zip archive. * Added the link to the document sources. --- Makefile | 26 ++++++++++++++++++++++++-- index.rst | 10 ++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b42d1d5..af8102b 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,12 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# My local extension +REMOTEHOST = uru +REMOTEDIR = /srv/www/limesurvey-learning +PROJNAME = learning-limesurvey +PROJVER = 2.0 + .PHONY: help help: @echo "Please use \`make ' where is one of" @@ -129,7 +135,7 @@ epub3: .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - patch -p 1 < learning-limesurvey.tex.patch + patch -p 1 < $(PROJNAME).tex.patch @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ @@ -138,7 +144,7 @@ latex: .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - patch -p 1 < learning-limesurvey.tex.patch + patch -p 1 < $(PROJNAME).tex.patch @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." @@ -225,3 +231,19 @@ dummy: $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy @echo @echo "Build finished. Dummy builder generates no files." + +dist: + rm -rf $(PROJNAME)-$(PROJVER) _build/$(PROJNAME)-$(PROJVER).zip + mkdir $(PROJNAME)-$(PROJVER) $(PROJNAME)-$(PROJVER)/_build + cp -fpR *.rst images Makefile make.bat conf.py $(PROJNAME).tex.patch participants-example.csv $(PROJNAME)-$(PROJVER)/ + zip -r _build/$(PROJNAME)-$(PROJVER).zip $(PROJNAME)-$(PROJVER) + rm -rf $(PROJNAME)-$(PROJVER) + +allsync: clean html latexpdf dist + utimedir . _build/html/_sources + utimedir images _build/html/_images + utimedir images _build/latex + ssh $(REMOTEHOST) "rm -rf /tmp/$(PROJNAME)" + scp -p -r _build/html $(REMOTEHOST):/tmp/$(PROJNAME)/ + scp -p participants-example.csv _build/latex/$(PROJNAME).pdf _build/$(PROJNAME)-$(PROJVER).zip $(REMOTEHOST):/tmp/$(PROJNAME)/ + ssh $(REMOTEHOST) "rm -rf $(REMOTEDIR)/* && mv /tmp/$(PROJNAME)/* $(REMOTEDIR) && rm -f /tmp/$(PROJNAME)/.buildinfo && rmdir /tmp/$(PROJNAME)" diff --git a/index.rst b/index.rst index 2c75cd5..7451621 100644 --- a/index.rst +++ b/index.rst @@ -6,7 +6,7 @@ 台師大問卷調查平台LimeSurvey學習手冊 ==================================== -版權所有 |copy| 2007 楊士青。 +版權所有 |copy| 2017 楊士青。 「台師大問卷調查平台LimeSurvey學習手冊」由 `楊士青 `_ 撰寫,採用 @@ -18,11 +18,13 @@ 接跳到您有興趣的章節,不需要依序閱讀。 本學習手冊有 -`線上版學習手冊 `_ 及可下載印刷的 +`線上版學習手冊 `_ 及可下載雙面印刷的 `PDF版學習手冊 `_ -兩種版本。並有 +兩種版本,並有 `填答者名單CSV檔範例 `_ -可下載參考。台師大問卷調查平台上,有 +可下載參考,亦歡迎下載參閱 +`學習手冊的reStructuredText原始檔 `_ +。台師大問卷調查平台上,有 `本學習手冊上的範例問卷 `_ ,歡迎參閱。