-
Notifications
You must be signed in to change notification settings - Fork 332
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
serialize and deserialize custom nodes to JSON filters #11241
base: main
Are you sure you want to change the base?
Conversation
Ah, Pandoc's Meta doesn't like to have Attr objects in it. This makes everything harder :( |
TODO:
|
end | ||
list:insert(inner) | ||
end | ||
return pandoc.MetaList(list) |
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.
Performance note: pandoc.MetaList
(almost) the same as pandoc.List
, the former just does a little more type correction. The latter is faster, as it's a C function.
|
||
def p_string(string): | ||
return { | ||
"t": "String", |
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.
Should this be "t": "Str"
? It seems that this function isn't used.
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.
It's been zero days since a GitHub Copilot accident.
Addresses #11235
Custom AST nodes are now serialized to and from JSON. This enables, for example, JSON filters to emit shortcodes, callouts, etc.
In order for JSON filters to do this well, they need to be careful about the way they consume and emit the JSON structure. This will need documentation and ideally library support.
This PR unlocks the core capability.