Giter Club home page Giter Club logo

Comments (13)

mpacer avatar mpacer commented on August 21, 2024 2

Closing for now — talked with @jhamrick and it's been long enough since they've had to do something like that for nbgrader that it's unlikely that this is still a bug.

from nbconvert.

mscuthbert avatar mscuthbert commented on August 21, 2024 1

(and pandoc 1.19 is working great with nbconvert)

from nbconvert.

minrk avatar minrk commented on August 21, 2024

I think this is a recent change in behavior in pandoc, where when you pass snippets, if there's only one header it uses ===, regardless of the originating format. What version of pandoc are you using?

from nbconvert.

mscuthbert avatar mscuthbert commented on August 21, 2024

pandoc 1.15.0.6
Compiled with texmath 0.8.2.2, highlighting-kate 0.6.
(OS X)

All of the files I'm using have more than one header level, including a top-level ====/# near the beginning of the file. Thanks for looking into it.

from nbconvert.

mscuthbert avatar mscuthbert commented on August 21, 2024

Indeed it is from a change in pandoc. v.1.13.2 works great. v.1.14 (next version; May 28, 2015) breaks. It's probably this change:

Normalize headings to sequential levels (Nikolay Yakimov). This is pretty much required by docutils.

Ironically, this is what is killing docutils for me in my Jupyter/Notebook to Sphinx workflow.

So it seems to be a pandoc problem in some sense rather than a nbconvert problem, but I wonder if there's a hint that nbconvert could be making to not have this behavior function.

from nbconvert.

minrk avatar minrk commented on August 21, 2024

Yup, I think we just need to ask pandoc what the right thing to do is.

from nbconvert.

mscuthbert avatar mscuthbert commented on August 21, 2024

I made a note there. Thanks!

from nbconvert.

minrk avatar minrk commented on August 21, 2024

Pandoc has slightly improved the situation, but there doesn't appear to be anything we can do in the meantime on the nbconvert side.

from nbconvert.

jhamrick avatar jhamrick commented on August 21, 2024

Ugh, @willingc and I just came across this in the nbgrader documentation. A workaround for nbconvert could potentially be to create a special preprocessor just for the rst exporter that does the following:

  1. Change the type of all markdown cells to raw nbconvert, and convert their source to rst
  2. Parse out the heading levels from the original markdown cells and make sure they are the right level in the rst output

It's pretty hacky, but I think it would mostly work, at least. I may write something like this for the nbgrader docs, since I really need the heading levels there to be correct, but maybe it's too hacky for nbconvert proper...

from nbconvert.

minrk avatar minrk commented on August 21, 2024

@jhamrick are you running on a machine you control? Pinning pandoc to 1.13 might be the easiest temporary solution.

from nbconvert.

minrk avatar minrk commented on August 21, 2024

The other workaround is going nbconvert → md; pandoc → rst. I'm not sure how much is lost there, though.

from nbconvert.

minrk avatar minrk commented on August 21, 2024

A fix has been merged into pandoc that should improve things once released. I'm guessing it will first appear in 1.16, which means we should consider blacklisting (or warning, at least) 1.14-1.15 for rst export.

from nbconvert.

mscuthbert avatar mscuthbert commented on August 21, 2024

Supposedly 1.15.1 (15 October 2015) fixed this. I upgraded on one server and it appears to be functional. It's not enough for a close yet, but it's enough that I'll be willing to try out on a production machine soon.

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.