Skip to content

Commit

Permalink
version 0.9 release (#67)
Browse files Browse the repository at this point in the history
- Added ``ipubpandoc`` (see :ref:`markdown_cells`)
- Refactored conversion process to
  :py:class:`ipypublish.convert.main.IpyPubMain` configurable class
- Added postprocessors (see :ref:`post-processors`)
- Added Sphinx extension (see :ref:`sphinx_extension`)
- Added Binder examples to documentation (see :ref:`code_cells`)
  • Loading branch information
chrisjsewell committed Feb 21, 2019
1 parent 3bec577 commit 3410e2e
Show file tree
Hide file tree
Showing 204 changed files with 17,730 additions and 3,307 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
@@ -0,0 +1,6 @@
[run]
omit =
ipypublish/ipysphinx/docutils_transforms.py
ipypublish/ipysphinx/extension.py
ipypublish/ipysphinx/directives.py
ipypublish/scripts/nb_setup.py
17 changes: 17 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,17 @@
version: 2

conda:
environment: docs/environment.yaml

python:
version: 3.6
install:
- method: pip
path: .

# default
# sphinx:
# builder: html
# configuration: conf.py
# fail_on_warning: true

15 changes: 10 additions & 5 deletions .travis.yml
Expand Up @@ -66,8 +66,15 @@ matrix:
# TODO add read the docs test `pip install .[docs] cd docs; make`

before_install:
# Pandoc
- url="https://github.com/jgm/pandoc/releases/tag/2.6"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then path=$(curl -L $url | grep -o '/jgm/pandoc/releases/download/.*-amd64\.deb') ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then downloadUrl="https://github.com$path" ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then file=${path##*/} ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget $downloadUrl && sudo dpkg -i $file ; fi
# LaTeX
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y pandoc ; fi
# - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y pandoc ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y texlive ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y texlive-xetex ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y texlive-latex-extra ; fi
Expand All @@ -78,13 +85,11 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y latexmk ; fi
- pip install -U pip setuptools wheel
install:
- travis_wait pip install -r requirements.txt
- pip install -r test_requirements.txt
- pip install .
- travis_wait pip install .[tests,sphinx]
- pip install --quiet coveralls
script:
# - nosetests -v --nocapture --with-doctest --with-coverage --exe --cover-package=ipypublish
- pytest -v --cov=ipypublish --cov-report= ipypublish
- pytest -v --cov=ipypublish --cov-config .coveragerc --cov-report= ipypublish
- nbpublish -pdf --pdf-debug -log debug example/notebooks/Example.ipynb
after_success:
- coveralls
Expand Down
76 changes: 76 additions & 0 deletions .vscode/jinja2.code-snippets
@@ -0,0 +1,76 @@
{
"super": {
"prefix": "super",
"scope": "jinja,jinja-yaml,jinja-html",
"body": "{{ super() }}",
"description": "call inherited block"
},
"set": {
"prefix": "set",
"scope": "jinja,jinja-yaml,jinja-html",
"body": "{% set ${1:name} = ${2:value} %}",
"description": "set variable"
},
"print": {
"prefix": "print",
"scope": "jinja,jinja-yaml,jinja-html",
"body": "{{ ${1:variable} }}",
"description": "print variable"
},
"block": {
"prefix": "block",
"scope": "jinja,jinja-yaml,jinja-html",
"body": [
"{% block ${1:name} %}",
"$2",
"{% endblock ${1:name} %}"
],
"description": "jinja block"
},
"macro": {
"prefix": "macro",
"scope": "jinja,jinja-yaml,jinja-html",
"body": [
"{% macro ${1:name} %}",
"$2",
"{% endmacro %}"
],
"description": "macro function"
},
"if": {
"prefix": "if",
"scope": "jinja,jinja-yaml,jinja-html",
"body": [
"{% if ${1:condition} %}",
"$2",
"{% endif %}"
],
"description": "if condition"
},
"if-else": {
"prefix": "if-else",
"scope": "jinja,jinja-yaml,jinja-html",
"body": [
"{% if ${1:condition} %}",
"$2",
"{% else %}",
"$3",
"{% endif %}"
],
"description": "if-else condition"
},
"if-elif-else": {
"prefix": "if-elif-else",
"scope": "jinja,jinja-yaml,jinja-html",
"body": [
"{% if ${1:condition} %}",
"$2",
"{% else %}",
"$3",
"{% elif ${1:condition2} %}",
"",
"{% endif %}"
],
"description": "if-else condition"
}
}
10 changes: 8 additions & 2 deletions .vscode/settings.json
Expand Up @@ -28,6 +28,7 @@
"python.linting.flake8Enabled": true,
"latex-workshop.latex.autoBuild.onSave.enabled": false,
"cSpell.words": [
"Jupyter",
"ipynb",
"ipypublish",
"jupytext",
Expand All @@ -42,7 +43,7 @@
"FIXME",
"NOTE"
],
"todo-tree.regex": "((//|#|<!--|\\.\\.|;|/\\*|^)\\s*($TAGS)|^\\s*- \\[ \\])",
"todo-tree.regex": "((//|#-?|<!--|\\.\\.|;|/\\*|^)\\s*($TAGS)|^\\s*- \\[ \\])",
"todo-tree.defaultHighlight": {
"icon": "alert",
"type": "tag",
Expand All @@ -58,6 +59,11 @@
"background": "white",
"opacity": 10
}
}
},
"yaml.format.enable": true,

"markdown-preview-enhanced.usePandocParser": true,
"markdown-preview-enhanced.pandocPath": "/anaconda/envs/lsr/bin/pandoc",
"markdown-preview-enhanced.pandocArguments": "--filter=/anaconda/envs/lsr/bin/ipubpandoc",
"markdown-preview-enhanced.enableScriptExecution": true
}
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -1,3 +1,5 @@
recursive-include ipypublish *.json
recursive-include ipypublish *.j2
recursive-include ipypublish *.yaml
recursive-include ipypublish/ipysphinx/css *.css
recursive-include ipypublish/tests/test_files *
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ general user interface, but anyone using custom converter plugins will
be required to update them (see [Plugin Conversion](https://ipypublish.readthedocs.io/en/latest/custom_export_config.html#conversion-of-plugins-from-old-api))


![Conversion Process](/docs/source/_static/process.svg)
![Conversion Process](/docs/source/_static/main_image.png)

For an example of the potential input/output, see:
[Example.ipynb](example/notebooks/Example.ipynb),
Expand Down
7 changes: 7 additions & 0 deletions binder/README
@@ -0,0 +1,7 @@
This directory holds configuration files for https://mybinder.org/.

The notebooks that comprise the documentation can be accessed with this link:
https://mybinder.org/v2/gh/chrisjsewell/ipypublish/master?filepath=docs

To check out a different version, just replace "master" with the desired
branch/tag name or commit hash.
10 changes: 10 additions & 0 deletions binder/environment.yml
@@ -0,0 +1,10 @@
name: ipypublish-environment
channels:
- conda-forge
dependencies:
- python==3.6
- numpy
- matplotlib
- pandas
- sympy<1.3
- pillow
5 changes: 5 additions & 0 deletions binder/postBuild
@@ -0,0 +1,5 @@
#!/bin/sh

set -ex

pip install .
4 changes: 2 additions & 2 deletions converted/Example.slides.html
Expand Up @@ -11975,7 +11975,7 @@ <h2 id="1.2.-References-and-Citations">1.2. References and Citations<a
<div class="text_cell_render border-box-sizing rendered_html">

<p>References to <a href="#/2/0fig:example">fig. 1</a>, <a href="#/3/0tbl:example">tbl.
1</a>, <a href="#/4/0eqn:example_sympy">eqn. 1</a> and <a
1</a>, =@eqn:example_sympy and <a
href="#/2/3code:example_mpl">code 6</a>.</p>
<p>Referencing multiple items: <a href="#/2/0fig:example">fig. 1</a>, <a
href="#/2/0fig:example_h">fig. 2</a> and <a href="#/2/0fig:example_v">fig. 3</a>.
Expand Down Expand Up @@ -21538,7 +21538,7 @@ <h1 id="5.-Equations-(with-ipython-or-sympy)">5. Equations (with ipython or symp

</div>

<br><b>Code 11:</b> The plotting code for a sympy equation (<a href="#eqn:example_sympy">eqn. 1</a>).
<br><b>Code 11:</b> The plotting code for a sympy equation (=@eqn:example_sympy).
<div class="input_code">
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
@@ -0,0 +1,4 @@
# source/releases.*
source/api/
source/*_nbfiles/
source/converted/
15 changes: 15 additions & 0 deletions docs/environment.yaml
@@ -0,0 +1,15 @@
channels:
- conda-forge
dependencies:
- python>=3
- sphinx>=1.6
- pandoc
- nbconvert!=5.4
- ipykernel
- sphinxcontrib-bibtex
- jupytext
- numpy
- matplotlib
- pandas
- sympy<1.3
- pytest>=3.6
2 changes: 2 additions & 0 deletions docs/get_intersphinx_inv.py
Expand Up @@ -23,6 +23,8 @@ def warn(self, msg):
# uri = 'http://jinja.pocoo.org/docs/dev/objects.inv'
uri = "http://nbconvert.readthedocs.io/en/latest/objects.inv"
# uri = "http://nbformat.readthedocs.io/en/latest/objects.inv"
# uri = "https://docutils.readthedocs.io/en/sphinx-docs/objects.inv"
#uri = "https://traitlets.readthedocs.io/en/latest/objects.inv"

# Read inventory into a dictionary
inv = fetch_inventory(uri)
Expand Down
3 changes: 3 additions & 0 deletions docs/run_apidoc
@@ -0,0 +1,3 @@
rm -f source/api/*.rst
sphinx-apidoc --force --separate -o . ../../ipypublish/ ../../ipypublish/ipypublish/tests ../../ipypublish/setup.py
rm -f source/api/modules.rst
Binary file added docs/source/_static/code_cells.pdf
Binary file not shown.
42 changes: 42 additions & 0 deletions docs/source/_static/example.bib
@@ -0,0 +1,42 @@

@article{kirkeminde_thermodynamic_2012,
title = {Thermodynamic Control of Iron Pyrite Nanocrystal Synthesis with High Photoactivity and Stability},
volume = {1},
issn = {2050-7496},
doi = {10.1039/C2TA00498D},
abstract = {Non-toxic, earth abundant nanostructured semiconductors have received extensive attention recently. One of the more highly studied materials has been iron pyrite (FeS2) due to its many different promising applications. Herein, we report the thermodynamically-controlled synthesis of FeS2 nanocrystals, dependent on the reaction temperature and chemical precursors, and a Lewis acid/base model to explain the shape-controlled synthesis. The surface facet-controlled photocatalytic activity and photostability were studied and explained. This work further advances the synthesis with pyrite structure control and surface facet-dictated applications, such as photovoltaics, photocatalysts and photoelectrochemical cells.},
timestamp = {2017-07-06T00:26:10Z},
langid = {english},
number = {1},
journaltitle = {Journal of Materials Chemistry A},
journal = {Journal of Materials Chemistry A},
shortjournal = {J. Mater. Chem. A},
author = {Kirkeminde, Alec and Ren, Shenqiang},
urldate = {2017-06-18},
date = {2012-11-29},
year = {2012},
pages = {49--54},
file = {Kirkeminde_Ren_2012_Thermodynamic control of iron pyrite nanocrystal synthesis with high.pdf:/Users/cjs14/Docear/projects/Corrosion/Zotero_Attachments//2012/Kirkeminde_Ren_2012_Thermodynamic control of iron pyrite nanocrystal synthesis with high.pdf:application/pdf}
}

@article{zelenyak_molecular_2016,
title = {Molecular Dynamics Study of Perovskite Structures with Modified Interatomic Interaction Potentials},
volume = {50},
issn = {0018-1439, 1608-3148},
doi = {10.1134/S0018143916050209},
abstract = {The structure of compounds with the perovskite structure ABX3 (A and B are cations, X are anions O2—, F—, Cl—, Br—, and I—), which are widely used in engineering due to unique electrical, optical, and photovoltaic properties, has been considered. Hybrid organic—inorganic halide perovskites important for photovoltaics of a new generation are worth mentioning; they contain cations of organic nitrogen bases as monovalent cations. A molecular dynamics (MD) study of the CaTiO3 base structure (Ca2+, Ti4+, and O2—) has been performed in order to develop the methodology of computer simulation and optimization of the shape and parameters of atomic potentials for perovskite systems.},
timestamp = {2017-07-06T00:19:33Z},
langid = {english},
number = {5},
journaltitle = {High Energy Chemistry},
journal = {High Energy Chemistry},
shortjournal = {High Energy Chem},
author = {Zelenyak, T. Yu and Kholmurodov, Kh T. and Tameev, A. R. and Vannikov, A. V. and Gladyshev, P. P.},
urldate = {2017-07-06},
date = {2016-09-01},
year = {2016},
pages = {400--405},
file = {Zelenyak et al_2016_Molecular dynamics study of perovskite structures with modified interatomic.pdf:/Users/cjs14/Library/Application Support/Firefox/Profiles/gignsb3n.default/zotero/storage/H5NVC2I5/Zelenyak et al_2016_Molecular dynamics study of perovskite structures with modified interatomic.pdf:application/pdf}
}


Binary file added docs/source/_static/example.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/logo_example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/main_image.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/main_image.pptx
Binary file not shown.
Binary file added docs/source/_static/markdown_cells.pdf
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/process.pptx
Binary file not shown.

0 comments on commit 3410e2e

Please sign in to comment.