jlumpe / ox-json

JSON export back end for Emacs Org mode
MIT License
82 stars 6 forks source link

Error on inline code elements #8

Open tad-lispy opened 1 year ago

tad-lispy commented 1 year ago

Hi! I'm experimenting with ox-json with the intention of exporting my Org documents for processing with external tools. Your package is very promising. Thanks you for the effort you put into it. Unfortunately I ran into a problem.

With this minimal Org document:

Content with ~inline code~.

I'm getting this JSON in place of the inline code:

{
  "$$data_type": "org-node",
  "type": "code",
  "ref": "org0874718",
  "properties": {
    "standard-properties": null,
    "value": {
      "$$data_type": "error",
      "message": "Expected string or symbol, got [org-element-deferred org-element--substring (1 12) nil]"
    }
  },
  "contents": []
}

I'm using Doom Emacs.

GNU Emacs     v29.1            nil
Doom core     v3.0.0-pre       HEAD -> master 986398504 2023-10-07 02:33:45 +0200
Doom modules  v23.09.0-pre     HEAD -> master 986398504 2023-10-07 02:33:45 +0200

Below is the whole pretty printed JSON document.

{
  "$$data_type": "org-document",
  "properties": {
    "title": [],
    "filetags": [],
    "author": [
      "Tad Lispy"
    ],
    "creator": "Emacs 29.1 (Org mode 9.7)",
    "date": [],
    "description": [],
    "email": "***@***",
    "language": "en"
  },
  "contents": [
    {
      "$$data_type": "org-node",
      "type": "section",
      "ref": "org3bf75fb",
      "properties": {
        "standard-properties": null
      },
      "contents": [
        {
          "$$data_type": "org-node",
          "type": "paragraph",
          "ref": "org5e029c1",
          "properties": {
            "standard-properties": null
          },
          "contents": [
            "Content with ",
            {
              "$$data_type": "org-node",
              "type": "code",
              "ref": "org0874718",
              "properties": {
                "standard-properties": null,
                "value": {
                  "$$data_type": "error",
                  "message": "Expected string or symbol, got [org-element-deferred org-element--substring (1 12) nil]"
                }
              },
              "contents": []
            },
            ".\n"
          ]
        }
      ]
    }
  ]
}
jlumpe commented 1 year ago

Hi @tad-lispy, thanks for your interest in this package. Unfortunately at this point I do not have any plans to develop or maintain it further. I ultimately decided that org mode and Emacs are too much trouble and have switched to Obsidian for all my note taking needs.

tad-lispy commented 1 year ago

Ok. Thanks for the heads up. It is quite a lot of hassle sometimes. I guess someone else or I will have to fork it and take it from where you left off.

Somewhat funny, I was in the middle of writing my update when I saw your response, so I hope you don't mind me leaving it here for future reference.


Looks like the problem is related to the breaking changes introduced in Org Mode 9.7, which although not released yet, somehow found it's way into my Emacs.

Org mode version 9.7 (9.7-??-e90a8a69a @ /home/tad/.config/emacs/.local/straight/build-29.1/org/)

The changes are described here: https://list.orgmode.org/874jnudps5.fsf@localhost/

The key seems to be getting the data from deferred nodes.

tad-lispy commented 1 year ago

In case anyone else is interested in this, here is my fork adapted to Org 9.7: https://gitlab.com/tad-lispy/ox-json. At the moment it's a hack, but it seems to be working.

jlumpe commented 10 months ago

Well I got back into this a little just to convert my old library of notes to markdown, ended up taking the time to at least make a proper new release with all the changes since 0.2.0. Now that I've re-familiarized myself with it a bit I'll take a look into this.