Add a demo program for mkd_xhtmlpage(), add it to the sample programs list.

This commit is contained in:
David Parsons
2008-10-04 13:36:17 -07:00
parent dfca6408a2
commit e036375cff
2 changed files with 27 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
/*
* makepage: Use mkd_xhtmlpage() to convert markdown input to a
* fully-formed xhtml page.
*/
#include <stdio.h>
#include <stdlib.h>
#include <mkdio.h>
main(argc, argv)
int argc;
char **argv;
{
MMIOT *doc;
if ( (argc > 1) && !freopen(argv[1], "r", stdin) ) {
perror(argv[1]);
exit(1);
}
if ( (doc = mkd_in(stdin, 0)) == 0 ) {
perror( (argc > 1) ? argv[1] : "stdin" );
exit(1);
}
exit(mkd_xhtmlpage(doc, 0, stdout));
}