Skip to content

Latest commit

 

History

History
86 lines (52 loc) · 2.92 KB

CONTRIBUTING.md

File metadata and controls

86 lines (52 loc) · 2.92 KB

Implement a new JATS element

Each JATS element is realized as a package, containing a node definition, a converter and a component for rendering / editing.

Choose the right node type

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.

Text

  • Does the element contain annotated text?

Example elements: <p>, <title>

Annotation

  • Is the element used for formatting, highlighting?
  • Can the cursor move inside the element, changing its text?

Example elements: <bold>, <ext-link>

Inline

  • 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>

Container

  • 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>

DocumentNode

  • Does your element not fit into any of the previous types?

Example elements: <fig>, <ref-list>

Define a new node class

Use the following examples as a reference implementation.

Define a converter

A converter is needed to map from JATS XML to Substance document nodes.

Write a converter test

It's important you test your converter throughly, otherwise content could be lost. The following examples can be used as a reference.

Defining a component

In order to make the content editable, you have to define components for each JATS element.