Sha256: aa5639a3e953fe4a1974cf5ae35f12f462d0e6b0381e9277e2e1e91fb8c398b1

Contents?: true

Size: 1.12 KB

Versions: 51

Compression:

Stored size: 1.12 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) ) {
	fprintf(out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
	fprintf(out, "<!DOCTYPE html "
		     " PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
		     " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n");

	fprintf(out, "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n");

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

	return 0;
    }
    return -1;
}

Version data entries

51 entries across 49 versions & 7 rubygems

Version Path
rdiscount-2.1.8 ext/xmlpage.c
chaptastic-rdiscount-1.4.1 ext/xmlpage.c
rdiscount_wm-3.1.0.0 ext/xmlpage.c
rdiscount_wm-3.0.0.0 ext/xmlpage.c
rdiscount-2.1.7.1 ext/xmlpage.c
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/bluecloth-2.2.0/ext/xmlpage.c
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/bluecloth-2.1.0/ext/xmlpage.c
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/bluecloth-2.1.0/ext/xmlpage.c
rdiscount-2.1.7 ext/xmlpage.c
challah-1.0.0 vendor/bundle/gems/rdiscount-2.1.6/ext/xmlpage.c
rdiscount-2.1.6 ext/xmlpage.c
challah-1.0.0.beta3 vendor/bundle/gems/rdiscount-2.0.7.2/ext/xmlpage.c
challah-1.0.0.beta3 vendor/bundle/gems/rdiscount-2.0.7.3/ext/xmlpage.c
rdiscount-2.0.7.3 ext/xmlpage.c
challah-1.0.0.beta2 vendor/bundle/gems/rdiscount-2.0.7.2/ext/xmlpage.c
challah-1.0.0.beta vendor/bundle/gems/rdiscount-2.0.7.1/ext/xmlpage.c
challah-1.0.0.beta vendor/bundle/gems/rdiscount-2.0.7.2/ext/xmlpage.c
rdiscount-2.0.7.2 ext/xmlpage.c
rdiscount-2.0.7.1 ext/xmlpage.c
radiant-1.0.0 ruby-debug/ruby/1.8/gems/bluecloth-2.1.0/ext/xmlpage.c