Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
70e98da
separate execution builder
AakashGfude Nov 27, 2019
abdfe88
tidy up of class and variable names
mmcky Nov 27, 2019
1adfab7
setup new translators and naming convetions
mmcky Nov 27, 2019
ebabd86
work in progress
mmcky Nov 28, 2019
719e493
fix merge conflicts from cherry-picking
mmcky Nov 28, 2019
1d28a41
adjustments to get tests working again
mmcky Nov 28, 2019
85eb497
EOD - working on a notebook object type
mmcky Nov 28, 2019
f77fd3e
add a simple Jupyter Notebook object
mmcky Nov 29, 2019
df2116e
EOD
mmcky Dec 2, 2019
ca0f8c9
created separate builders and combined outputs of jupyter code and ju…
AakashGfude Dec 2, 2019
39789d6
add new builder for testing
mmcky Dec 3, 2019
e464a75
added a utils file for builder
AakashGfude Dec 3, 2019
38bad0d
a simple jupyter builder
AakashGfude Dec 3, 2019
5ff47a3
switch to new codeblock translator
mmcky Dec 3, 2019
4f130b3
rewrite basic code block translator using a sparsewriter
mmcky Dec 3, 2019
982de01
improve api
mmcky Dec 3, 2019
148c154
rework EOD
mmcky Dec 3, 2019
387eb42
changes to jupyter code
AakashGfude Dec 3, 2019
6d7870a
added munch to convert dict to object
AakashGfude Dec 4, 2019
473f5d2
update code translator, and test JupyterCell idea
mmcky Dec 4, 2019
d0325f3
jupyter builder
AakashGfude Dec 4, 2019
01151da
remove work on JupyterCell but keep class
mmcky Dec 4, 2019
d844ae8
EOD
mmcky Dec 4, 2019
5bf9606
added pdf and html builders
AakashGfude Dec 5, 2019
cfb4dfe
creating website target
AakashGfude Dec 9, 2019
5c2a021
Merge branch 'master' into redesign
AakashGfude Dec 9, 2019
7dad99a
checking website
AakashGfude Dec 9, 2019
a7616a0
html writer with link issue resolved
AakashGfude Dec 9, 2019
c872f6d
added codetree check in every builder
AakashGfude Dec 10, 2019
bb8d296
EOD
mmcky Dec 11, 2019
2cf2593
remove and migrate by hand
mmcky Dec 14, 2019
b6eb604
added coverage report generation
AakashGfude Dec 14, 2019
9403acf
move configuration and state downstream to base translator
mmcky Dec 17, 2019
89a6c51
clean up markdown utils
mmcky Dec 17, 2019
05ee496
creating base translators
AakashGfude Dec 17, 2019
ff4c99f
Merge branch 'redesign-translators' of https://github.com/QuantEcon/s…
AakashGfude Dec 18, 2019
1b84745
made a new test folder, to test minimal functionality
AakashGfude Dec 20, 2019
96000b3
testing ipynb translator
AakashGfude Dec 20, 2019
bdc7aae
added dicts
AakashGfude Jan 7, 2020
e8138ca
translator changes
AakashGfude Jan 8, 2020
2003e2a
trying to add title
AakashGfude Jan 8, 2020
0d26618
text is now rendering, set default cell type as markdown when adding …
AakashGfude Jan 9, 2020
08cf0d4
literal_block code correction and some extra visit/depart statements
AakashGfude Jan 9, 2020
1118a76
few code block functionalities
AakashGfude Jan 11, 2020
7d53fe0
code block test cases handled
AakashGfude Jan 12, 2020
ae9fdc7
added a list dict
AakashGfude Jan 13, 2020
41a0d93
till references done
AakashGfude Jan 14, 2020
28675af
completed moving all the cell appending to respective ipynb translator
AakashGfude Jan 14, 2020
614f909
added some missing visit/depart blocks
AakashGfude Jan 14, 2020
5668474
changed add_markdown_cell to cell_to_notebook
AakashGfude Jan 15, 2020
f649bc5
unknown visit/depart in base and some refactoring
AakashGfude Jan 15, 2020
93f6b6d
Merge pull request #309 from QuantEcon/redesign-translators-Aakash
AakashGfude Jan 15, 2020
3165a7e
removing reference to non-existing JupyterTranslator
AakashGfude Jan 15, 2020
0dbab82
remove _dict nomenclature except for list_dict moving to use List hel…
mmcky Jan 15, 2020
b001b65
minor cleanups
mmcky Jan 17, 2020
63c8590
rename base translator to code translator
mmcky Jan 17, 2020
367f15e
update docs
mmcky Jan 17, 2020
046e7ab
lists object
AakashGfude Jan 20, 2020
c1585f0
Merge branch 'redesign-translators' of https://github.com/QuantEcon/s…
AakashGfude Jan 20, 2020
f79089a
handling of math and math blocks in list
AakashGfude Jan 20, 2020
9b21ee6
handling of references inside list
AakashGfude Jan 20, 2020
9e9551f
list rendering code blocks
AakashGfude Jan 22, 2020
6331083
created a saved state dictionary
AakashGfude Jan 22, 2020
59c40e5
some desc added to list functions
AakashGfude Jan 22, 2020
1e32d3e
making ipynb translator self contained
AakashGfude Jan 23, 2020
21f24d1
removed some unnecessary dictionary varibles after merging of transla…
AakashGfude Jan 23, 2020
a56674e
adjustments for conventions
mmcky Jan 24, 2020
ba2fc0c
remove use of translate in favour of translate_ipynb
mmcky Jan 24, 2020
cf20c17
remove base class in favour of translate_ipynb
mmcky Jan 24, 2020
cb01301
organise configuration variables
mmcky Jan 24, 2020
c4f2f67
initial sort of methods into alphabetical -- last few need finishing
mmcky Jan 24, 2020
8418128
finish alphabetical reorg
mmcky Jan 25, 2020
ae1ebf9
cleanup edits and review of required functions
mmcky Jan 25, 2020
0683ce6
rework cell to notebook
mmcky Jan 25, 2020
517ae7f
add parsing of jupyter-dependency
mmcky Jan 25, 2020
940d26e
reorder html translator to be aligend with translate_ipynb
mmcky Jan 25, 2020
fbdf3b9
minor doc adjust
mmcky Jan 25, 2020
c0c9477
initial table builder
AakashGfude Jan 25, 2020
7eb674a
Merge branch 'redesign-translators' of https://github.com/QuantEcon/s…
AakashGfude Jan 25, 2020
9d188a2
migrate to use MarkdownSyntax class
mmcky Jan 25, 2020
bf67705
add html syntax class
mmcky Jan 25, 2020
37c1da6
implemented a simple table builder class
AakashGfude Jan 25, 2020
0d03d69
Merge branch 'redesign-translators' of https://github.com/QuantEcon/s…
AakashGfude Jan 25, 2020
824d913
added a newline after table depart
AakashGfude Jan 25, 2020
72ca8be
reiterated table builder and added a test case
AakashGfude Jan 28, 2020
ffa3943
update Table object attribute name
mmcky Jan 28, 2020
205aab9
minor edits
mmcky Jan 28, 2020
d64585c
update to migrate syntax calls to MarkdownSyntax class
mmcky Jan 28, 2020
59103a8
translate html first draft
AakashGfude Jan 28, 2020
691dc0e
inherit from markdown syntax as default syntax for ipynb(html)
mmcky Jan 28, 2020
9993c6a
move accumulator objects to new module
mmcky Jan 28, 2020
e32d8ce
updates to documentation
mmcky Jan 29, 2020
948a9ef
updates to docs
mmcky Jan 29, 2020
bde0f6f
added pdf translator
AakashGfude Jan 29, 2020
abb9508
Merge branch 'redesign-translators' of https://github.com/QuantEcon/s…
AakashGfude Jan 29, 2020
0b3c45f
Merge branch 'redesign-translators' into redesign
AakashGfude Jan 29, 2020
470a7b5
adjusted builders and translators to make execute and jupyter work
AakashGfude Jan 30, 2020
727f630
changes to translators for execute and jupyter
AakashGfude Feb 2, 2020
4296b8c
removed base-A
AakashGfude Feb 2, 2020
f489b4f
book index file working
AakashGfude Feb 3, 2020
c33978c
added topic skip level
AakashGfude Feb 3, 2020
7aec9fd
finish migrating docs to new structure
mmcky Feb 4, 2020
59fe0db
remove projects as no longer required
mmcky Feb 4, 2020
a939a4e
add builders update
mmcky Feb 4, 2020
cb668e9
remove project from index
mmcky Feb 4, 2020
fb76fe3
clean up testing infrastructure
mmcky Feb 4, 2020
2dc6c9e
move code to execute test folder
mmcky Feb 4, 2020
4e2253f
update makefile
mmcky Feb 4, 2020
9761f8e
rework tests
mmcky Feb 4, 2020
d214c61
add ignore
mmcky Feb 4, 2020
41e98b9
tidy up of Code/Execute Builder
mmcky Feb 4, 2020
781be99
minor tidy up
mmcky Feb 4, 2020
c8a2bcc
tidy up of HTML Builder
mmcky Feb 4, 2020
0dd6658
tidy up of pdf builder
mmcky Feb 4, 2020
a79b56a
tidy up of utilities for builders
mmcky Feb 4, 2020
b8ee0bc
update builder names
mmcky Feb 4, 2020
d180181
fix change in executenb object
mmcky Feb 4, 2020
d6e3a2d
fix for removal of create_hashcode
mmcky Feb 4, 2020
5228979
html target functionality - first draft
AakashGfude Feb 4, 2020
cde0b51
added cell information in metadata of codetree
AakashGfude Feb 4, 2020
3d7a8e6
inline literal fix for lists
AakashGfude Feb 4, 2020
6e184b4
Merge branch 'redesign' of https://github.com/QuantEcon/sphinxcontrib…
AakashGfude Feb 4, 2020
66950cd
including text formatting in lists object
AakashGfude Feb 4, 2020
63e6bf8
enable option for html images in notebooks to support scale attribute…
mmcky Feb 4, 2020
343aa44
add option to place RST sections into new markdown blocks
mmcky Feb 4, 2020
f41fe41
some warnings about make site cleared
AakashGfude Feb 4, 2020
24e2c4b
Merge branch 'redesign' of https://github.com/QuantEcon/sphinxcontrib…
AakashGfude Feb 4, 2020
7dea2a0
added download related info to builder
AakashGfude Feb 5, 2020
29b421e
download notebooks for html
AakashGfude Feb 5, 2020
7417507
correction for downloaded notebooks
AakashGfude Feb 5, 2020
2be23cd
revisiting init functions
AakashGfude Feb 5, 2020
d4b712e
copying _downloads to jupyter_html
AakashGfude Feb 5, 2020
5028efc
cache in html builder
AakashGfude Feb 5, 2020
fa84967
added caching for pdf files
AakashGfude Feb 5, 2020
0baadcd
init function and removed skip tests and solutions
AakashGfude Feb 6, 2020
c4a7187
removed kernels and conversion mode
AakashGfude Feb 6, 2020
44394b5
removed write metadata and header block
AakashGfude Feb 6, 2020
98ad1a6
removed jupyter options
AakashGfude Feb 6, 2020
c62ba3a
removed default language and language synonyms
AakashGfude Feb 6, 2020
712f9fe
removed options for generating html and site
AakashGfude Feb 6, 2020
708a0e9
execute notebooks and coverage
AakashGfude Feb 6, 2020
faf9982
execute notebooks and coverage
AakashGfude Feb 6, 2020
9d14bfd
Merge branch 'redesign' of https://github.com/QuantEcon/sphinxcontrib…
AakashGfude Feb 6, 2020
7e7e288
removed jupyter target pdf
AakashGfude Feb 6, 2020
4dbfd2a
theme config variables removed and only theme folder kept in config
AakashGfude Feb 7, 2020
c69b028
removed download nb execute
AakashGfude Feb 7, 2020
7ac43f4
removed jupyter_download_nb variable
AakashGfude Feb 7, 2020
02a7bbc
renamed template variables
AakashGfude Feb 7, 2020
08d3679
removed some deleted variables from the various test configs
AakashGfude Feb 7, 2020
b5d9b2e
added caching for pdf output files
AakashGfude Feb 10, 2020
681cc7d
Merge branch 'master' into redesign
AakashGfude Feb 18, 2020
7b257bd
renamed drop_solutions to solution_notebook
AakashGfude Feb 19, 2020
ae8cb02
cleanup options
mmcky Feb 19, 2020
67285cf
update option to jupyter_html_theme
mmcky Feb 19, 2020
e00ac40
sphinx outdated files function not needed for execute
AakashGfude Feb 19, 2020
6c1a39f
add pandoc to travis
mmcky Feb 19, 2020
8b688dc
remove python27, update SPHINX_VERSION and remove testing on 1.7.9
mmcky Feb 19, 2020
bbf5088
tidy up removal of python27
mmcky Feb 19, 2020
84e4b01
remove python27 from code
mmcky Feb 19, 2020
491a107
add munch dependency
mmcky Feb 19, 2020
5904145
update description
mmcky Feb 19, 2020
2c8d1b9
remove python27 from PyPI
mmcky Feb 19, 2020
07c8e5e
removed unnecessary logger
AakashGfude Feb 19, 2020
cecc475
Merge branch 'redesign' of https://github.com/QuantEcon/sphinxcontrib…
AakashGfude Feb 19, 2020
9bf7968
added support for jupyter_execute and changed name of jupyter_html to…
AakashGfude Feb 19, 2020
c3e1873
jupyter_execute optin
AakashGfude Feb 19, 2020
19a2574
swich off execution for base tests
mmcky Feb 19, 2020
12a1405
add newline formatting for code blocks
mmcky Feb 19, 2020
88dff3b
Merge branch 'master' into redesign
mmcky Feb 21, 2020
6885188
Merge branch 'master' into redesign
mmcky Feb 21, 2020
53fa5d5
fix white space issues
mmcky Mar 6, 2020
ada3ace
tidy up base tests
mmcky Mar 6, 2020
69204dd
add time metadata
mmcky Mar 6, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tests/pdf/_build/
tests/pdf/_static/
tests/pdf/theme/
tests/no_inline_exercises/_build
tests/execute/_build/
tests/ipynb/*checkpoints
*.pyc
.DS_Store
Expand Down
20 changes: 6 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
sudo: false #Use new Container Infrastructure
language: python
python:
- 2.7
- 3.7

env:
- SPHINX_VERSION=1.7.9
- SPHINX_VERSION=1.8.5
- SPHINX_VERSION=2.1.2

matrix:
exclude:
- python: 2.7
env: SPHINX_VERSION=2.1.2
- SPHINX_VERSION=2.4.1

directories:
- "/tmp/texlive"
Expand All @@ -33,15 +27,13 @@ before_install:
- travis_wait 45 bash ./util/setup_latex.sh
- export PATH="/tmp/texlive/bin/x86_64-linux:$PATH"

addons:
apt_packages:
- pandoc

install:
- if [ $TRAVIS_PYTHON_VERSION == 2.7 ]; then
pip install sphinx==$SPHINX_VERSION nbconvert nbformat dask distributed nbdime;
pip install sphinxcontrib-bibtex==0.4.2;
else
pip install sphinx==$SPHINX_VERSION nbconvert nbformat dask==2.5.2 distributed==2.5.2 nbdime;
pip install sphinxcontrib-bibtex;
fi
- pip install sphinx==$SPHINX_VERSION nbconvert nbformat dask==2.5.2 distributed==2.5.2 nbdime;
- pip install sphinxcontrib-bibtex;
- python setup.py install

script:
Expand Down
38 changes: 20 additions & 18 deletions docs/builders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,38 @@
Builders
=========

This extension has the following Builders
.. contents:: Options
:depth: 1
:local:

jupyter
execute
-------

This builder currently handles `jupyter`, `html`, and `coverage` output

.. code-block:: bash

@$(SPHINXBUILD) -M jupyter "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O)
This builder extracts code-blocks from the `RST` files and manages the
execution of each block. It saves the results in a `json` type codetree
object for use by other builders that construct notebooks.

jupyter
-------

.. warning::
This builder build IPYNB notebooks.

If your project needs to build `jupyter` and `html` then configuration for `html`
and `coverage` is currently handled through Makefile overrides.
The project is working on separate builders for html and coverage
if `jupyter_execute_notebooks=True` is set in the `conf.py` file then
the `execute` builder is automatically called to run all code.

Example Configuration for `HTML` production

.. code-block:: bash
jupyterhtml
-----------

@$(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/lectures.quantecon.org/py/_static/" -D jupyter_images_markdown=0 -D jupyter_html_template="python-html.tpl" -D jupyter_download_nb_urlpath="https://lectures.quantecon.org/" -D jupyter_coverage_dir=$(BUILDCOVERAGE)
This builder manages the construction of project websites

if `jupyter_execute_notebooks=True` is set in the `conf.py` file then
the `execute` builder is automatically called to run all code.

jupyterpdf
----------

This builder handles production of `pdf`

.. code-block:: bash
This builder handles construction of `pdf` versions of the RST documents.

@$(SPHINXBUILD) -M jupyterpdf "$(SOURCEDIR)" "$(BUILDCOVERAGE)" $(FILES) $(SPHINXOPTS) $(O)
if `jupyter_execute_notebooks=True` is set in the `conf.py` file then
the `execute` builder is automatically called to run all code.
File renamed without changes.
182 changes: 182 additions & 0 deletions docs/config-execution.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
.. _config_execution:

Execution Configuration
=======================

.. contents:: Options
:depth: 1
:local:

Code execution is handled by a specialised `execute` builder.

jupyter_file_dependencies
--------------------------

Specify support (dependencies) for notebook collection at the `file` or
the `directory` level.

``conf.py`` usage:

.. code-block:: python

jupyter_dependencies = {
<dir> : ['file1', 'file2'],
{<dir>}/<file.rst> : ['file1']
}

.. note::

to specify a support file at the root level of the source directory
the key should be `""`

jupyter_notebook_dependencies
-----------------------------

Dependency of notebooks on other notebooks for execution can
be added to the configuration file above in the form of a dictionary.
The key/value pairs will contain the names of the notebook files.

``conf.py`` usage:

.. code-block:: python

# add your dependency lists here
jupyter_notebook_dependencies = {
'python_advanced_features' : ['python_essentials','python_oop'],
'discrete_dp' : ['dp_essentials'],
}

jupyter_number_workers
-------------------------

Specify the number cores to use with dask

.. list-table::
:header-rows: 1

* - Values
* - Integer (**default** = 1)

``conf.py`` usage:

jupyter_number_workers = 4


jupyter_execution_threads_per_worker
------------------------------------

Specify the number of threads per worker for dask

.. list-table::
:header-rows: 1

* - Values
* - Integer (**default** = 1)

``conf.py`` usage:

jupyter_threads_per_worker = 1

jupyter_coverage_report_template
-----------------------------------

Provide path to template coverage report file

.. todo::

Document format for template

``conf.py`` usage:

.. code-block:: python

jupyter_template_coverage_file_path = "theme/templates/<file>.json"

.. warning::

``coverage`` will currently produce a ``json`` report
that can be used to support an execution status page. But adding
badges and a status page needs to be made into an option and
specified via the default theme.
See `#237 <https://github.com/QuantEcon/sphinxcontrib-jupyter/issues/237>`__


jupyter_options
---------------

An dict-type object that is used by dask to control execution


.. TODO::

@aakash is this used?

jupyter_drop_tests
------------------

**Note:** Future Feature?

Drop ``code-blocks` that include ``:class: test``

.. list-table::
:header-rows: 1

* - Values
* - False (**default**)
* - True

.. TODO::

This option should be added to `execute` builder so tests can
be switched on/off for execution testing

jupyter_ignore_no_execute:
--------------------------

**Note:** Deprecate?

.. list-table::
:header-rows: 1

* - Values
* - False (**default**)
* - True

When constructing notebooks this option can be enabled to ignore `:class: no-execute`
for `code-blocks`. This is useful for `html` writer for pages that are meant to fail
but shouldn't be included in `coverage` tests.

``conf.py`` usage:

.. code-block:: python

jupyter_ignore_no_execute = True

.. todo::

@aakash this is no longer required as all code-blocks are run correct?

jupyter_ignore_skip_test
------------------------

**Note:** Deprecate?

When constructing notebooks this option can be enabled to ignore `:class: skip-test`
for `code-blocks`.

.. list-table::
:header-rows: 1

* - Values
* - False (**default**)
* - True

``conf.py`` usage:

.. code-block:: python

jupyter_ignore_skip_test = True

.. todo::

@aakash is this required?
40 changes: 0 additions & 40 deletions docs/config-extension-coverage.rst

This file was deleted.

Loading