-
Notifications
You must be signed in to change notification settings - Fork 572
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
asciidoc export #355
asciidoc export #355
Conversation
@@ -4,6 +4,7 @@ | |||
from .templateexporter import TemplateExporter | |||
from .latex import LatexExporter | |||
from .markdown import MarkdownExporter | |||
from .asciidoc import ASCIIdocExporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to add a new file when you committed ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, fixed now, I think ;)
I think it would be OK to add an asciidoc exporter to nbconvert, assuming it doesn't add much complexity. However, if we decide not to, it should now be easy to distribute it as a separate module, using entry points to register the exporter: |
Either way is fine for me. Adding in here would provide more exposure. I don't see a lot of complications. It's supported by pandoc, so things should be fairly simple. It's mostly tweaking the template. |
@@ -0,0 +1,35 @@ | |||
"""Markdown Exporter class""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops I totally didn't copy & paste this
This should be good now. Suggestions for tests welcome. |
I think asciidoc is appropriate to include, especially if @amueller promises to support it going forward. |
Yeah I'm happy to help. Sent from phone. Please excuse spelling and brevity. On Aug 23, 2016 09:40, "Min RK" [email protected] wrote:
|
Added to 5.0, I'll think more about the tests question. @amueller what sorts of issues were you running into while debugging this? That might be a good place to start? I'm fine shipping it by default for exposure and ease of use sake, but could you still convert this to entry points as per #352. Right now you're set up to conflict with that once that pr is merged. |
@michaelpacer can you elaborate on the entry points? One thing that I noticed when debugging was that latex was dropped (as it is when converting to html, think? or RST?) Things were pretty straight-forward. There is a work-around for a pandoc bug in there, the rest was pretty straight-forward. I'm wondering if we want better support for internal links. Markdown has (afaik) internal links via |
I think I need to clean this up a bit. It seems to me instead of writing many |
My intuition is that while the generic pandoc converter is a good idea, that should be a separate PR as it will require a more broad refactoring of the code base at which point new bugs are likely to be introduced. |
So should I first create a PR for the generic pandoc filter? Or I could add a separate |
The only thing I thought would be good to have in the previous version, would be to use entrypoints to access it in addition to using the hardcoded In fact my worry is that your asciidoc exporter won't be seen by the Could you write a test that takes one of the notebooks and exports it to asciidoc? I'm pretty sure if you add that it'll fail right now. |
As for the order of the PRs, if you think you can put it together relatively quickly it shouldn't be an issue. The changes you'll be making for that will likely be covered by existing tests, since it's modding current infrastructure rather than adding a new exporter. So I imagine it'll be faster to debug and faster to merge, and it'll probably save you the time of needing to rewrite some of this PR if you do that first. |
Also apologies for not elaborating on the entrypoints stuff before, it shouldn't be hard, just add a line in the |
Ok, thanks. Don't expect anything this week, but hopefully next. |
I'm going to move this to 5.1, which I anticipate won't need too many things to be released shortly after 5.0. If we don't release 5.0 before you can cover those cases then it should definitely be in |
Yay, #436 was merged, so this can proceed. Feel free to define a convenience method, but I ask that for consistency inside the template itself that you use the I was going to do a refactoring of the generic pandoc now that it's merged. It may be possible to use that as a way to do the postprocessing rather than needing to hardcode it in a single function (See #291 #416). @amueller Will you have a chance to work on this soon? |
I'll try over the weekend, ok? |
I think @mpacer would like to have a beta soonish (if possible before end of october). If it does not make it into 5.0 we can make it into 5.1 which should be sooninsh after 5.0 cause we'll probably get complaint as we often break things unexpectedly. |
Hi @amueller, I was hoping to have this ready to go (at least as a beta release) by the end of this week. And yes I support what @Carreau said, we can put this in 5.1, if it doesn't make it into 5.0. But given that the generic pandoc filter is included it'd be nice to have with it together, illustrating its use. |
Also, I think I'm going to not touch generic pandoc and solve the rst filtering in a slightly different way. |
Ok, trying to do this today. |
adding in and out prompts add display data priority to asciidoc, tweak asciidoc template add hack to work around weird pandoc behavior add support for latex blocks nicer In/Out blocks, no extra blocks for each output. add generic pandoc conversion filter, also convert html in asciidoc add missing file
Just ran this over my book and got no errors... I think that's a relatively decent test (can't check that one in, though ;) . I'll add something to the test file after dinner. |
This is looking good. Restarted the build on travis, since it looked like it failed for bad reasons. Also, if the I'm ok if you want to leave the helper there for other people in the LaTeX filter module itself. |
Also, thank's for turning this around so quickly! |
I removed the |
I added a test to the exporters. Was that what you had in mind? I just realized that before I kept cramming stuff into |
I don't understand the test failure. That's unrelated, right? Can someone retrigger on 2.7? |
It did indeed look unrelated; I've rerun it and it passed. :-) |
@amueller Apologies for the lack of quick response. I wasn't able to spend much of any time on GitHub today. So this looks good except that the test case that you are making the exception for in the Other than that this looks good to merge. |
Made a PR at amueller#2 to fix the code coverage issue. As soon as that's added, I'll merge. @amueller Sorry for not contributing directly… I would have just pushed an update here, but then I would have felt uncomfortable also merging, and I wanted to be able to do that as soon as I could. |
Add test case
Thanks @amueller for all the work you put into this! Merging |
thank you for your help in getting this in :) |
I've started on writing an asciidoc exporter.
This is helpful particularly for people that want to write books with O'Reilly, which are a few folks these days, I think.
This PR is not ready for reviews yet, but I wanted to ask