aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-03 14:23:23 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-03 14:23:23 +0000
commit7a61bd3dd6ea818950a432611bb0fb982fc6c487 (patch)
treea342c1b26a2be194b292db9d8a2e50485b4ae8c9 /main.c
parente67e511e00b98d639343ad38244d30d1b9cd6cf4 (diff)
downloadmandoc-7a61bd3dd6ea818950a432611bb0fb982fc6c487.tar.gz
mandoc-7a61bd3dd6ea818950a432611bb0fb982fc6c487.tar.zst
mandoc-7a61bd3dd6ea818950a432611bb0fb982fc6c487.zip
new -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
thanks to reyk@ and to Vsevolod at FreeBSD for suggesting it
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9039c46d..22b82530 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.284 2017/02/22 14:58:48 schwarze Exp $ */
+/* $Id: main.c,v 1.285 2017/03/03 14:23:23 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -67,6 +67,7 @@ enum outt {
OUTT_TREE, /* -Ttree */
OUTT_MAN, /* -Tman */
OUTT_HTML, /* -Thtml */
+ OUTT_MARKDOWN, /* -Tmarkdown */
OUTT_LINT, /* -Tlint */
OUTT_PS, /* -Tps */
OUTT_PDF /* -Tpdf */
@@ -766,6 +767,9 @@ parse(struct curparse *curp, int fd, const char *file)
case OUTT_PS:
terminal_mdoc(curp->outdata, man);
break;
+ case OUTT_MARKDOWN:
+ markdown_mdoc(curp->outdata, man);
+ break;
default:
break;
}
@@ -950,6 +954,8 @@ toptions(struct curparse *curp, char *arg)
curp->outtype = OUTT_MAN;
else if (0 == strcmp(arg, "html"))
curp->outtype = OUTT_HTML;
+ else if (0 == strcmp(arg, "markdown"))
+ curp->outtype = OUTT_MARKDOWN;
else if (0 == strcmp(arg, "utf8"))
curp->outtype = OUTT_UTF8;
else if (0 == strcmp(arg, "locale"))