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 name | Type | Description |
---|---|---|
children | repeated BodyNode | Recursive/Nested structure that usually represents the textual body / Markup / HTML |
type | Type | Unique 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 value | Description |
---|---|
TYPE_UNSPECIFIED | unspecified |
BODY | The textual article body including all inline elements such as IMAGE , VIDEO and EMBED |
ARTICLE_SOURCES | A wrapper for all article sources ("Quellenaparat"). There can only be one of these per article. |
DISCLAIMER | A article disclaimer with important notes/legal stuff. E.g. "medizinischer Hinweis" on all medical articles |
TRUST_BOX | Includes information what the current article type is (e.g. opinion article). There can only be one of these per article. |
TABLE_OF_CONTENTS | Table 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;
Reference reference = 6;
}
Field name | Type | Description |
---|---|---|
type | string | Type of the node (required). |
text | string | Text of the node, only set for text nodes (type == 'text' ). |
fields | map<string, string> | Additional information for the node depending on it's type, e.g. href for a nodes. See fields |
children | repeated BodyNode | Nested Items, e.g. the text of a <p> or a <a> . |
elements | repeated Element | Elements of the node, e.g. video, image, gallery, embed, ... |
fields
HTML like
type | description |
---|---|
text | most 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] |
p | paragraph / <p> |
span | <span> |
sub_headline | a sub headline, may be part of the table of contents |
a | anchor / <a> , link target can be found in the repeated Reference[] structure |
strong | strong / <strong> |
em | emphasis / <em> |
sub | subscript / sub |
sup | superscript / sup |
hr | horizontal rule / <hr> |
br | line break / <br> |
ul | unordered list / <ul> |
ol | ordered list / <ol> |
li | list / <li> |
table | table / <table> |
thead | table head / <thead> |
tbody | table body / <tbody> |
tfoot | table footer / <tfoot> |
th | table header / <th> |
tr | table row / <tr> |
td | table data cell / <td> |
Custom
type | description |
---|---|
image | inline image element, check elements |
video | inline video element, check elements |
gallery | inline gallery element, check elements |
oembed | inline oEmbed element, check elements |
esi | inline edge side include element, check elements |
quote | inline quotation element, check elements |
infobox | inline box, consists of textual content in children and optional elements |
pros_and_cons | pros and cons box, consists of elements and structured text in children |
[~] |