Article ۰ Body

The Body represents a basic block. Each Body is self-contained and holds all the data required for rendering within its data structures.

Common use cases for this are Type.BODY where the textual article body can be found and the TYPE.ARTICLE_SOURCE where onward articles are referenced.

Field nameTypeDescription
childrenrepeated BodyNodeRecursive/Nested structure that usually represents the textual body / Markup / HTML
typeTypeUnique ID of the article defined by the content management system (required).
message Body {
repeated BodyNode children = 1;
Type type = 2;

[~]

Type

Each Body has a Body.Type to help the consumer to correctly interpret the BodyNode's content.

Enum valueDescription
TYPE_UNSPECIFIEDunspecified
BODYThe textual article body including all inline elements such as IMAGE, VIDEO and EMBED
ARTICLE_SOURCESA wrapper for all article sources ("Quellenaparat"). There can only be one of these per article.
DISCLAIMERA article disclaimer with important notes/legal stuff. E.g. "medizinischer Hinweis" on all medical articles
TRUST_BOXIncludes information what the current article type is (e.g. opinion article). There can only be one of these per article.
TABLE_OF_CONTENTSTable of contents for this article, consists of anchors which refer to sub headlines within the BODY
enum Type {
TYPE_UNSPECIFIED = 0;
BODY = 1;
ARTICLE_SOURCES = 2;
DISCLAIMER = 3;
TRUST_BOX = 4;
TABLE_OF_CONTENTS = 5;
}

[~]

BodyNode

Recursive structure representing all types of possible nodes inside an article.

One use-case is to represent HTML-like markup in tapir, but it is also used to map custom elements that require a strict positional placement within the textual body. Things that are not part of the textual article body are represented as individual Body parts so they can be rendered independently if required.

Clients must be resilient to unknown or missing nodes.

message BodyNode {
string type = 1;
string text = 2;
map<string, string> fields = 3;
repeated BodyNode children = 4;
repeated Element elements = 5;
}

[~]

Field nameTypeDescription
typestringType of the node (required).
textstringText of the node, only set for text nodes (type == 'text').
fieldsmap<string, string>Additional information for the node depending on it's type, e.g. href for a nodes. See fields
childrenrepeated BodyNodeNested Items, e.g. the text of a <p> or a <a>.
elementsrepeated ElementElements of the node, e.g. video, image, gallery, embed, ...

fields

HTML like

typedescription
textmost basic type, its text value can be found in the text field. The word_count can be found in the BodyNode.fields for each BodyNode[type=text]
pparagraph / <p>
span<span>
sub_headlinea sub headline, may be part of the table of contents
aanchor / <a>
strongstrong / <strong>
ememphasis / <em>
subsubscript / sub
supsuperscript / sup
hrhorizontal rule / <hr>
brline break / <br>
ulunordered list / <ul>
olordered list / <ol>
lilist / <li>
tabletable / <table>
theadtable head / <thead>
tbodytable body / <tbody>
tfoottable footer / <tfoot>
thtable header / <th>
trtable row / <tr>
tdtable data cell / <td>

Custom

typedescription
imageinline image element, check elements
videoinline video element, check elements
galleryinline gallery element, check elements
oembedinline oEmbed element, check elements
esiinline edge side include element, check elements
quoteinline quotation element, check elements
infoboxinline box, consists of textual content in children and optional elements
pros_and_conspros and cons box, consists of elements and structured text in children
[~]

[~]