summaryrefslogtreecommitdiff
path: root/src/cmark.h
AgeCommit message (Collapse)Author
2015-02-16Rename CMARK_OPT_SMARTPUNCT -> CMARK_OPT_SMART.John MacFarlane
2015-02-16Made 'options' an int rather than a long.John MacFarlane
For consistency with the API.
2015-02-15Added options parameter to cmark_parse_document, cmark_parse_file.John MacFarlane
Also to some non-exported functions in blocks and inlines.
2015-02-14Added CMARK_OPT_SMARTPUNCT and --smart option.John MacFarlane
So far this is only implemented for the HTML renderer. Ultimately some of this should be factored out into a form that can be used in other renderers.
2015-01-23Let cmake update versionNick Wellnhofer
Add a new template cmark_version.h.in to generate cmark_version.h containing version information.
2015-01-23Improve version informationNick Wellnhofer
Add version number and string as macros and symbols. Version numbers can be easily compared, for example in the C preprocessor: #include <cmark.h> #if CMARK_VERSION < 0x020200 #error Requires libcmark 2.2.0 or higher #endif Storing the version in a global variable allows to check the library version at runtime. For example: if (CMARK_VERSION != cmark_version) { warn("Compiled against libcmark %s, but using %s", CMARK_VERSION_STRING, cmark_version_string); } The version should be updated whenever the public API is changed.
2015-01-20Accessor for iterator's root nodeNick Wellnhofer
2015-01-20Add user data field for nodesNick Wellnhofer
2015-01-10Update iterator documentationNick Wellnhofer
2015-01-10Rework iteratorsNick Wellnhofer
* Advance to the next node when calling 'cmark_iter_next', not when calling 'cmark_iter_get_node'. * Add 'cmark_iter_get_event_type' accessor. * Allow deletion of nodes after an 'EXIT' event, or an 'ENTER' event for leaf nodes.
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.