Skip to content

Commit

Permalink
Merge pull request #41 from QuantEcon/add-preview
Browse files Browse the repository at this point in the history
ENH: Added preview option in makefile template
  • Loading branch information
mmcky committed Aug 2, 2019
2 parents 67cb4af + 65b0771 commit e96b1c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jupinx/templates/quickstart/Makefile_t
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ BUILDDIR = {{ rbuilddir }}
BUILDWEBSITE = {{ rbuilddir }}/website
BUILDCOVERAGE = {{ rbuilddir }}/coverage
BUILDPDF = {{ rbuilddir }}/pdf
PORT = 8888

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

preview:
ifneq (,$(filter $(target),website Website))
cd $(BUILDWEBSITE)/jupyter_html && python -m http.server $(PORT)
else
ifdef lecture
cd $(BUILDDIR)/jupyter/ && jupyter notebook --port $(PORT) --port-retries=0 $(basename $(lecture)).ipynb
else
cd $(BUILDDIR)/jupyter/ && jupyter notebook --port $(PORT) --port-retries=0
endif
endif

coverage:
ifneq ($(strip $(parallel)),)
Expand Down

0 comments on commit e96b1c6

Please sign in to comment.