Sha256: 2b888d4c5bf0ee785436972e6ba3932371e6cf7bb5d65033b1fbef4a482df10c

Contents?: true

Size: 810 Bytes

Versions: 38

Compression:

Stored size: 810 Bytes

Contents

/*
 * docheader -- get values from the document header
 *
 * 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"

static char *
onlyifset(Line *l)
{
    char *ret = T(l->text) + l->dle;

    return ret[0] ? ret : 0;
}

char *
mkd_doc_title(Document *doc)
{
    if ( doc && doc->title )
	return onlyifset(doc->title);
    return 0;
}


char *
mkd_doc_author(Document *doc)
{
    if ( doc && doc->author )
	return onlyifset(doc->author);
    return 0;
}


char *
mkd_doc_date(Document *doc)
{
    if ( doc && doc->date )
	return onlyifset(doc->date);
    return 0;
}

Version data entries

38 entries across 36 versions & 9 rubygems

Version Path
rdiscountwl-1.0.0.1 ext/docheader.c
rdiscount-2.2.0.2 ext/docheader.c
rdiscount-2.2.0.1 ext/docheader.c
rdiscount-2.2.0 ext/docheader.c
rdiscount-2.1.8 ext/docheader.c
rdiscount_wm-3.1.0.0 ext/docheader.c
rdiscount_wm-3.0.0.0 ext/docheader.c
rdiscount-2.1.7.1 ext/docheader.c
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/bluecloth-2.2.0/ext/docheader.c
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/bluecloth-2.1.0/ext/docheader.c
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/bluecloth-2.1.0/ext/docheader.c
rdiscount-2.1.7 ext/docheader.c
challah-1.0.0 vendor/bundle/gems/rdiscount-2.1.6/ext/docheader.c
rdiscount-2.1.6 ext/docheader.c
challah-1.0.0.beta3 vendor/bundle/gems/rdiscount-2.0.7.2/ext/docheader.c
challah-1.0.0.beta3 vendor/bundle/gems/rdiscount-2.0.7.3/ext/docheader.c
rdiscount-2.0.7.3 ext/docheader.c
challah-1.0.0.beta2 vendor/bundle/gems/rdiscount-2.0.7.2/ext/docheader.c
challah-1.0.0.beta vendor/bundle/gems/rdiscount-2.0.7.2/ext/docheader.c
challah-1.0.0.beta vendor/bundle/gems/rdiscount-2.0.7.1/ext/docheader.c