Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7a912929b0
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (41 sloc) 0.81 kb
/*
* 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;
}
Jump to Line
Something went wrong with that request. Please try again.