/*
* xmlpage -- write a skeletal xhtml page
*
* Copyright (C) 2007 David L Parsons.
* The redistribution terms are provided in the COPYRIGHT file that must
* be distributed with this source code.
*/
#include "config.h"
#include
#include
#include
#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"
int
mkd_xhtmlpage(Document *p, int flags, FILE *out)
{
char *title;
extern char *mkd_doc_title(Document *);
if ( mkd_compile(p, flags) ) {
DO_OR_DIE( fprintf(out, "\n"
"\n"
"\n") );
DO_OR_DIE( fprintf(out, "\n") );
if ( title = mkd_doc_title(p) ) {
DO_OR_DIE( fprintf(out, "%s\n", title) );
}
DO_OR_DIE( mkd_generatecss(p, out) );
DO_OR_DIE( fprintf(out, "\n"
"\n") );
DO_OR_DIE( mkd_generatehtml(p, out) );
DO_OR_DIE( fprintf(out, "\n"
"\n") );
return 0;
}
return EOF;
}