From a764fa25d5e6eb59b64328bb90d47176ba002ac9 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 21:52:33 +0800 Subject: [PATCH] * Removed local functions from the Makefile. It is not suitable for source distribution. * Moved the working directory of the dist target to the _build directory. * Added links to the EPUB in the document. --- Makefile | 21 +++++---------------- conf.py | 1 + index.rst | 11 +++++++---- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index af8102b..c4f129d 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # My local extension -REMOTEHOST = uru -REMOTEDIR = /srv/www/limesurvey-learning PROJNAME = learning-limesurvey PROJVER = 2.0 @@ -49,6 +47,7 @@ help: @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" + @echo " dist to create a document source distribution" .PHONY: clean clean: @@ -233,17 +232,7 @@ dummy: @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)" + rm -rf $(BUILDDIR)/dist + mkdir $(BUILDDIR)/dist $(BUILDDIR)/dist/$(PROJNAME)-$(PROJVER) + cp -fpR *.rst images Makefile make.bat conf.py $(PROJNAME).tex.patch participants-example.csv $(BUILDDIR)/dist/$(PROJNAME)-$(PROJVER)/ + cd $(BUILDDIR)/dist && zip -r $(PROJNAME)-$(PROJVER).zip $(PROJNAME)-$(PROJVER) && cd ../.. diff --git a/conf.py b/conf.py index c0ab4f3..3703b0c 100644 --- a/conf.py +++ b/conf.py @@ -354,6 +354,7 @@ epub_copyright = copyright # The basename for the epub file. It defaults to the project name. # epub_basename = project +epub_basename = 'learning-limesurvey' # The HTML theme for the epub output. Since the default themes are not # optimized for small screen space, using the same theme for HTML and epub diff --git a/index.rst b/index.rst index 7451621..7b40f76 100644 --- a/index.rst +++ b/index.rst @@ -18,12 +18,15 @@ 接跳到您有興趣的章節,不需要依序閱讀。 本學習手冊有 -`線上版學習手冊 `_ 及可下載雙面印刷的 -`PDF版學習手冊 `_ -兩種版本,並有 +`線上版學習手冊 `_ +,也提供雙面印刷的 +`PDF版學習手冊 `_ +,及適合手機平板閱讀的 +`EPUB學習手冊電子書 `_ +可供下載,並有 `填答者名單CSV檔範例 `_ 可下載參考,亦歡迎下載參閱 -`學習手冊的reStructuredText原始檔 `_ +`學習手冊的Sphinx/reStructuredText原始檔 `_ 。台師大問卷調查平台上,有 `本學習手冊上的範例問卷 `_ ,歡迎參閱。