Giter Club home page Giter Club logo

Comments (5)

takluyver avatar takluyver commented on July 20, 2024 1

The template doesn't look at the code of the cell at all, it just puts it all in a .. code:: python block (this is also wrong - it should match the language the notebook is written in).

You could write a custom template which would look at cell magics and produce appropriate rst directives. I think this would probably be useful for us too, now that we're converting notebooks into rst docs.

from nbconvert.

Carreau avatar Carreau commented on July 20, 2024

On Jun 20, 2015, at 01:23, Thomas Kluyver [email protected] wrote:

The template https://github.com/jupyter/nbconvert/blob/master/nbconvert/templates/rst.tpl#L10 doesn't look at the code of the cell at all, it just puts it all in a .. code:: python block (this is also wrong - it should match the language the notebook is written in).

You could write a custom template which would look at cell magics and produce appropriate rst directives. I think this would probably be useful for us too, now that we're converting notebooks into rst docs.

And what if you pass relevant option to the first line that are necessary for the comprehension of the program ?
Moreover magic are β€œjust” syntactic sugar for actual function call as hist -t shows.

from nbconvert.

mpacer avatar mpacer commented on July 20, 2024

It seems like there are two pieces to this issue, one part should be fixed (it should put the language the notebook is written in not .. code:: python as @takluyver points out) and the other would seem to require a level of code parsing beyond templating that, based on what @takluyver and @Carreau are saying, is not on the roadmap.

The former should be dealt with for 5.0, the latter maybe no_action (or wishlist if it is something we plan to implement) is that right?

I'm going to open a new issue for dealing with the former, and mark this as no_action.

from nbconvert.

takluyver avatar takluyver commented on July 20, 2024

One possibility for the latter part is that we could specify the language as IPython, relying on our own lexers to deal with highlighting magics. I don't know how well they do currently with cell magics using other languages.

from nbconvert.

MSeal avatar MSeal commented on July 20, 2024

Closing as there's no action taken and the complexity of the change is questionable.

from nbconvert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.