summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2020-09-02 09:11:08 +0100
committerKatolaZ <katolaz@freaknet.org>2020-09-02 10:27:20 +0100
commit7f962c74879713d9aa6aeb09993dd7d80bccedd0 (patch)
tree578968e0ec8228c0bd715b99689c5692ad4be8ae /src/main.c
parent59a8bd1e990a472bc6d8ec8bb54a514431ff854e (diff)
add support for groff mom filter
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 0cc2b3d..17bfcfa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,14 +25,15 @@ typedef enum {
FORMAT_XML,
FORMAT_MAN,
FORMAT_COMMONMARK,
- FORMAT_LATEX
+ FORMAT_LATEX,
+ FORMAT_MOM
} writer_format;
void print_usage() {
printf("Usage: cmark [FILE*]\n");
printf("Options:\n");
printf(" --to, -t FORMAT Specify output format (html, xml, man, "
- "commonmark, latex)\n");
+ "commonmark, latex, mom)\n");
printf(" --width WIDTH Specify wrap width (default 0 = nowrap)\n");
printf(" --sourcepos Include source position attribute\n");
printf(" --hardbreaks Treat newlines as hard line breaks\n");
@@ -65,6 +66,9 @@ static void print_document(cmark_node *document, writer_format writer,
case FORMAT_LATEX:
result = cmark_render_latex(document, options, width);
break;
+ case FORMAT_MOM:
+ result = cmark_render_mom(document, options, width);
+ break;
default:
fprintf(stderr, "Unknown format %d\n", writer);
exit(1);
@@ -148,6 +152,8 @@ int main(int argc, char *argv[]) {
writer = FORMAT_COMMONMARK;
} else if (strcmp(argv[i], "latex") == 0) {
writer = FORMAT_LATEX;
+ } else if (strcmp(argv[i], "mom") == 0) {
+ writer = FORMAT_MOM;
} else {
fprintf(stderr, "Unknown format %s\n", argv[i]);
exit(1);