summaryrefslogtreecommitdiff
path: root/src/cmark.h
AgeCommit message (Collapse)Author
2015-01-09Minor code reformatting.John MacFarlane
2015-01-08Added `cmark_iter_reset` and a note about handling destructive updates.John MacFarlane
2015-01-07cmark: Add function & option to normalize text nodes.John MacFarlane
So, instead of <text>Hi</text> <text>&amp;</text> <text>lo</text> we get <text>Hi&amp;lo</text> * Added exported `cmark_consolidate_text_nodes` function. * Added `CMARK_OPT_NORMALIZE` to options. * Added optional normalization in XML writer. * Added `--normalize` option to command-line program. * Updated man page.
2015-01-05Reformatted code consistently with astyle.John MacFarlane
2014-12-29Added options parameter to renderers.John MacFarlane
To keep the API simple and avoid API changes when new options are added, this is just a long integer. Set it by disjoining options that are defined as powers of 2: e.g. `CMARK_HTML_SOURCEPOS | CMARK_HTML_HARDREAKS`. Test options using `&`: `if (options & CMARK_HTML_SOURCEPOS)`. Added `--hardbreaks` and `--sourcepos` command-line options.
2014-12-28Added cmark_node_set_list_delim, cmark_node_get_list_delim.John MacFarlane
Even though this doesn't make a difference in default HTML output, it's worth keeping track; some output formats may allow you to distinguish lists with `1)` and with `1.` delimiters.
2014-12-28Added CMARK_NO_DELIM to cmark_delim_typeJohn MacFarlane
2014-12-28Removed old 'ast' format, now that we have 'xml'.John MacFarlane
The xml representation of the AST is not quite as pretty, but it contains the same information and is not in an ad hoc format. See #53.
2014-12-28Added end_column to cmark_node struct.John MacFarlane
API exports cmark_node_get_column. XML writer indicates start and end line and column for block-level nodes.
2014-12-28Rename CMARK_NODE_LIST_ITEM -> CMARK_NODE_ITEM.John MacFarlane
2014-12-28Rename cmark_node_type_string -> cmark_node_get_type_string.John MacFarlane
And export in cmark.h public header. Also, use lowercase names, not uppercase.
2014-12-28Added xml writer, to dump the AST in XML.John MacFarlane
This is a work-in-progress. CommonMark.dtd gives the DTD for the generated XML. Closes #53.
2014-12-14Rename get/set_string_content -> get/set_literal.John MacFarlane
2014-12-14Rename CMARK_NODE_INLINE_CODE -> CMARK_NODE_CODE.John MacFarlane
2014-12-13Added API documentation to src/cmark.h. Closes #224.John MacFarlane
2014-12-13Removed cmark_node_handler - it was used by cmark_walk, now deleted.John MacFarlane
2014-12-13Write API docs in cmark.h using markdown.John MacFarlane
`man/make_man_page.py` now converts using cmark.
2014-12-13Added cmark_render_man (man page writer).John MacFarlane
cmark: Replaced `--man` and `--ast` with generic `--to` option.
2014-12-13Added iterator interface to API, removed cmark_walk.John MacFarlane
* Added `iterator.c`, `iterator.h`. * Removed `cmark_walk`. * Replaced `cmark_walk` with iterator in HTML renderer. * Replaced API test for `cmark_walk` with simple iterator test.
2014-12-13API improvements: cmark_event_type parameter for walk handlers.John MacFarlane
Added cmark_event_type enum, which is used as the second parameter of the handler passed to cmark_walk. See #224.
2014-12-13Remove CMARK_NODE_REFERENCE_DEF from API.John MacFarlane
Modified finalize in blocks.c to return parent of finalized block, so we can handle the case of reference definitions, when we simply remove the finalized block.
2014-12-12Revert "Removed CMARK_NODE_REFERENCE_DEF from API."John MacFarlane
This reverts commit b598b52a4acdc2332be3d34e30237d1b93b7dd03. The change led to some problems, because some of the callers of 'finalize' expected the node to exist after the call. This could all be rewritten, but for now let's just revert.
2014-12-12Rudimentary documentation for cmark_walk.John MacFarlane
2014-12-12Removed CMARK_NODE_REFERENCE_DEF from API.John MacFarlane
There's no reason to store these empty nodes in the API. The references have already been resolved.
2014-12-12Added cmark_node_handler and cmark_walk to header.John MacFarlane
2014-12-05Revert "API change: Add cmark_node_set_type for completeness."John MacFarlane
This reverts commit 6c1f76a8a22f6c84231e5101f0950ce353ec8075.
2014-12-05API change: Add cmark_node_set_type for completeness.John MacFarlane
2014-12-05Changed CMARK_NODE_NONE from -1 to 0.John MacFarlane
This is more consistent with CMARK_LIST_NONE, etc.
2014-12-05Added CMARK_NODE_TYPE_NONE.John MacFarlane
This is the return value of cmark_get_node_type when the argument is a null pointer. Avoids segfault.
2014-11-30More man page improvements.John MacFarlane
2014-11-30Make the man pages standard groff man rather than mdoc.John MacFarlane
2014-11-30Fixed bug in splitting arguments in make_man_page.py.John MacFarlane
2014-11-30Create man 3 page without markdown intermediary.John MacFarlane
Use proper man style, marking function types, arguments, etc. See #224.
2014-11-30Added blank line in comment.John MacFarlane
2014-11-30cmark.h: Use C89 comments.John MacFarlane
2014-11-30Renamed cmark_parser_push -> cmark_parser_feed.John MacFarlane
2014-11-29Annotated cmark.h with some markdown headers etc. for man page.John MacFarlane
2014-11-29Push parser interfaceNick Wellnhofer
Replace cmark_parser_process_line with cmark_parser_push that takes arbitrary chunks of data. Also fixes #211.
2014-11-28Framework for using doxygen to generate API docs.John MacFarlane
Added Makefile target for doxygen-generated man page. Added Doxyfile. Added man/man3/cmark.3 (generated by doxygen) to install targets.
2014-11-28Removed cmark_free_nodes from public API.John MacFarlane
Replace it with static S_free_nodes.
2014-11-28Renamed identifiers in public API:John MacFarlane
cmark_doc_parser => cmark_parser cmark_new_doc_parser => cmark_parser_new cmark_free_doc_parser => cmark_parser_free cmark_finish => cmark_parser_finish cmark_process_line => cmark_parser_process_line cmark_node_destroy => cmark_node_free Closes #223.
2014-11-28Remove outdated public short name macrosNick Wellnhofer
2014-11-25Replaced cmark_debug_print with cmark_render_ast.John MacFarlane
This returns a string.
2014-11-25Rename NODE_STRING -> NODE_TEXT.John MacFarlane
In JS, use 'Text' instead of 'Str'. In spec, use "plain textual content" instead of "strings."
2014-11-23Do not distinguish btw fenced and indented code in AST.John MacFarlane
Use a single CMARK_NODE_CODE_BLOCK tag for both. Distinguish them when needed for parsing by looking at the fence_length attribute, which is 0 for indented blocks.
2014-11-23Revert "Revert "Remove distinction btw atx and setext header in AST.""John MacFarlane
This reverts commit 4570eb2bff2e1b71fa5b6408abbc69c98ff5ff24.
2014-11-22Revert "Remove distinction btw atx and setext header in AST."John MacFarlane
This reverts commit a71423f6ee1b77d9f79d42599ea00b4ca99f5da0. Not quite sure about this change, so reverting for now. Note that we still have a distinction between fenced and indented code blocks in the AST. These two distinctions seem to stand or fall together.
2014-11-22Remove distinction btw atx and setext header in AST.John MacFarlane
Now we just have 'header' -- Setext and ATX are just two ways of forming these; it's not a semantic difference that should remain in the AST.
2014-11-22Renamed NODE_BQUOTE -> NODE_BLOCK_QUOTE.John MacFarlane
2014-11-22Make parser accept a char*Nick Wellnhofer