ipython/ipython — pull request #6978 by takluyver (2014-11-19 00:35:50+00:00)
Title: Nbconvert to script for any kernel language

This adds both `nbconvert --to script` and a 'Download as' menu option that updates to match the relevant kernel.

* The file extension is taken from kernel info, defaulting to `.txt` so as to degrade gracefully where kernels haven't added this feature.
* For now, it *just* gives the contents of the code cells, with no extra metadata in comments. This keeps things simple, because we don't need to deal with different comment styles, but we can add that later if we feel it's necessary.
* The kernel info can also specify `nbconvert_exporter` to use from the menu instead of the 'script' exporter, and our own kernel specifies the 'python' exporter, which adds e.g. the `# coding: utf-8` header.