{ "info": { "author": "Nathan Goldbaum", "author_email": "nathan12343@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# Notebook sphinx extensions\n\n## Installation\n\nThis package is available on pypi: https://pypi.python.org/pypi/RunNotebook\n\nInstall it using pip:\n\n pip install RunNotebook\n\nAdd the extension to your `conf.py`:\n\n```python\nextensions = [\n # Import both\n 'RunNotebook',\n\n # or import each directive individually\n # 'RunNotebook.notebook_sphinxext',\n # 'RunNotebook.notebookcell_sphinxext',\n # ...\n]\n```\n\nOptional configuration in your `conf.py`:\n\n```python\n# Run notebook configuration\n\n# The template used when exporting from nbconvert\n# full - Outputs the full HTML document [Default]\n# basic - Outputs a single div (with no additional resources)\nrun_notebook_export_template = 'basic' # Default: 'full'\n\n# Display the source links to the generated evaluated files\nrun_notebook_display_source_links = False # Default: True\n```\n\nTake a look at the `conf.py` file in the example sphinx project to see how to \nintegrate with your sphinx build.\n\n## Code snippets in documentation\n\nThis packages two useful [Sphinx](http://sphinx-doc.org/) extensions: `notebook`\nand `notebook-cell`. These extensions are useful for embedding entire\nnotebooks or single notebook cells, respectively, inside sphinx documentation.\n\nIn the past, it was relatively straightforward to include example scripts inside\nof version controlled documentation. For example, one could include code\nsnippets inside of sphinx documentation using the rst `code-block` directive:\n\n```rst\n.. code-block:: python\n\n for i in range(5):\n print i\n\n```\n\nWhile this does produce a syntax highlighted python script embedded in a sphinx\ndocument, it does not run the code or provide any facilities for checking whether\nthe code is correct.\n\n[Jupyter](http://jupyter.org) notebooks offer a powerful environment for\nliterate programming, with code input, output, and explanatary text embedded\ninto a single document. It's tempting to include notebooks into documentation\nwholesale. However, there are some issues with this approach as\nwell. Versioning notebooks is difficult - output can change and if the notebook\noutput contains large amounts of data, the diffs can easily grow quickly,\nproducing an inconveniently large repository. In addition, updating the \nnotebook requires manually re-evaluating all the notebook cells, saving the \nnotebook, and making a commit if anything changes. Versioning evluated \nnotebooks also offers no guarantee that the code in the notebook is still \nfunctional - a real concern with a notebook documenting an evolving codebase\nwith imperfect test coverage.\n\n## Using Sphinx Extensions to Automate Notebook Running\n\nThe extensions included in this package make it easy to include unevaluated\nnotebooks or short python code snippets inside of documentation. Both extensions\nmake use of [nbconvert](http://nbconvert.readthedocs.io/) to script the\nevaluation of notebooks and to convert the resulting evaluated notebooks into\nHTML suitable for embedding in a Sphinx document.\n\n## Dependencies\n\nThis extension depends on `Jupyter`.\n\nNote that all `Jupyter` dependencies (even the optional ones) must be\ninstalled. In particular, [pandoc](http://johnmacfarlane.net/pandoc/) and\n[node.js](http://nodejs.org/) must be available since these are used by\nnbconvert.\n\n## Examples\n\nSuppose I want to include a notebook named `example.ipynb` inline in my\ndocumentation. To do so, add the following to any sphinx ReStructuredText\ndocument:\n\n```rst\n\n.. notebook:: example.ipynb\n\n```\n\nDuring preprocessing, sphinx will evaluate the notebok, convert it to html, and\nembed it into the document in the place where the `notebook` directive was\nused.\n\nIf a full notebook does not make sense or if you would like to more tightly link\na script to the source of your documentation, you can use `notebook-cell` to\nembed a single-cell mini notebook:\n\n```rst\n\n.. notebook-cell::\n\n for i in range(5):\n print i\n\n```\n\nThis will convert the code snippet into a notebook, evaluate the notebook, and\nthen embed the result in the document. Note that notebook-cell does not\ncurrently accept a user namespace, so all imports necessary for the code to run\nmust be included in the source.\n\nSee the `example` folder in the root of the repository for a full, working \nexample using a basic sphinx configuration.\n\n## Known issues\n\nThese extensions use a version of the 'full' HTML output from the nbconvert HTML\noutput. This includes the full notebook CSS. There's some CSS monkeypatching\nthat happens to reduce the impact of the notebook CSS on the document, which\nmight conflict with your documentation theme. If it turns out that the\nmonkeypatching is fragile and there are visual issues in your preferred docs\ntheme, please let me know by opening a github issue.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ngoldbaum/RunNotebook", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "RunNotebook", "package_url": "https://pypi.org/project/RunNotebook/", "platform": "", "project_url": "https://pypi.org/project/RunNotebook/", "project_urls": { "Homepage": "https://github.com/ngoldbaum/RunNotebook" }, "release_url": "https://pypi.org/project/RunNotebook/0.3.1/", "requires_dist": [ "sphinx", "jupyter", "nbconvert", "nbformat" ], "requires_python": "", "summary": "", "version": "0.3.1" }, "last_serial": 4211525, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f091e79a0d0716802443708c478b5c5f", "sha256": "618279fbdb3665d2e26d37e1e17c4850d16b1fd00787a658883628ea19918e80" }, "downloads": -1, "filename": "RunNotebook-0.1.tar.gz", "has_sig": false, "md5_digest": "f091e79a0d0716802443708c478b5c5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3935, "upload_time": "2016-01-14T23:14:39", "url": "https://files.pythonhosted.org/packages/54/80/8257fa71cecda99cd283a1aa8af8da595e0aedbb90aa7f338c4fd8e9f5d1/RunNotebook-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "911c9780fb78b9130e4909077a1bff7a", "sha256": "5982bb2ebec1277b3700cfd508c790dd077cfdf0c48302126a298e32fd4d02c4" }, "downloads": -1, "filename": "RunNotebook-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "911c9780fb78b9130e4909077a1bff7a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6228, "upload_time": "2017-08-04T19:03:36", "url": "https://files.pythonhosted.org/packages/08/c4/490263d061ddbbf4bd57f4227612f7f9b020be8ace12a127a9e1b8c10cc0/RunNotebook-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "954979b0b764c98ec9281bb2a34eed59", "sha256": "00b47b00ec90aca01a19a346350b0877d67a76707861160c74e8ab532e49bdfc" }, "downloads": -1, "filename": "RunNotebook-0.2.tar.gz", "has_sig": false, "md5_digest": "954979b0b764c98ec9281bb2a34eed59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3908, "upload_time": "2017-08-04T19:03:37", "url": "https://files.pythonhosted.org/packages/60/d8/e897f027041f9140cbaa14fbfa009596079155bef321dbfa6bf562d48955/RunNotebook-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "86c0633493546d8a4d01c3f60e7ad9a3", "sha256": "f0e075035a4a55257077b2ec315db215a216e7acbbb5c8d6b5acc870dead30f0" }, "downloads": -1, "filename": "RunNotebook-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86c0633493546d8a4d01c3f60e7ad9a3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6252, "upload_time": "2017-08-05T04:54:01", "url": "https://files.pythonhosted.org/packages/66/6c/ba15d23e56462dbfd05340b1ef79fa68bf20f932174c41afcb8bae14b879/RunNotebook-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43685f85548abcd4a718ec11e25918b8", "sha256": "502111c4093c02926844917867a87b26d1cad738b5e75e149345d42fa8e26e18" }, "downloads": -1, "filename": "RunNotebook-0.2.1.tar.gz", "has_sig": false, "md5_digest": "43685f85548abcd4a718ec11e25918b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3912, "upload_time": "2017-08-05T04:54:02", "url": "https://files.pythonhosted.org/packages/7b/de/72a9b79733b25bbde97cbebfbe0c4179f781dee7f9185cf16a6262ad90af/RunNotebook-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2547060ee2c5638352f60f015264089f", "sha256": "c306ae6281211e62155599ca9c748f6c4d65b4158183fa1c2e0b324e88626a64" }, "downloads": -1, "filename": "RunNotebook-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2547060ee2c5638352f60f015264089f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5766, "upload_time": "2018-08-27T15:59:58", "url": "https://files.pythonhosted.org/packages/e8/73/1591ead5a717829ed253f93273cec40fcbb77e966f3e0189288d0aa6a8a9/RunNotebook-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "336943800b8f8cafe69b3c3941879461", "sha256": "0ba6f45867a203a998db17b719b94e86aa974742296cadca5d62ad881fb11302" }, "downloads": -1, "filename": "RunNotebook-0.3.0.tar.gz", "has_sig": false, "md5_digest": "336943800b8f8cafe69b3c3941879461", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6051, "upload_time": "2018-08-27T16:00:00", "url": "https://files.pythonhosted.org/packages/f9/cc/74e83445ef2aa83447426671f957af9f99cd3de2b9d70794b5ab65f74068/RunNotebook-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a79770f7f1fe6cb2243a19186fb56c91", "sha256": "5713ba5febe1a84f39ffb3c536d7e615ed7f170acd559496a29f1d728f159f6f" }, "downloads": -1, "filename": "RunNotebook-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a79770f7f1fe6cb2243a19186fb56c91", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7795, "upload_time": "2018-08-27T16:02:54", "url": "https://files.pythonhosted.org/packages/d4/94/75ecb7318b0474c116af565ba23cf79faa41f0f2ffcdc99642f314d56f2c/RunNotebook-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67ddf123b72f97369831ba684a426962", "sha256": "7c4b1ecaf65f4bcc90d47bbec3f2b927a905c383c114cebe012b4d745442931a" }, "downloads": -1, "filename": "RunNotebook-0.3.1.tar.gz", "has_sig": false, "md5_digest": "67ddf123b72f97369831ba684a426962", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6651, "upload_time": "2018-08-27T16:02:55", "url": "https://files.pythonhosted.org/packages/ac/d3/7ed5cb76c734dddcf2dc993ab8b2ae5a4fc908e22472adfc77e2cb83c9f5/RunNotebook-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a79770f7f1fe6cb2243a19186fb56c91", "sha256": "5713ba5febe1a84f39ffb3c536d7e615ed7f170acd559496a29f1d728f159f6f" }, "downloads": -1, "filename": "RunNotebook-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a79770f7f1fe6cb2243a19186fb56c91", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7795, "upload_time": "2018-08-27T16:02:54", "url": "https://files.pythonhosted.org/packages/d4/94/75ecb7318b0474c116af565ba23cf79faa41f0f2ffcdc99642f314d56f2c/RunNotebook-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67ddf123b72f97369831ba684a426962", "sha256": "7c4b1ecaf65f4bcc90d47bbec3f2b927a905c383c114cebe012b4d745442931a" }, "downloads": -1, "filename": "RunNotebook-0.3.1.tar.gz", "has_sig": false, "md5_digest": "67ddf123b72f97369831ba684a426962", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6651, "upload_time": "2018-08-27T16:02:55", "url": "https://files.pythonhosted.org/packages/ac/d3/7ed5cb76c734dddcf2dc993ab8b2ae5a4fc908e22472adfc77e2cb83c9f5/RunNotebook-0.3.1.tar.gz" } ] }