Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

ENH: Basic generic theme - css, js, tpl #697

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ BUILDWEBSITE = _build/website
BUILDCOVERAGE = _build/coverage
BUILDPDF = _build/pdf
PORT = 8890
FILES =
FILES =
THEMEPATH = theme/minimal
TEMPLATEPATH = theme/minimal/templates
HTMLTEMPLATE = html.tpl
LATEXTEMPLATE = latex.tpl
COVERAGETEMPLATE = error_report_template.html

# Put it first so that "make" without argument is like "make help".
help:
Expand Down Expand Up @@ -47,27 +52,28 @@ clean-pdf:

coverage:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_ignore_skip_test=0 -D jupyter_template_coverage_file_path="error_report_template.html" -D jupyter_number_workers=$(parallel)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_ignore_skip_test=0 -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_template_coverage_file_path="$(COVERAGETEMPLATE)" -D jupyter_number_workers=$(parallel)
else
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_ignore_skip_test=0 -D jupyter_template_coverage_file_path="error_report_template.html"
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_coverage=1 -D jupyter_execute_notebooks=1 -D jupyter_ignore_skip_test=0 -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_template_coverage_file_path="$(COVERAGETEMPLATE)"
endif

website:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/python.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_html_template="python-html.tpl" -D jupyter_download_nb_urlpath="https://python.quantecon.org/" -D jupyter_coverage_dir=$(BUILDCOVERAGE) -D jupyter_number_workers=$(parallel)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/python.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_theme_path="$(THEMEPATH)" -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_html_template="$(HTMLTEMPLATE)" -D jupyter_download_nb_urlpath="https://python.quantecon.org/" -D jupyter_coverage_dir="$(BUILDCOVERAGE)" -D jupyter_number_workers="$(parallel)"

else
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/python.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_html_template="python-html.tpl" -D jupyter_download_nb_urlpath="https://python.quantecon.org/" -D jupyter_coverage_dir=$(BUILDCOVERAGE)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDWEBSITE)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_make_site=1 -D jupyter_generate_html=1 -D jupyter_download_nb=1 -D jupyter_execute_notebooks=1 -D jupyter_target_html=1 -D jupyter_download_nb_image_urlpath="https://s3-ap-southeast-2.amazonaws.com/python.quantecon.org/_static/" -D jupyter_images_markdown=0 -D jupyter_theme_path="$(THEMEPATH)" -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_html_template="$(HTMLTEMPLATE)" -D jupyter_download_nb_urlpath="https://python.quantecon.org/" -D jupyter_coverage_dir="$(BUILDCOVERAGE)"
endif

pdf:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_latex_template="latex.tpl" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_target_pdf=1 -D jupyter_number_workers=$(parallel)
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_theme_path="$(THEMEPATH)" -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_latex_template="$(LATEXTEMPLATE)" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_target_pdf=1 -D jupyter_number_workers=$(parallel)

else
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_latex_template="latex.tpl" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_target_pdf=1
@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_theme_path="$(THEMEPATH)" -D jupyter_template_path="$(TEMPLATEPATH)" -D jupyter_latex_template="$(LATEXTEMPLATE)" -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_target_pdf=1
endif

#This is a temporary option for working with ipynb_pdf_constructor tool
constructor-pdf:
ifneq ($(strip $(parallel)),)
@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDPDF)" $(FILES) $(SPHINXOPTS) $(O) -D jupyter_images_markdown=1 -D jupyter_execute_notebooks=1 -D jupyter_number_workers=$(parallel)
Expand Down
Binary file removed source/_static/qe-logo-large.png
Binary file not shown.
6 changes: 3 additions & 3 deletions source/rst/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Quantitative Economics with Python
</div>
<div class="web-version">
<a href="/index_toc.html">
<span class="thumb"><img src="/_static/img/py-logo.png"></span>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrDrij one thought I have had with moving these to the _static folder is that they are not assets that are tracked by sphinx. For example they are not in .. figure or .. image directives. This means they will never be parsed by sphinx and perhaps should remain in the theme folder and copied to static as part of the theme support (as is currently done?). What do you think?

This PR: QuantEcon/sphinxcontrib-jupyter#268 would actually break this setup currently as the static assets contained in the html snippets would never be parsed by sphinx.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrDrij what do you think about this?

<span class="thumb"><img src="/_static/py-logo.png"></span>
<h2>Web Version</h2>
<p>The recommended way to read the lectures</p>
</a>
</div>
</div>
<ul class="sponsor">
<li><a href="http://www.sloan.org/" title="Alfred P. Sloan Foundation"><img src="/_static/sloan_logo.png" alt="Sponsored by the Alfred P. Sloan Foundation"></a></li>
<li><a href="https://quantecon.org/"><img src="/_static/img/qe-logo.png" width="150"></a></li>
<li><a href="http://www.sloan.org/" title="Alfred P. Sloan Foundation"><img src="/_static/sloan-logo.png" alt="Sponsored by the Alfred P. Sloan Foundation"></a></li>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrDrij I think this should be sloan_logo.png with an _ rather than a -

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

<li><a href="https://quantecon.org/"><img src="/_static/qe-logo.png" width="150"></a></li>
</ul>
</div>
<div class="home-alternatives">
Expand Down
2 changes: 1 addition & 1 deletion source/rst/index_postgrad.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.. raw:: html

<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/img/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>
<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>

.. only:: html

Expand Down
2 changes: 1 addition & 1 deletion source/rst/index_toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.. raw:: html

<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/img/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>
<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>

.. only:: html

Expand Down
2 changes: 1 addition & 1 deletion source/rst/index_undergrad.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.. raw:: html

<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/img/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>
<p id="numfocus_badge" style="float:right;margin:0 0 0 2rem;"><a href="https://www.numfocus.org/"><img src="/_static/powered-by-NumFOCUS-orange.svg" alt="Powered by NumFOCUS logo"></a></p>

.. only:: html

Expand Down
Loading