{ "info": { "author": "Cyrille Rossant", "author_email": "cyrille.rossant at gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Framework :: IPython", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: Text Processing :: Markup" ], "description": "[](https://travis-ci.org/rossant/ipymd)\n[](https://coveralls.io/r/rossant/ipymd)\n\n# Replace .ipynb with .md in the IPython Notebook\n\nThe goal of ipymd is to replace `.ipynb` notebook files like:\n\n```json\n{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"source\": [\n \"Here is some Python code:\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"outputs\": [\n {\n \"name\": \"stdout\",\n \"output_type\": \"stream\",\n \"text\": [\n \"Hello world!\\n\"\n ]\n }\n ],\n \"source\": [\n \"print(\\\"Hello world!\\\")\"\n ]\n }\n ...\n ]\n}\n```\n\nwith:\n\n Here is some Python code:\n\n ```python\n >>> print(\"Hello world!\")\n Hello world!\n ```\n\nThe JSON `.ipynb` are removed from the equation, and the conversion happens on the fly. The IPython Notebook becomes an interactive Markdown text editor!\n\nA drawback is that you lose prompt numbers and images (for now).\n\nThis is useful when you write technical documents, blog posts, books, etc.\n\n\n\n## Installation\n\n1. Install ipymd:\n\n To install the latest release version:\n\n ```shell\n pip install ipymd\n ```\n\n Alternatively, to install the development version:\n\n ```shell\n pip install git+https://github.com/rossant/ipymd\n ```\n\n2. **Optional:**\n To interact with `.ipynb` files:\n\n ```shell\n pip install jupyter ipython\n ```\n\n To interact with `.odt` files:\n\n ```shell\n pip install git+https://github.com/eea/odfpy\n ```\n\n3. Open your `jupyter_notebook_config.py`. Here's how to find it:\n\n\n ```\n jupyter notebook --generate-config # generate a default config file\n jupyter --config-dir # find out the path to the config file\n ```\n\n4. Add the following in `jupyter_notebook_config.py`:\n\n ```python\n c.NotebookApp.contents_manager_class = 'ipymd.IPymdContentsManager'\n ```\n\n5. Now, you can open `.md` files in the Notebook.\n\n## Why?\n\n### IPython Notebook\n\nPros:\n\n* Excellent UI for executing code interactively *and* writing text\n\nCons:\n\n* `.ipynb` not git-friendly\n* Cannot easily edit in a text editor\n* Cannot easily edit on GitHub's web interface\n\n\n### Markdown\n\nPros:\n\n* Simple ASCII/Unicode format to write code and text\n* Can easily edit in a text editor\n* Can easily edit on GitHub's web interface\n* Git-friendly\n\nCons:\n\n* No UI to execute code interactively\n\n\n### ipymd\n\nAll pros of IPython Notebook and Markdown, no cons!\n\n\n## How it works\n\n* Write in Markdown in `document.md`\n * Either in a text editor (convenient when working on text)\n * Or in the Notebook (convenient when writing code examples)\n* Markdown cells, code cells and (optionally) notebook metadata are saved in\n the file\n* Collaborators can work on the Markdown document using GitHub's web interface.\n* By convention, a **notebook code cell** is equivalent to a **Markdown code block with explicit `python` syntax highlighting**:\n\n ```\n >>> print(\"Hello world\")\n Hello world\n ```\n\n* **Notebook metadata** can be specified in [YAML](http://yaml.org/) inside\n Jekyll-style [front-matter](http://jekyllrb.com/docs/frontmatter/) dashes\n at the beginning of a document:\n\n ```markdown\n ---\n kernelspec:\n name: some-non-native-kernel\n ---\n\n First cell content\n ```\n\n Native kernel metadata will be elided by default: non-python kernels haven't\n been tested yet, but support is planned.\n\n* **Cell metadata** is specified with YAML stream documents with dashes and\n periods, such as to create slides:\n\n ```markdown\n # Previous slide\n\n ---\n slideshow:\n slide_type: slide\n ...\n\n # Some Slide Content\n ```\n\n > NOTE: You probably shouldn't use `---` to mean an `