-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump pandoc upper bound to 2.5 #933
Conversation
Let's keep it up to date unless there's any breaking issue. Reference: https://stackoverflow.com/questions/53966433/jupyter-nbconvert-cannot-work-with-latest-version-of-pandoc/53967931#53967931
Related: #928 |
the error in travis on 3.4 ends with this:
perhaps that's unrelated to the pandoc bump? In which case somebody could try restarting to see if that fixes it. I think a good way to answer the question "should newer versions of pandoc be supported" is to see if the tests all pass w/ newer pandoc |
I know that @ivanov has been looking into pandoc/notebook/etc stuff, maybe he has experience w/ pandoc 2.X and knows if there would be compatibility issues |
The ZMQ error feels like a system issue rather than a code problem... Can anyone trigger the build again? The nightly also failed but it seems to have a more tangible reason:
|
FWIW, you can usually rerun tests by closing and reopening the PR. At the moment, though, there's an unrelated problem with incompatible testing packages, so it will fail if we re-run it now. I'm trying to fix that in #941. The most fragile bit for pandoc versions is this filter which converts links within a notebook to Latex references. It's used here:
That converts the markdown to pandoc's JSON document format, applies the link converter to it, and converts the updated JSON to Latex. So it depends on the structure of pandoc's document format. So before we expand the constraint, please double check that the latest version of |
Yes restricting the pandoc version is particularly a pain if you are using conda, which currently prohibits installing the latest versions of nbconvert and pandoc together. Personally I would suggest you swap out pandocfilters for panflute, which is more 'pythonic' and will deal with changes in the pandoc AST. Somemthing along the lines of: import io
import panflute as pf
def resolve_references(source):
input_stream = io.StringIO(source)
with io.StringIO() as output_stream:
pf.run_filter(resolve_one_reference,
input_stream=input_stream,
output_stream=outut_stream)
return output_stream..getvalue()
def resolve_one_reference(link, doc):
# type: (Link, Doc) -> Element
"""extract links that point to internal items, e.g. [text](#label)"""
if not isinstance(link, pf.Link):
return None
match = re.match(r'#(.+)$', link.url)
if not match:
return None
# pandoc automatically makes labels for headings.
label = m.group(1).lower()
label = re.sub(r'[^\w-]+', '', label) # Strip HTML entities
return pf.RawInline(r'Section \ref{%s}' % label, format="tex") You could also basically replace nbconvert/nbconvert/utils/pandoc.py with panflute functions |
Just a note that another reason to bump pandoc at some point might be to support 2.6, which supports ipynb files and might make it possible to remove some code in nbconvert after a few depreciation cycles |
Let's keep it up to date unless there's any breaking issue.
Reference: https://stackoverflow.com/questions/53966433/jupyter-nbconvert-cannot-work-with-latest-version-of-pandoc/53967931#53967931