ox-json-export-to-file
ox-json-export-to-buffer
Exported JSON objects which contain structured data have a special “data type” property which indicates the type of data they represent. This is meant to make it easier for external tools to interpret. Objects lacking this property represent simple key-value mappings with no additional implied structure.
By default this property is named "$$data_type"
but its value can be
customized with the :json-data-type-property
option (see the options section).
This is the top-level object generated when the entire file is exported.
"properties"
(object)- File-level properties
"title"
(array)- Document title (secondary string)
"filetags"
(array of strings)"author"
(string)"creator"
(string)"date"
(array)- (secondary string)
"description"
(array)- (secondary string)
"email"
(string)"language"
(string)
"contents"
(array)- The top-level elements in the document. This should
consist of an optional
section
node followed by any number ofheader
nodes.
A node (element or object) in the document’s parse tree.
See the Org element API documentation for the list of node types and their properties.
"type"
(string)- Type of node, given by
org-element-type
. "ref"
(string)- A unique string assigned to all nodes during the export process, from
org-export-get-reference
. "contents"
(array)- Contents of the node. Array of node objects or strings.
"properties"
(object)- Object/element properties from org element API.
"drawer"
(object)- (headline nodes only) Properties defined in
:PROPERTIES:
drawer.
This object appears in place of other values (typically within an org-node
’s properties) when
there was an error exporting that value.
"message"
(string)- A message describing why the error occurred.
Some node types are exported with additional data:
is-inline-image
(bool)- Whether org mode think this link should be rendered as an inline image.
is-internal
(bool)- Whether this link points to a location in the same document. True for the
id
,fuzzy
, andradio
link types. target-ref
(string)- The
ref
property of the headline or other node this link resolves to. Only exists for internal links.
"start"
,"end"
(string)- Year/month/day/hour/minute from the
start-*
andend-*
sets of properties combined together and encoded as a single string in ISO 8601 format.
Property | Data type | Default |
---|---|---|
:json-data-type-property | string | "$$data_type" |
:json-exporters | plist | See variable ox-json-default-type-exporters |
:json-property-types | plist | See variable ox-json-default-property-types |
:json-strict | bool | nil |
:json-include-extra-properties | bool | t |
:json-data-type-property
-
Name of the property added to JSON objects which indicates the type of data they represent.
Set to
nil
to disable. :json-exporters
:json-property-types
:json-strict
:json-include-extra-properties
- All of the top-level document attributes (
author
,date
, etc.) are now grouped under the"properties"
key of theorg-document
object. - Export
start
property oftimestamp
nodes with the correct name. Was being exported with the namebegin
. - JSON objects representing generic key/value mappings no longer have the
"$$data_type"
property.
- Data in property drawers is now exported with headlines in the
"drawer"
property.
- Now requires Emacs 26.1.
- Reorganized/cleaned up much of the internals.
Initial version.