Each JATS element is realized as a package, containing a node definition, a converter and a component for rendering / editing.
When you add support for a new element, you have to choose a Substance node type. Use this check list to find out what kind of element it is.
- Does the element contain annotated text?
Example elements: <p>
, <title>
- Is the element used for formatting, highlighting?
- Can the cursor move inside the element, changing its text?
Example elements: <bold>
, <ext-link>
- Does the element behave like a single text character in the text flow?
- Is the element content generated (e.g. a label)?
- Is the element content a graphic?
- Is the content of the node immutable to text editing and can only be deleted as a whole?
Example elements: <xref>
- Does the element define a sequence of nodes?
- Can the order of the nodes be changed by the user?
Example elements: <body>
, <front>
, <back>
, <sec>
- Does your element not fit into any of the previous types?
Example elements: <fig>
, <ref-list>
Use the following examples as a reference implementation.
- Paragraph (Text Node)
- ExtLink (Annotation Node)
- XRef (Inline Node)
- Body (Container Node)
- Figure (Document Node)
A converter is needed to map from JATS XML to Substance document nodes.
- Paragraph Converter (Text Node)
- ExtLink Converter (Annotation Node)
- XRef Converter (Inline Node)
- Body Converter (Container Node)
- Figure Converter (Document Node)
It's important you test your converter throughly, otherwise content could be lost. The following examples can be used as a reference.
- Paragraph Test (Text Node)
- ExtLink Test (Annotation Node)
- XRef Test (Inline Node)
- Body Test (Container Node)
- Figure Test (Document Node)
In order to make the content editable, you have to define components for each JATS element.
- Paragraph Component (Text Node)
- ExtLink Component (Annotation Node)
- XRef Component (Inline Node)
- Body Component (Container Node)
- Figure Component (Document Node)