Skip to content
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

Org Reader no longer parses RESULTS blocks #3402

Closed
Gastove opened this issue Jan 31, 2017 · 13 comments
Closed

Org Reader no longer parses RESULTS blocks #3402

Gastove opened this issue Jan 31, 2017 · 13 comments

Comments

@Gastove
Copy link

@Gastove Gastove commented Jan 31, 2017

I initially reported this on the ox-pandoc org export backend tracker, but it looks to be a bug in Pandoc.

If I have this org file: https://gist.github.com/Gastove/bacde836383af37fec5197530e3bd8cd

And I convert it to, say, github-flavored markdown with pandoc, so:

pandoc -f org -t markdown_github -i demo.org -o test.md

The result is: https://gist.github.com/Gastove/4ab9414ae3c8f0ac199d0450ecd2f0c0

On OSX using Pandoc 1.19.2.

@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Jan 31, 2017

Well, that's embarrassing: You were absolutely correct the first time, it seems that this is not a bug in pandoc. At first it looked to me like the reader got confused with the :dir option, but it turns out that it is read just fine.

The actual problem seems to be that ox-pandoc, in order to work around some of pandoc's limitations, exports from org to org first, and then runs pandoc on the result. All source block arguments are lost in that first conversion, including :exports both, causing pandoc to use the default exporting behavior for code blocks (i.e. export code only).

This is most likely an issue with org-to-org exporter in org-mode, but I'm not familiar enough with neither ox-pandoc nor the elisp org-mode code to say for sure.

Thanks for taking the extra trouble of reporting this here, and apologies for the wrong initial info. I'm closing this in favor of the original bug report.

@tarleb tarleb closed this Jan 31, 2017
@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

Er, but: it might be both? If I take ox-pandoc out of the equation, I can still reproduce the bug exactly -- the results block doesn't carry from the org file to the markdown one.

@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Jan 31, 2017

Huh, that's weird. For me, the given file used with above command results in a file containing the output as a table. What's your output of pandoc -v?

@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

oh god am I derping this somehow

frantically checks results

@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

Er, yeah, so:

rossdonaldson@becon λ ~/Dropbox/org-docs
$ pandoc -v
pandoc 1.19.2
Compiled with pandoc-types 1.17.0.5, texmath 0.9, skylighting 0.1.1.3
Default user data directory: /Users/rossdonaldson/.pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

And: https://gist.github.com/Gastove/d84bc120694126e80aa0a5d096d5e4d1

So, definitely not working for me; possibly there is some terrible, derpy mistake I am making?

@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Jan 31, 2017

The src block doesn't have options in that version, but your first gist does, is that intentional? It's probably the cause for the differing behavior. Should the #+RESULT part still be included this ways?

Sidenote: I noticed that your input file contains character sequences like ... and --. Calling pandoc with the --smart option will cause those to be converted to and .

@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

OH. Actually, I hadn't noticed that. I had assumed pandoc wouldn't be inspecting org options, just translating documents verbatim. Is the expected behavior that pandoc will respect src header args?

And: thanks very much for the tip about --smart! Will absolutely make use of that 👍

@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

AH. You're entirely right -- if I add :exports both to the src block, the results block is exported.

I think that's cool as heck, actually -- I had not expected pandoc to be that clever.

@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Jan 31, 2017

Pandoc currently only respects the :exports header and ignores everything else. It's been on my todo list for ages.

@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Jan 31, 2017

Thanks :) We are trying to replicate the original org-mode behavior as much as possible. This also means that pandoc respects about a third of these options: http://orgmode.org/manual/Export-settings.html#Export-settings
I mention this since the default value for the H: option is 3, leading to possibly unexpected results.

@Gastove

This comment has been minimized.

Copy link
Author

@Gastove Gastove commented Jan 31, 2017

Oh wow yeah. That... would not be what I'd expect. Well, very good to know.

@Yevgnen

This comment has been minimized.

Copy link

@Yevgnen Yevgnen commented Sep 21, 2019

I can't get result exported with the test file of OP even with :exports both. Here's my pandoc version

pandoc 2.7.3
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.8.1
Default user data directory: /Users/Yomisuko/.local/share/pandoc or /Users/Yomisuko/.pandoc
Copyright (C) 2006-2019 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.```
@tarleb

This comment has been minimized.

Copy link
Collaborator

@tarleb tarleb commented Sep 21, 2019

@Yevgnen please open a new issue. Best to include an org snippet to demonstrate the issue, as well as the exact command to process the file. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.