Document EditingType Definitions

Type Definitions

This section details all data types and structural definitions utilized within the Article Editing API.

ArticleGroup

Document group object, used to describe each group in the document list:

  • Name
    group_id
    Type
    number
    Required
    Required
    Description
    Unique identifier of the group.
  • Name
    name
    Type
    string
    Required
    Required
    Description
    Group name.
  • Name
    isCreator
    Type
    boolean
    Required
    Required
    Description
    Whether the current user is the creator.
  • Name
    articles
    Type
    ArticleNode[]
    Required
    Required
    Description
    List of documents under this group.
  • Name
    time_create
    Type
    number
    Required
    Required
    Description
    Group creation timestamp.

ArticleNode

Document object, used to describe each document entry in the document list:

  • Name
    outer_id
    Type
    string
    Required
    Required
    Description
    Unique document identifier, used as docId when creating a session.
  • Name
    name
    Type
    string
    Required
    Required
    Description
    Document name.
  • Name
    group
    Type
    number
    Required
    Required
    Description
    Group ID the document belongs to. 0 means private article.
  • Name
    sharePermission
    Type
    SharePermission
    Required
    Required
    Description
    Share permission configuration. Modification is not currently supported.
  • Name
    children
    Type
    ArticleNode[]
    Required
    Required
    Description
    List of child documents. Currently supports a maximum of 2 levels of nesting.
  • Name
    fileholderDeep
    Type
    number
    Required
    Required
    Description
    Document hierarchy depth. 0 means top-level document.
  • Name
    time_create
    Type
    number
    Required
    Required
    Description
    Creation timestamp (Unix timestamp in seconds).
  • Name
    collectionArticle
    Type
    CollectionArticle
    Optional
    Optional
    Description
    Collection link information for the article. Only present when the article is a collection source. Modification is not currently supported.

TextLeaf

Text node type, used for the children field of ElementBlock:

type TextLeaf = FormattedText | LatexText | CodeText | UrlText
FormattedText: Plain text, supports bold, italic, underline, strikethrough, color, and other attributes.
LatexText: Inline formula.
CodeText: Inline code.
UrlText: Hyperlink.

ElementBlock

Document content block type, the type of the blocks field:

type ElementBlock =
  | TitleElement
  | AuthorElement
  | AbstractElement
  | ParagraphElement
  | EquationElement
  | H1Element
  | H2Element
  | H3Element
  | ImageElement
  | TableElement
  | CodeElement
  | LabelElement
  | ListElement

All ElementBlocks contain id, type, children, and style fields.

TitleElement: Title node
AuthorElement: Author node
Author: Author object
Institution: Institution object
AbstractElement: Abstract node
ParagraphElement: Paragraph node
EquationElement: Equation node
H1Element: Heading 1 node
H2Element: Heading 2 node
H3Element: Heading 3 node
ImageElement: Image node
Image: Image object
TableElement: Table node
TableRowElement: Table row object
TableCellElement: Table cell object
CodeElement: Code block node
LabelElement: Label node
LabelItemElement: Label item object
ListElement: List node
ListItemElement: List item object

ElementBlockSummary

Document content block summary, used to quickly display the basic information of an ElementBlock and its actual rendered Markdown content.

ElementStyle

Style types corresponding to ElementBlock:

type ElementStyle =
  | TitleElementStyle
  | AuthorElementStyle
  | AbstractElementStyle
  | ParagraphElementStyle
  | EquationElementStyle
  | H1ElementStyle
  | H2ElementStyle
  | H3ElementStyle
  | ImageElementStyle
  | TableElementStyle
  | CodeElementStyle
  | LabelElementStyle
  | ListElementStyle
TitleElementStyle: Title style
AuthorElementStyle: Author container style
AbstractElementStyle: Abstract style
ParagraphElementStyle: Paragraph style
EquationElementStyle: Equation style
H1ElementStyle / H2ElementStyle / H3ElementStyle: Heading styles

Using H1ElementStyle as an example; H2ElementStyle and H3ElementStyle have the same structure:

ImageElementStyle: Image style
TableElementStyle: Table style
CodeElementStyle: Code block style
LabelElementStyle: Label style
ListElementStyle: List style

Display Style Definitions

TitleElementCssStyle: Title container display style
AuthorElementCssStyle: Author container display style
AuthorElementAuthorCssStyle: Author name display style
AuthorElementInstitutionCssStyle: Institution display style
AbstractElementCssStyle: Abstract display style
ParagraphElementCssStyle: Paragraph display style
EquationElementCssStyle: Equation display style
H1ElementCssStyle / H2ElementCssStyle / H3ElementCssStyle: Heading display styles
ImageElementCssStyle: Image display style
TableElementCssStyle: Table display style
CodeElementCssStyle: Code block display style
LabelElementCssStyle: Label display style
ListElementCssStyle: List display style

ArticleReference: Reference object

ArticleStyle: Global style
GlobalStyle: Global configuration

Style Calculation Rules

The final display style of an element is determined by merging global and local styles:

ConditionResult
isTemplate == trueUse component style, global style is ignored
Component style property value is nullUse corresponding global style property
Other casesUse component style

Was this page helpful?