jkitchin / ox-ipynb

org-mode exporter to Jupyter notebooks
170 stars 39 forks source link

Exporting Org-tables does not produce table head separators #36

Open BBurkhardt opened 3 years ago

BBurkhardt commented 3 years ago

Dear John,

I ran into the following unexpected behavior while exporting some Org-Tables.

Exporting the following table:

| column-a | column-b | |----------+----------| | test1 | test2 | | test3 | test4 |

produces the following MarkDown Code:

| column-a|column-b| | test1|test2| | test3|test4|

Since the table head separator is missing, the table is not rendered properly in Jupyter Notebook.

jkitchin commented 3 years ago

hm. I am not able to reproduce this on commit bded0e5 or on master.

uliw commented 3 years ago

This is similar to my note #386 in the scimax section. I did some experiments and tried to checkout older versions of ox-ipynb. github is still a black box to me, but the following should have worked I hope

git checkout 8d62d420f8cd0ba6e6696a99de63a5ad2f29024b

this particular commit is from Oct 2018, and I know for certain that tables worked until at least August this year. However, I get the same result.

If I used the checkout command correctly, this implies that the problem with the tables is elsewhere. Is this a possibility?

jkitchin commented 3 years ago

It might not be enough to simply do the checkout. That will update the elisp files, but not reload them in emacs. What I would do is

  1. open emacs
  2. In a shell do these: a. cd /path/to/ox-ipynb b. git checkout 8d62d42
  3. Back in emacs, open ox-ipynb.el and M-x eval-buffer

then try the export.

The order of those may be important. ox-ipynb is a submodule in scimax, and if you open scimax after you do a git checkout, it may revert it back to the committed version before loading it, which will make it look like nothing changed.

uliw commented 3 years ago

oh ok. that explains it. Starting scimax does indeed update the ox-ipynb directory. If I do it your way, the export succeeds as expected.

On Wed, Nov 4, 2020 at 10:17 AM John Kitchin notifications@github.com wrote:

It might not be enough to simply do the checkout. That will update the elisp files, but not reload them in emacs. What I would do is

  1. open emacs
  2. In a shell do these: a. cd /path/to/ox-ipynb b. git checkout 8d62d42 https://github.com/jkitchin/ox-ipynb/commit/8d62d420f8cd0ba6e6696a99de63a5ad2f29024b
  3. Back in emacs, open ox-ipynb.el and M-x eval-buffer

then try the export.

The order of those may be important. ox-ipynb is a submodule in scimax, and if you open scimax after you do a git checkout, it may revert it back to the committed version before loading it, which will make it look like nothing changed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jkitchin/ox-ipynb/issues/36#issuecomment-721793019, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWSVAR7NR33SWBFCYDATXTSOFWB3ANCNFSM4TCOLOYA .

-- Ulrich G. Wortmann https://www.es.utoronto.ca/people/faculty/wortmann-ulrich/ Dept. of Earth Sciences Fax : 416 978 3938 University of Toronto Phone: 416 978 7084 22 Ursula Franklin Street, Toronto, ON, Canada M5S 3B1

eginhard commented 3 years ago

This still does not work on master and appears to be due to commit https://github.com/jkitchin/ox-ipynb/commit/c9834ae695c782f5bc0f663aad5c15052174eb84

I'm able to "fix" it by replacing (if (not (= 0 nrules)) with (if (> nrules 1) because for some reason this part is run twice and then the second time nrules is not 0 anymore and the separator isn't added, but I guess there is a more correct way to do it?

jkitchin commented 3 years ago

Ok, I think I see what was happening, and I think the fix above fixes it. It might not solve all problems, and is limited to the simplest markdown for tables. anything fancier probably requires an html table. I will save that for another day. Let me know if this works for you.

eginhard commented 3 years ago

Yes, this works again for simple tables with one horizontal rule. Thank you!