From b0a6c472f881a3e0a7b61722fb6fddbcc39e5139 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 19 Dec 2015 21:15:43 -0800 Subject: Changed API for CUSTOM_BLOCK and CUSTOM_INLINE. Instead of using their `as.literal` content, we now give each custom node *two* literal fields, one to be printed on entering the node (before rendering the children, if any), the other on exiting (after rendering children). This gives us the flexibility to have custom nodes with children. --- man/man3/cmark.3 | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'man') diff --git a/man/man3/cmark.3 b/man/man3/cmark.3 index 2f79781..9754e78 100644 --- a/man/man3/cmark.3 +++ b/man/man3/cmark.3 @@ -112,8 +112,6 @@ are nodes of type: .IP \[bu] 2 CMARK_NODE_HTML .IP \[bu] 2 -CMARK_NODE_CUSTOM_BLOCK -.IP \[bu] 2 CMARK_NODE_HRULE .IP \[bu] 2 CMARK_NODE_CODE_BLOCK @@ -127,8 +125,6 @@ CMARK_NODE_LINEBREAK CMARK_NODE_CODE .IP \[bu] 2 CMARK_NODE_INLINE_HTML -.IP \[bu] 2 -CMARK_NODE_CUSTOM_INLINE .PP Nodes must only be modified after an \f[C]EXIT\f[] event, or an \f[C]ENTER\f[] event for leaf nodes. @@ -330,6 +326,36 @@ Gets the title of a link or image \f[I]node\f[], or NULL if none. Sets the title of a link or image \f[I]node\f[]. Returns 1 on success, 0 on failure. +.PP +\fIconst char *\f[] \fBcmark_node_get_on_enter\f[](\fIcmark_node *node\f[]) + +.PP +Gets the literal "on enter" text for a custom \f[I]node\f[], or NULL if +none. + +.PP +\fIint\f[] \fBcmark_node_set_on_enter\f[](\fIcmark_node *node\f[], \fIconst char *on_enter\f[]) + +.PP +Sets the literal text to render "on enter" for a custom \f[I]node\f[]. +Any children of the node will be rendered after this text. Returns 1 on +success 0 on failure. + +.PP +\fIconst char *\f[] \fBcmark_node_get_on_exit\f[](\fIcmark_node *node\f[]) + +.PP +Gets the literal "on exit" text for a custom \f[I]node\f[], or NULL if +none. + +.PP +\fIint\f[] \fBcmark_node_set_on_exit\f[](\fIcmark_node *node\f[], \fIconst char *on_exit\f[]) + +.PP +Sets the literal text to render "on exit" for a custom \f[I]node\f[]. +Any children of the node will be rendered before this text. Returns 1 on +success 0 on failure. + .PP \fIint\f[] \fBcmark_node_get_start_line\f[](\fIcmark_node *node\f[]) -- cgit v1.2.3