SnapdMarkdownNode

SnapdMarkdownNode — Snap markdown node

Functions

Properties

GPtrArray * children Read / Write / Construct Only
SnapdMarkdownNodeType node-type Read / Write / Construct Only
gchar * text Read / Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ╰── SnapdMarkdownNodeType
    GObject
    ╰── SnapdMarkdownNode

Includes

#include <snapd-glib/snapd-glib.h>

Description

A SnapdMarkdownNode represents a markdown node extracted from text. See SnapdMarkdownParser for more information.

Functions

snapd_markdown_node_get_node_type ()

SnapdMarkdownNodeType
snapd_markdown_node_get_node_type (SnapdMarkdownNode *node);

Get the type of node this is.

Parameters

node

a SnapdMarkdownNode.

 

Since: 1.48


snapd_markdown_node_get_text ()

const gchar *
snapd_markdown_node_get_text (SnapdMarkdownNode *node);

Gets the text associated with this node. This is only present for nodes of type SNAPD_MARKDOWN_NODE_TYPE_TEXT.

Parameters

node

a SnapdMarkdownNode.

 

Returns

a UTF-8 string or NULL if none in this node.

Since: 1.48


snapd_markdown_node_get_children ()

GPtrArray *
snapd_markdown_node_get_children (SnapdMarkdownNode *node);

Get the child nodes of this node.

Parameters

node

a SnapdMarkdownNode.

 

Returns

child nodes or NULL if none.

[transfer none][element-type SnapdMarkdownNode]

Since: 1.48

Types and Values

enum SnapdMarkdownNodeType

Type of markdown node.

Members

SNAPD_MARKDOWN_NODE_TYPE_TEXT

a piece of text.

 

SNAPD_MARKDOWN_NODE_TYPE_PARAGRAPH

a paragraph.

 

SNAPD_MARKDOWN_NODE_TYPE_UNORDERED_LIST

an unordered list.

 

SNAPD_MARKDOWN_NODE_TYPE_LIST_ITEM

a list item.

 

SNAPD_MARKDOWN_NODE_TYPE_CODE_BLOCK

a code block.

 

SNAPD_MARKDOWN_NODE_TYPE_CODE_SPAN

a code span.

 

SNAPD_MARKDOWN_NODE_TYPE_EMPHASIS

emphasised text.

 

SNAPD_MARKDOWN_NODE_TYPE_STRONG_EMPHASIS

strongly emphasised text.

 

SNAPD_MARKDOWN_NODE_TYPE_URL

a URL.

 

Since: 1.48


SnapdMarkdownNode

typedef struct _SnapdMarkdownNode SnapdMarkdownNode;

SnapdMarkdownNode is an opaque data structure and can only be accessed using the provided functions.

Since: 1.48

Property Details

The “children” property

  “children”                 GPtrArray *

Child nodes.

Flags: Read / Write / Construct Only


The “node-type” property

  “node-type”                SnapdMarkdownNodeType

Type of node.

Flags: Read / Write / Construct Only

Default value: SNAPD_MARKDOWN_NODE_TYPE_TEXT


The “text” property

  “text”                     gchar *

Text this node contains.

Flags: Read / Write / Construct Only

Default value: NULL