Sha256: ceac51493d92d86f554669d26774d0fe00d2689c0525e36b6d68c4bb6e3488ec

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

/*
 * 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 <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#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, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
				"<!DOCTYPE html "
				" PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
				" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
				"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n") );

	DO_OR_DIE( fprintf(out, "<head>\n") );
	if ( title = mkd_doc_title(p) ) {
	    DO_OR_DIE( fprintf(out, "<title>%s</title>\n", title) );
	}
	DO_OR_DIE( mkd_generatecss(p, out) );
	DO_OR_DIE( fprintf(out, "</head>\n"
				"<body>\n") );
	
	DO_OR_DIE( mkd_generatehtml(p, out) );
	DO_OR_DIE( fprintf(out, "</body>\n"
				"</html>\n") );

	return 0;
    }
    return EOF;
}

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
rdiscountwl-1.0.0.2 ext/xmlpage.c
rdiscountwl-1.0.0.1 ext/xmlpage.c
rdiscount-2.2.0.2 ext/xmlpage.c
rdiscount-2.2.0.1 ext/xmlpage.c
rdiscount-2.2.0 ext/xmlpage.c