This is the cmark Reference Manual, version 0.5.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:46:12 2024 GMT+0.
cmark/cmark.asd
libcmark/libcmark.asd
cmark/src/cmark/package.lisp
cmark/src/cmark/conditions.lisp
cmark/src/cmark/node.lisp
cmark/src/cmark/iteration.lisp
cmark/src/cmark/tree-manipulation.lisp
cmark/src/cmark/tree-traversal.lisp
cmark/src/cmark/from-foreign.lisp
cmark/src/cmark/parsing.lisp
libcmark/src/libcmark/package.lisp
libcmark/src/libcmark/main.lisp
libcmark/src/libcmark/option.lisp
libcmark/src/libcmark/memory-allocator.lisp
libcmark/src/libcmark/node-constructor.lisp
libcmark/src/libcmark/tree-traversal.lisp
libcmark/src/libcmark/node-accessor.lisp
libcmark/src/libcmark/iterator.lisp
libcmark/src/libcmark/tree-manipulation.lisp
libcmark/src/libcmark/parsing.lisp
libcmark/src/libcmark/rendering.lisp
libcmark/src/libcmark/version.lisp
The main system appears first, followed by any subsystem dependency.
cmark
Common Lisp bindings to libcmark, the CommonMark reference implementation
HiPhish <hiphish@posteo.de>
BSD-2-Clause
0.5.2
libcmark
(system).
cffi
(system).
flexi-streams
(system).
src
(module).
libcmark
Common Lisp bindings to libcmark, the CommonMark reference implementation
HiPhish <hiphish@posteo.de>
BSD-2-Clause
0.5.2
cffi
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cmark/src/cmark
src
(module).
package.lisp
(file).
conditions.lisp
(file).
node.lisp
(file).
iteration.lisp
(file).
tree-manipulation.lisp
(file).
tree-traversal.lisp
(file).
from-foreign.lisp
(file).
parsing.lisp
(file).
libcmark/src/libcmark
src
(module).
package.lisp
(file).
main.lisp
(file).
option.lisp
(file).
memory-allocator.lisp
(file).
node-constructor.lisp
(file).
tree-traversal.lisp
(file).
node-accessor.lisp
(file).
iterator.lisp
(file).
tree-manipulation.lisp
(file).
parsing.lisp
(file).
rendering.lisp
(file).
version.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cmark/cmark.asd
libcmark/libcmark.asd
cmark/src/cmark/package.lisp
cmark/src/cmark/conditions.lisp
cmark/src/cmark/node.lisp
cmark/src/cmark/iteration.lisp
cmark/src/cmark/tree-manipulation.lisp
cmark/src/cmark/tree-traversal.lisp
cmark/src/cmark/from-foreign.lisp
cmark/src/cmark/parsing.lisp
libcmark/src/libcmark/package.lisp
libcmark/src/libcmark/main.lisp
libcmark/src/libcmark/option.lisp
libcmark/src/libcmark/memory-allocator.lisp
libcmark/src/libcmark/node-constructor.lisp
libcmark/src/libcmark/tree-traversal.lisp
libcmark/src/libcmark/node-accessor.lisp
libcmark/src/libcmark/iterator.lisp
libcmark/src/libcmark/tree-manipulation.lisp
libcmark/src/libcmark/parsing.lisp
libcmark/src/libcmark/rendering.lisp
libcmark/src/libcmark/version.lisp
cmark/src/cmark/conditions.lisp
cmark
(module).
parser-exhausted
(condition).
unexpected-orphan
(condition).
unexpected-parent
(condition).
cmark/src/cmark/node.lisp
cmark
(module).
block-node-p
(generic function).
block-quote-node
(class).
child-node
(class).
childlessp
(function).
code-block-node
(class).
code-node
(class).
custom-block-node
(class).
custom-inline-node
(class).
document-node
(class).
emph-node
(class).
heading-node
(class).
html-block-node
(class).
html-inline-node
(class).
image-node
(class).
inline-node-p
(generic function).
item-node
(class).
leaf-node-p
(generic function).
linebreak-node
(class).
link-node
(class).
list-node
(class).
node
(class).
node-children
(generic function).
node-heading-level
(reader method).
(setf node-heading-level)
(writer method).
node-list-delim
(reader method).
(setf node-list-delim)
(writer method).
node-list-start
(reader method).
(setf node-list-start)
(writer method).
node-list-type
(reader method).
(setf node-list-type)
(writer method).
node-literal
(reader method).
node-literal
(reader method).
node-literal
(reader method).
node-literal
(reader method).
node-literal
(reader method).
(setf node-literal)
(writer method).
(setf node-literal)
(writer method).
(setf node-literal)
(writer method).
(setf node-literal)
(writer method).
(setf node-literal)
(writer method).
node-parent
(generic function).
node-title
(reader method).
node-title
(reader method).
(setf node-title)
(writer method).
(setf node-title)
(writer method).
node-url
(reader method).
node-url
(reader method).
(setf node-url)
(writer method).
(setf node-url)
(writer method).
orphanp
(function).
paragraph-node
(class).
parent-node
(class).
softbreak-node
(class).
strong-node
(class).
text-node
(class).
thematic-break-node
(class).
block-node
(class).
inline-node
(class).
node-end-column
(reader method).
node-end-line
(reader method).
node-fence-info
(reader method).
(setf node-fence-info)
(writer method).
node-list-tight-p
(reader method).
(setf node-list-tight-p)
(writer method).
node-on-enter
(reader method).
node-on-enter
(reader method).
(setf node-on-enter)
(writer method).
(setf node-on-enter)
(writer method).
node-on-exit
(reader method).
node-on-exit
(reader method).
(setf node-on-exit)
(writer method).
(setf node-on-exit)
(writer method).
node-start-column
(reader method).
node-start-line
(reader method).
node-user-data
(reader method).
(setf node-user-data)
(writer method).
cmark/src/cmark/iteration.lisp
cmark
(module).
iterator-advance
(function).
iterator-reset
(function).
make-iterator
(function).
walk-tree
(function).
*non-exit-nodes*
(special variable).
copy-iterator
(function).
iterator
(structure).
iterator-event
(reader).
(setf iterator-event)
(writer).
iterator-node
(reader).
(setf iterator-node)
(writer).
iterator-p
(function).
iterator-root
(reader).
(setf iterator-root)
(writer).
node-event
(type).
cmark/src/cmark/tree-manipulation.lisp
cmark
(module).
append-child-node
(function).
consolidate-text-nodes
(function).
insert-node-after
(function).
insert-node-before
(function).
prepend-child-node
(function).
replace-node
(function).
unlink-node
(function).
insert-after
(function).
insert-before
(function).
insert-node
(function).
cmark/src/cmark/tree-traversal.lisp
cmark
(module).
node-first-child
(function).
node-last-child
(function).
node-next
(function).
node-next-sibling
(function).
node-previous
(function).
node-previous-sibling
(function).
which-child
(function).
cmark/src/cmark/from-foreign.lisp
cmark
(module).
*foreign/native-nodes*
(special variable).
*node-common-fields*
(special variable).
*node-type-to-class*
(special variable).
define-node-parser-method
(macro).
node-from-foreign
(function).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-node
(method).
parse-tree
(function).
thing-to-gensym
(function).
zip
(function).
cmark/src/cmark/parsing.lisp
cmark
(module).
close-streaming-parser
(function).
feed-streaming-parser
(function).
finish-streaming-parser
(function).
make-streaming-parser
(function).
parse-document
(function).
parse-stream
(function).
with-streaming-parser
(macro).
copy-streaming-parser
(function).
dump-tree
(function).
streaming-parser
(structure).
streaming-parser-exhausted-p
(reader).
(setf streaming-parser-exhausted-p)
(writer).
streaming-parser-foreign-parser
(reader).
(setf streaming-parser-foreign-parser)
(writer).
streaming-parser-p
(function).
string-octet-length
(function).
libcmark/src/libcmark/main.lisp
libcmark
(module).
markdown-to-html
(function).
libcmark/src/libcmark/option.lisp
libcmark
(module).
+cmark-opt-default+
(constant).
+cmark-opt-hardbreaks+
(constant).
+cmark-opt-nobreaks+
(constant).
+cmark-opt-normalize+
(constant).
+cmark-opt-safe+
(constant).
+cmark-opt-smart+
(constant).
+cmark-opt-sourcepos+
(constant).
+cmark-opt-unsafe+
(constant).
+cmark-opt-validate-utf8+
(constant).
libcmark/src/libcmark/memory-allocator.lisp
libcmark
(module).
default-mem-allocator
(function).
cmark-mem-tclass
(class).
libcmark/src/libcmark/node-constructor.lisp
libcmark
(module).
free-node
(function).
make-node
(function).
make-node-with-mem
(function).
libcmark/src/libcmark/tree-traversal.lisp
libcmark
(module).
node-first-child
(function).
node-last-child
(function).
node-next
(function).
node-parent
(function).
node-previous
(function).
libcmark/src/libcmark/node-accessor.lisp
libcmark
(module).
node-get-end-column
(function).
node-get-end-line
(function).
node-get-fence-info
(function).
node-get-heading-level
(function).
node-get-list-delim
(function).
node-get-list-start
(function).
node-get-list-tight
(function).
node-get-list-type
(function).
node-get-literal
(function).
node-get-on-enter
(function).
node-get-on-exit
(function).
node-get-start-column
(function).
node-get-start-line
(function).
node-get-title
(function).
node-get-type
(function).
node-get-type-string
(function).
node-get-url
(function).
node-get-user-data
(function).
node-set-fence-info
(function).
node-set-heading-level
(function).
node-set-list-delim
(function).
node-set-list-start
(function).
node-set-list-tight
(function).
node-set-list-type
(function).
node-set-literal
(function).
node-set-on-enter
(function).
node-set-on-exit
(function).
node-set-title
(function).
node-set-url
(function).
node-set-user-data
(function).
libcmark/src/libcmark/iterator.lisp
libcmark
(module).
free-iterator
(function).
iterator-get-event-type
(function).
iterator-get-node
(function).
iterator-get-root
(function).
iterator-next
(function).
iterator-reset
(function).
make-iterator
(function).
libcmark/src/libcmark/tree-manipulation.lisp
libcmark
(module).
consolidate-text-nodes
(function).
node-append-child
(function).
node-insert-after
(function).
node-insert-before
(function).
node-prepend-child
(function).
node-replace
(function).
node-unlink
(function).
libcmark/src/libcmark/parsing.lisp
libcmark
(module).
free-parser
(function).
make-parser
(function).
make-parser-with-mem
(function).
parse-document
(function).
parse-file
(function).
parser-feed
(function).
parser-finish
(function).
libcmark/src/libcmark/rendering.lisp
libcmark
(module).
render-commonmark
(function).
render-html
(function).
render-latex
(function).
render-man
(function).
render-xml
(function).
libcmark/src/libcmark/version.lisp
libcmark
(module).
version
(function).
version-string
(function).
Packages are listed by definition order.
libcmark
Low-level Common Lisp bindings to the libcmark C library.
This system is mostly a 1:1 translation from the C API to Common Lisp. See the cmark(3) man page for comparison. Using this system requires knowledge of how the CFFI system (‘cffi’ package) works and how it handles data types.
cffi
.
common-lisp
.
+cmark-opt-default+
(constant).
+cmark-opt-hardbreaks+
(constant).
+cmark-opt-nobreaks+
(constant).
+cmark-opt-normalize+
(constant).
+cmark-opt-safe+
(constant).
+cmark-opt-smart+
(constant).
+cmark-opt-sourcepos+
(constant).
+cmark-opt-unsafe+
(constant).
+cmark-opt-validate-utf8+
(constant).
consolidate-text-nodes
(function).
default-mem-allocator
(function).
free-iterator
(function).
free-node
(function).
free-parser
(function).
iterator-get-event-type
(function).
iterator-get-node
(function).
iterator-get-root
(function).
iterator-next
(function).
iterator-reset
(function).
make-iterator
(function).
make-node
(function).
make-node-with-mem
(function).
make-parser
(function).
make-parser-with-mem
(function).
markdown-to-html
(function).
node-append-child
(function).
node-first-child
(function).
node-get-end-column
(function).
node-get-end-line
(function).
node-get-fence-info
(function).
node-get-heading-level
(function).
node-get-list-delim
(function).
node-get-list-start
(function).
node-get-list-tight
(function).
node-get-list-type
(function).
node-get-literal
(function).
node-get-on-enter
(function).
node-get-on-exit
(function).
node-get-start-column
(function).
node-get-start-line
(function).
node-get-title
(function).
node-get-type
(function).
node-get-type-string
(function).
node-get-url
(function).
node-get-user-data
(function).
node-insert-after
(function).
node-insert-before
(function).
node-last-child
(function).
node-next
(function).
node-parent
(function).
node-prepend-child
(function).
node-previous
(function).
node-replace
(function).
node-set-fence-info
(function).
node-set-heading-level
(function).
node-set-list-delim
(function).
node-set-list-start
(function).
node-set-list-tight
(function).
node-set-list-type
(function).
node-set-literal
(function).
node-set-on-enter
(function).
node-set-on-exit
(function).
node-set-title
(function).
node-set-url
(function).
node-set-user-data
(function).
node-unlink
(function).
parse-document
(function).
parse-file
(function).
parser-feed
(function).
parser-finish
(function).
render-commonmark
(function).
render-html
(function).
render-latex
(function).
render-man
(function).
render-xml
(function).
version
(function).
version-string
(function).
cmark-mem-tclass
(class).
cmark
High-level interface to libcmark
The CMARK system provides all the essential classes, functions and methods to
parse a CommonMark document into a tree of nodes, manipulate the tree, and
parse it. This package is the public interface of the CMARK system.
For a more low-level interface to libcmark use the ‘LIBCMARK’ system, which is a thin set of bindings from C to Common Lisp.
common-lisp
.
append-child-node
(function).
block-node-p
(generic function).
block-quote-node
(class).
child-node
(class).
childlessp
(function).
close-streaming-parser
(function).
code-block-node
(class).
code-node
(class).
consolidate-text-nodes
(function).
custom-block-node
(class).
custom-inline-node
(class).
document-node
(class).
emph-node
(class).
feed-streaming-parser
(function).
finish-streaming-parser
(function).
heading-node
(class).
html-block-node
(class).
html-inline-node
(class).
image-node
(class).
inline-node-p
(generic function).
insert-node-after
(function).
insert-node-before
(function).
item-node
(class).
iterator-advance
(function).
iterator-reset
(function).
leaf-node-p
(generic function).
linebreak-node
(class).
link-node
(class).
list-node
(class).
make-iterator
(function).
make-streaming-parser
(function).
node
(class).
node-children
(generic function).
node-first-child
(function).
node-heading-level
(generic reader).
(setf node-heading-level)
(generic writer).
node-last-child
(function).
node-list-delim
(generic reader).
(setf node-list-delim)
(generic writer).
node-list-start
(generic reader).
(setf node-list-start)
(generic writer).
node-list-type
(generic reader).
(setf node-list-type)
(generic writer).
node-literal
(generic reader).
(setf node-literal)
(generic writer).
node-next
(function).
node-next-sibling
(function).
node-parent
(generic function).
node-previous
(function).
node-previous-sibling
(function).
node-title
(generic reader).
(setf node-title)
(generic writer).
node-url
(generic reader).
(setf node-url)
(generic writer).
orphanp
(function).
paragraph-node
(class).
parent-node
(class).
parse-document
(function).
parse-stream
(function).
parser-exhausted
(condition).
prepend-child-node
(function).
replace-node
(function).
softbreak-node
(class).
strong-node
(class).
text-node
(class).
thematic-break-node
(class).
unexpected-orphan
(condition).
unexpected-parent
(condition).
unlink-node
(function).
walk-tree
(function).
which-child
(function).
with-streaming-parser
(macro).
*foreign/native-nodes*
(special variable).
*node-common-fields*
(special variable).
*node-type-to-class*
(special variable).
*non-exit-nodes*
(special variable).
block-node
(class).
copy-iterator
(function).
copy-streaming-parser
(function).
define-node-parser-method
(macro).
dump-tree
(function).
inline-node
(class).
insert-after
(function).
insert-before
(function).
insert-node
(function).
iterator
(structure).
iterator-event
(reader).
(setf iterator-event)
(writer).
iterator-node
(reader).
(setf iterator-node)
(writer).
iterator-p
(function).
iterator-root
(reader).
(setf iterator-root)
(writer).
node-end-column
(generic reader).
node-end-line
(generic reader).
node-event
(type).
node-fence-info
(generic reader).
(setf node-fence-info)
(generic writer).
node-from-foreign
(function).
node-list-tight-p
(generic reader).
(setf node-list-tight-p)
(generic writer).
node-on-enter
(generic reader).
(setf node-on-enter)
(generic writer).
node-on-exit
(generic reader).
(setf node-on-exit)
(generic writer).
node-start-column
(generic reader).
node-start-line
(generic reader).
node-user-data
(generic reader).
(setf node-user-data)
(generic writer).
parse-node
(generic function).
parse-tree
(function).
streaming-parser
(structure).
streaming-parser-exhausted-p
(reader).
(setf streaming-parser-exhausted-p)
(writer).
streaming-parser-foreign-parser
(reader).
(setf streaming-parser-foreign-parser)
(writer).
streaming-parser-p
(function).
string-octet-length
(function).
thing-to-gensym
(function).
zip
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Default options.
Render softbreak elements as hard line breaks.
Render softbreak elements as spaces.
Legacy option (no effect).
+CMARK-OPT-SAFE+ is defined here for API compatibility, but it no longer has any effect. "Safe" mode is now the default: set +CMARK-OPT-UNSAFE+ to disable it.
Convert straight quotes to curly, — to em dashes, – to en dashes.
Include a data-sourcepos attribute on all block elements.
Render raw HTML and unsafe links (javascript:, vbscript:, file:, and data:, except for image/png, image/gif, image/jpeg, or image/webp mime types). By default, raw HTML is replaced by a placeholder HTML comment. Unsafe links are replaced by empty strings.
Validate UTF-8 in the input before parsing, replacing illegal sequences with the replacement character U+FFFD.
Evaluate the BODY forms with PARSER bound to a new streaming parser instance. The parser will be safely closed and disposed of when the form terminates. Evaluates to the last BODY expression.
Append CHILD as the last child node of NODE. It is an error to append a node
which is already a child of a node, signals UNEXPECTED-PARENT The following
restarts are provided:
- DETACH-FROM-PARENT:
Detaches CHILD from its parent and thus from its original tree, then
resumes the function.
Closes the streaming PARSER, rendering it exhausted. Any internal state of the parser will be discarded. This function is idempotent: if the parser is already closed nothing will happen.
Consolidates adjacent text nodes.
Consolidates adjacent text nodes in the tree starting at ROOT. Adjacent nodes of type TEXT-NODE will be merged into one by concatenating their literal text. Only one node will remain in the tree, the other nodes will become orphaned. It is undefined which node will remain in the tree.
Returns a pointer to the default memory allocator.
Feed a STRING into the streaming PARSER. It is an error to feed a closed parser, signals PARSER-EXHAUSTED.
Returns the parsed node tree. Does not exhaust the parser, feeding the parser or finishing it again is not an error. It is an error to finish a closed parser, signals PARSER-EXHAUSTED.
Frees the memory allocated for an iterator.
Frees the memory allocated for a node and any children.
Frees memory allocated for a parser object.
Inserts SIBLING into the tree in front of NODE. It is an error to insert
after an orphan (signals UNEXPECTED-ORPHAN), or to insert a node which is already
a child (signals UNEXPECTED-PARENT).
Inserts SIBLING into the tree in front of NODE. It is an error to insert
before an orphan (signals UNEXPECTED-ORPHAN), or to insert a node which is already
a child (signals UNEXPECTED-PARENT).
Advances the ITERATOR to the next node/event combination. If the iterator is exhausted nothing will happen. Returns the new node and event.
Returns the current event type.
Returns the current node.
Returns the root node.
Advances to the next node and returns the event type (CMARK_EVENT_ENTER, CMARK_EVENT_EXIT or CMARK_EVENT_DONE).
Resets the ITERATOR so that the current node is CURRENT-NODE and the event type is EVENT-TYPE. The new current node must be a descendant of the root node or the root node itself.
Reset the ITERATOR so that the current node node is CURRENT and the event type is EVENT-TYPE. The new current node must be a descendant of the root node or the root node itself.
Creates a new iterator starting at ROOT. The current node and event type are undefined until ITER-NEXT is called for the first time. The memory allocated for the iterator should be released using FREE-ITERATOR when it is no longer needed.
Creates a new node of type TYPE. Note that the node may have other required properties, which it is the caller’s responsibility to assign.
Same as MAKE-NODE, but explicitly listing the memory allocator used to allocate the node. Note: be sure to use the same allocator for every node in a tree, or bad things can happen.
Creates a new parser object.
Creates a new parser object with the given MEMory allocator
Creates a new streaming parser object. A streaming parser can be fed the CommonMark document piecewise, then once the entire document has been fed to it the parser can be finished, which produces the document node tree. It is the caller’s responsibility to close the stream.
Convert TEXT (assumed to be a UTF-8 encoded string with length LEN) from CommonMark Markdown to HTML, returning a null-terminated, UTF-8-encoded string. It is the caller’s responsibility to free the returned buffer.
Adds CHILD to the end of the children of NODE. Returns 1 on success, 0 on failure.
Returns the first child of node, or NULL if node has no children.
Returns the first child of NODE, or NIL if NODE has no children.
Returns the column at which NODE ends.
Returns the line on which NODE ends.
Returns the info string from a fenced code block.
Returns the heading level of NODE, or 0 if node is not a heading.
Returns the list delimiter type of NODE, or CMARK-NO-DELIM if node is not a list.
Returns starting number of NODE, if it is an ordered list, otherwise 0.
Returns 1 if NODE is a tight list, 0 otherwise.
Returns the list type of NODE, or :CMARK_NO_LIST if node is not a list.
Returns the string contents of NODE, or an empty string if none is set. Returns NULL if called on a node that does not have string content.
Returns the literal "on enter" text for a custom NODE, or an empty string if no on_enter is set. Returns NULL if called on a non-custom node.
Returns the literal "on exit" text for a custom node, or an empty string if no on_exit is set. Returns NULL if called on a non-custom node.
Returns the column at which NODE begins.
Returns the line on which NODE begins.
Returns the title of a link or image NODE, or an empty string if no title is set. Returns NULL if called on a node that is not a link or image.
Returns the type of node, or CMARK_NODE_NONE on error.
Like NODE-GET-TYPE, but returns a string representation of the type, or "<unknown>".
Returns the URL of a link or image NODE, or an empty string if no URL is set. Returns NULL if called on a node that is not a link or image.
Returns the user data of node.
Inserts sibling after NODE. Returns 1 on success, 0 on failure.
Inserts sibling before NODE. Returns 1 on success, 0 on failure.
Returns the last child of node, or NULL if node has no children.
Returns the last child of NODE, or NIL if NODE has no children.
Returns the next node in the sequence after node, or NULL if there is none.
Returns the next NODE in the tree, or NIL if there is none. The nodes are traversed in a depth-first manner. The CHILD parameter determines into which child node to descend.
Returns the next sibling NODE, or NIL if NODE is the last child.
Returns the parent of node, or NULL if there is none.
Adds CHILD to the beginning of the children of NODE. Returns 1 on success, 0 on failure.
Returns the previous node in the sequence after node, or NULL if there is none.
Returns the previous NODE in the sequence after NODE, or NIL if there is none.
Returns the next sibling NODE, or NIL if NODE is the last child.
Replaces OLD-NODE with NEW-NODE and unlinks oldnode (but does not free its memory). Returns 1 on success, 0 on failure.
Sets the info string in a fenced code block, returning 1 on success and ; 0 on failure.
Sets the heading LEVEL of NODE, returning 1 on success and 0 on error.
Sets the list delimiter TYPE of NODE, returning 1 on success and 0 on error.
Sets STARTing number of NODE, if it is an ordered list. Returns 1 on success, 0 on failure.
Sets the "TIGHTness" of a list. Returns 1 on success, 0 on failure.
Sets the list type of node, returning 1 on success and 0 on error.
Sets the string CONTENTS of NODE. Returns 1 on success, 0 on failure.
Sets the literal text to render ON-ENTER for a custom NODE. Any children of the node will be rendered after this text. Returns 1 on success 0 on failure.
Sets the literal text to render ON-EXIT for a custom NODE. Any children of the node will be rendered before this text. Returns 1 on success 0 on failure.
Sets the TITLE of a link or image NODE. Returns 1 on success, 0 on failure.
Sets the URL of a link or image NODE. Returns 1 on success, 0 on failure.
Sets arbitrary user data for node. Returns 1 on success, 0 on failure.
Unlinks a NODE, removing it from the tree, but not freeing its memory. (Use FREE-NODE for that.)
Whether NODE is an orphan, meaning it has no parent node.
Parse a CommonMark document in BUFFER of length LEN. Returns a pointer to a tree of nodes. The memory allocated for the node tree should be released using cmark_node_free when it is no longer needed.
Parses a CommonMark DOOCUMENT string and returns the root node of the parsed document tree.
Parse a CommonMark document in file FILE, returning a pointer to a tree of nodes. The memory allocated for the node tree should be released using cmark_node_free when it is no longer needed.
Parses an input stream stream until the end of the stream is encountered, returns the root node of the parsed document tree. The optional :BUFFER-SIZE parameter determines how many characters are read at a time.
Feeds a STRING of length LEN to parser.
Finish parsing and return a pointer to a tree of nodes.
Insert CHILD as the first child node of NODE. It is an error to prepend a
node which is already a child of a node, signals UNEXPECTED-PARENT The
following restarts are provided:
- DETACH-FROM-PARENT:
Detaches CHILD from its parent and thus from its original tree, then
resumes the function.
Render a node tree as a commonmark document. It is the caller’s responsibility to free the returned buffer.
Render a node tree as an HTML fragment. It is up to the user to add an appropriate header and footer. It is the caller’s responsibility to free the returned buffer.
Render a node tree as a LaTeX document. It is the caller’s responsibility to free the returned buffer.
Render a node tree as a groff man page, without the header. It is the caller’s responsibility to free the returned buffer.
Render a node tree as XML. It is the caller’s responsibility to free the returned buffer.
Replaces OLD-NODE with NEW-NODE and unlinks OLD-NODE from the tree.
Unlinks a NODE from its parent, removing it from the node tree. Returns the node. The function is idempotent, i.e. unlinking a node without parent does nothing.
The library version as integer for runtime checks.
• Bits 16-23 contain the major version.
• Bits 8-15 contain the minor version.
• Bits 0-7 contain the patchlevel.
In hexadecimal format, the number 0x010203 represents version 1.2.3.
The library version string for runtime checks.
Iterate through the (sub)tree at NODE, calling CALLBACK at every event. The
callback is a function which takes two arguments, the current node and the
event type. Its return value is ignored.
Usually the callback would be a generic function that can dispatch on the class of node and type of event, but this is just a suggestion, not a requirement.
Position of NODE among its siblings, or NIL if NODE is an orphan.
Whether a node is a block-level node (as opposed to an inline node).
Whether a node is an inline node (as opposed to a block-level node).
Whether a node is a leaf-type node or not.
List of children of a NODE.
heading-node
)) ¶heading-node
)) ¶Level of the heading
html-inline-node
)) ¶html-inline-node
)) ¶Text of the node (might be empty).
code-node
)) ¶code-node
)) ¶Text of the node (might be empty).
text-node
)) ¶text-node
)) ¶Text of the node (might be empty).
html-block-node
)) ¶html-block-node
)) ¶Text of the node (might be empty).
code-block-node
)) ¶code-block-node
)) ¶Text of the node (might be empty).
Parent node of NODE, or NIL if there is none.
image-node
)) ¶image-node
)) ¶Title of the node (empty if there is no title)
image-node
)) ¶image-node
)) ¶URL of an image node
Trying to manipulate an exhausted streaming parser.
Orphan node in a context where a child node is expected.
simple-error
.
The node in question
:node
Child node in a context where a orphan node is expected.
simple-error
.
The node in question
:node
Represents a block quotation.
A node which can have a parent node.
A block of code to present verbatim.
Inline verbatim code.
Text of the node (might be empty).
(or string null)
:literal
A user-defined node which produces custom text.
A user-defined node which produces custom text.
Root node of the entire document.
Container for emphatic text.
A heading with variable level.
Level of the heading
(integer 1 6)
:level
Block-level embedded HTML code.
Text of the node (might be empty).
(or string null)
:literal
Inline embedded HTML code.
Text of the node (might be empty).
(or string null)
:literal
Hyperlink with target URL and alt-text.
Represents an item inside a list (bullet or unordered).
A hard line break which does not terminate the current block level element.
Hyperlink with target URL and title.
A list node, it can be either an unordered list (:BULLET-LIST) or an :ORDERED-LIST.
The type of list
common-lisp
.
(member :cmark-bullet-list :cmark-ordered-list)
:type
The delimiter type of the list
(member :period :paren)
:delim
Starting number of the node (zero for unordered lists)
(integer 0 *)
:start
Whether the node is a tight list
boolean
:tightp
Base class of all cmark nodes.
User data of the node
integer
:user-data
Line at which the node begins
(integer 0 *)
:start-line
This slot is read-only.
Column at which the node begins
(integer 0 *)
:start-column
This slot is read-only.
Line at which the node ends
(integer 0 *)
:end-line
This slot is read-only.
Column at which the node ends
(integer 0 *)
:end-column
This slot is read-only.
A paragraph of the document.
A node which can have child nodes.
A line break which may be rendered differently depending on the rendering options.
Container for strong text.
Plain text content.
Text of the node (might be empty).
(or string null)
:literal
Represents a thematic break within the content of the document.
Mapping of foreign node memory pointer to a native node. Bind this variable to a hash table while translating foreign nodes to native ones; as a new native node is constructed add an entry, later nodes can then refer to it, e.g. to get a reference to their native parent based on their foreign parent.
List of (FOREIGN-GETTER . NATIVE-INITARG) pairs for all common node fields.
Maps the node type symbol from libcmark to a native node class name its slots. Each slot is (FOREIGN-GETTER . NATIVE-INITARG) pair.
List of node classes for which no EXIT event will be generated.
Defines a method specialised for parsing a foreign node into a native node based on its TYPE. All the slots, except PARENT and CHILDREN, are initialised based by getting the value from the foreign node.
Dumps a string of the node tree.
Helper function, returns LIST with ELEMENT inserted after element at position I. Destructive towards LIST!
Helper function, returns LIST with ELEMENT inserted before element at position I. Destructive towards LIST!
Helper function, inserts SIBLING before or after NODE, depending on the METHOD.
node
.
root
.
Helper function, translates one FOREIGN node to a native one. Establishes parent/child relationship.
Parses the entire FOREIGN tree into a native tree.
Helper function, returns the length of STRING in UTF-8 encoded bytes
Helper function, ignores its argument and generates an uninterned symbol.
Helper function, zips two lists into one flat list.
code-block-node
)) ¶code-block-node
)) ¶Info string from a fenced code block
custom-inline-node
)) ¶custom-inline-node
)) ¶Literal text to render on entering a custom node
custom-block-node
)) ¶custom-block-node
)) ¶Literal text to render on entering a custom node
custom-inline-node
)) ¶custom-inline-node
)) ¶Literal text to render on exiting a custom node
custom-block-node
)) ¶custom-block-node
)) ¶Literal text to render on exiting a custom node
(eql :cmark-node-image)
)) ¶(eql :cmark-node-link)
)) ¶(eql :cmark-node-strong)
)) ¶(eql :cmark-node-emph)
)) ¶(eql :cmark-node-custom-inline)
)) ¶(eql :cmark-node-html-inline)
)) ¶(eql :cmark-node-code)
)) ¶(eql :cmark-node-linebreak)
)) ¶(eql :cmark-node-softbreak)
)) ¶(eql :cmark-node-text)
)) ¶(eql :cmark-node-thematic-break)
)) ¶(eql :cmark-node-heading)
)) ¶(eql :cmark-node-paragraph)
)) ¶(eql :cmark-node-custom-block)
)) ¶(eql :cmark-node-html-block)
)) ¶(eql :cmark-node-code-block)
)) ¶(eql :cmark-node-item)
)) ¶(eql :cmark-node-list)
)) ¶(eql :cmark-node-block-quote)
)) ¶(eql :cmark-node-document)
)) ¶An iterator will walk through a tree of nodes, starting from a ROOT node,
returning one node at a time, together with information about whether the
node is being entered or exited.
The iterator is an opaque object, we cannot inspect its state. Instead we need to use the return values of ITERATOR-ADVANCE to get the next pair of node and event.
A mixin class which marks block-level nodes.
foreign-struct-type
.
translatable-foreign-type
.
A mixin class which marks inline nodes.
Jump to: | (
A B C D F G I L M N O P R S T U V W Z |
---|
Jump to: | (
A B C D F G I L M N O P R S T U V W Z |
---|
Jump to: | *
+
C D E F L N O P R S T U |
---|
Jump to: | *
+
C D E F L N O P R S T U |
---|
Jump to: | B C D E F H I L M N O P R S T U V |
---|
Jump to: | B C D E F H I L M N O P R S T U V |
---|