{ "info": { "author": "Lukas Ahrenberg", "author_email": "lukas@ahrenberg.se", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# nbcorg - A jupyter notebook to orgmode exporter for nbconvert\n\nThis is an [nbconvert](https://github.com/jupyter/nbconvert) exporter to convert an ipython/jupyter notebook to [orgmode](https://orgmode.org/) with multiple options for treating source code and output blocks.\n\n## Installation and getting started\n\nnbcorg can be installed from the command line with pip, e.g,\n```\npip install nbcorg\n```\n\nThis should install the software with dependencies, as well as create entry points for the orgmode exporters in nbconvert.\n\n## Using nbcorg\nOnce installed, the orgmode exporters can be selected using the `nbconvert --to` switch, e.g,\n```\njupyter nbconvert --to orgmode mynotebook.ipynb\n```\n\nIf you'd rather run from source without installation, you may do so from the nbcorg directory using the full qualified name [as described in the nbconvert documentation](https://nbconvert.readthedocs.io/en/latest/external_exporters.html#using-a-custom-exporter-without-entrypoints), e.g,\n```\njupyter nbconvert --to nbcorg.OrgmodeExporter mynotebook.ipynb\n```\n\n### Included exporters\nnbcorg functionality can be tuned using command line switches, as described below, however for convenience the package includes a couple named exporters with different default values for these.\n\n#### `orgmode` (`nbcorg.OrgmodeExporter`)\nThis is the base exporter with default values for options and switches as described below\n\n#### `orgmode_babel` (`nbcorg.OrgmodeBabelExporter`)\nIgnores all output and appends `:session :results output` to code blocks. Useful if a notebook should be converted to a literate programming org file. Note that the source code language is at the moment derived from notebook metadata, and for instance an ipython session is given as 'python', meaning that if you use cell magic you may need to do some tweaks to get it to work.\n\nThis a convenience exporter, running\n```\njupyter nbconvert --to orgmode-babel mynotebook.ipynb\n```\nis the same as\n```\njupyter nbconvert --to orgmode --OrgmodeExporter.src_block_options=':session :results output' --OrgmodeExporter.exclude_output=True\n```\n\n### Configuration options\nFor a list of nbconfig configuration options also applicable to the orgmode exporters see the nbconvert manual for [exporter](https://nbconvert.readthedocs.io/en/latest/config_options.html#exporter-options) and [preprocessor](https://nbconvert.readthedocs.io/en/latest/config_options.html#preprocessor-options) options. (In particular those applicable to `TemplateExporter` and `ExtractOutputPrecprocessor`.)\n\n`nbcorg.OrgmodeExporter` defines also the following additional options:\n\n#### `--OrgmodeExporter.exclude_execute_result=`\nDefault: False\n\nDo not include execution results in output data.\nExecute results are special outputs separate from display data. The\n`[matplotlib.Y.Z at 0x123456789ABCDEF]` kind of strings in the notebook\nwhen plotting a matplotlib figure is one example.\n\n#### `--OrgmodeExporter.exclude_raw=`\nDefault: False\n\nThis allows you to exclude raw cells from all templates if set to True.\n\n#### `--OrgmodeExporter.html_data_as=`\nDefault: `export`\n\nHow HTML output data should be handled.\n\nAllowed values: \n- `export` - Enclose HTML in `#+BEGIN_EXPORT html ...`-block.\n- `example` - Enclose HTML in `#+BEGIN_EXAMPLE ... `-block.\n- `import` - Use pandoc to convert HTML to org. Results may vary... Much of likely still returned as HTML by pandoc and enclosed in `+#BEGIN_HTML...`-blocks.\n\n#### `--OrgmodeExporter.input_drawer_name=`\nDefault: `INPUT`\n\nDrawer name for input cell content.\nOnly applicable if `OrgmodeExporter.use_input_drawer=True`. Input cell\ncontent will be placed in an org drawer of this name.\n\n#### `--OrgmodeExporter.javascript_data_as=`\nDefault: `html`\n\nHow javascript output data should be handled.\n\nAllowed values: \n- `html` Place the js code in HTML