summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-02-25 22:43:31 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-03-21 17:28:31 -0700
commitf4afff1ce6c59a9a6ad7a5d370aab902a8cdb4c9 (patch)
treea032d748a0c68aca7cccd45495eece8a8f37b2a5 /src/main.c
parent3d46c2b594c1230cebb89c48c86b8a80aee43553 (diff)
Added commonmark renderer.
This is still incomplete. (See TODOs in the source.)
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 9a8fd98..c9b9013 100644
--- a/src/main.c
+++ b/src/main.c
@@ -17,13 +17,14 @@ typedef enum {
FORMAT_HTML,
FORMAT_XML,
FORMAT_MAN,
+ FORMAT_COMMONMARK
} writer_format;
void print_usage()
{
printf("Usage: cmark [FILE*]\n");
printf("Options:\n");
- printf(" --to, -t FORMAT Specify output format (html, xml, man)\n");
+ printf(" --to, -t FORMAT Specify output format (html, xml, man, commonmark)\n");
printf(" --sourcepos Include source position attribute\n");
printf(" --hardbreaks Treat newlines as hard line breaks\n");
printf(" --smart Use smart punctuation\n");
@@ -46,6 +47,9 @@ static void print_document(cmark_node *document, writer_format writer,
case FORMAT_MAN:
result = cmark_render_man(document, options);
break;
+ case FORMAT_COMMONMARK:
+ result = cmark_render_commonmark(document, options);
+ break;
default:
fprintf(stderr, "Unknown format %d\n", writer);
exit(1);
@@ -98,6 +102,8 @@ int main(int argc, char *argv[])
writer = FORMAT_HTML;
} else if (strcmp(argv[i], "xml") == 0) {
writer = FORMAT_XML;
+ } else if (strcmp(argv[i], "commonmark") == 0) {
+ writer = FORMAT_COMMONMARK;
} else {
fprintf(stderr,
"Unknown format %s\n", argv[i]);