Skip to content

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented Oct 29, 2024

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.

@cscheid
Copy link
Collaborator Author

cscheid commented Oct 29, 2024

Ah, Pandoc's Meta doesn't like to have Attr objects in it. This makes everything harder :(

@cscheid
Copy link
Collaborator Author

cscheid commented Oct 30, 2024

TODO:

  • from_json and to_json support in custom nodes

end
list:insert(inner)
end
return pandoc.MetaList(list)
Copy link
Collaborator

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",
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@cscheid cscheid added this to the v1.7 milestone Nov 18, 2024
@cscheid cscheid self-assigned this Dec 12, 2024
@cscheid cscheid added the early-in-release An issue that should be worked on early in the release (likely due to risk) label Dec 12, 2024
@cscheid cscheid modified the milestones: v1.7, v1.8 Apr 2, 2025
@cscheid cscheid modified the milestones: v1.8, v1.9 Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

early-in-release An issue that should be worked on early in the release (likely due to risk)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants