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

Error on inline code elements #8

Open
tad-lispy opened this issue Oct 24, 2023 · 4 comments
Open

Error on inline code elements #8

tad-lispy opened this issue Oct 24, 2023 · 4 comments

Comments

@tad-lispy
Copy link

tad-lispy commented Oct 24, 2023

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
Copy link
Owner

jlumpe commented Oct 24, 2023

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

jlumpe commented Jan 6, 2024

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.

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

No branches or pull requests

2 participants