Parser
Copyright 2008, 2012 Neil Edelman, distributed under the terms of the
GNU General Public License, see copying.txt
MakeIndex is a simple content management system that generates static
content, (mostly index.html,) on all the directories rooted at the directory
specified by the argument. It is based on a template file, ".index.html" and
".newsfeed.rss". Also included are files to summarise the directory structure
for a xml site map, compatible with Google, and any .news for an rss
feed. It takes one argument, <directory>, which is the root of the recursion.
There should be an <example> directory that has a bunch of files in it. Run
bin/MakeIndex example/; it should make a webpage out of the directory
structure and .index.html, open example/index.html after running to see.
-
If the .index.html file exists in the <directory>, prints <index.html>
recursively; overwrites any index.html on all the directories rooted at
<directory>;
-
if the .sitemap.xml file exists in <directory>, prints (and overwrites) an
index called sitemap.xml;
-
if the .newsfeed.rss file exists in <directory>, prints (and overwrites)
to newsfeed.rss all the .news files (if there are any.)
-
Treats .d as a description of the file without the .d;
if this is an empty text-file or a zero-byte file, it skips over this file.
-
treats index.d as a description of the directory;
-
treats content.d as an in-depth description of the directory,
replacing <index.d> when in the directory;
-
treats .d.jpg as a image that will go with the description;
-
treats .news as a newsworthy item; the format of this file is ISO 8601
date (YYYY-MM-DD,) next line title;
-
treats .link as a link with the href in the file.
.index.html, .sitemap.xml, .newsfeed.rss, see Parser for recognised
symbols. Assumes '..' is the parent directory, '.' is the current directory,
and '/' is the directory separator; works for UNIX, MacOS, Windows.
If this is not the case, the constants are in Files.c.
- minimum standard
- C89/90
- author
- Neil
- version
- 1.1; 2017-03 fixed pedantic warnings; took out arg
- since
- 1.0; 2016-09-19 Added umask
0.8; 2013-07 case-insensitive sort
0.7; 2012 sth.dsth.d handled properly
0.6; 2008-03-27
- fixme
- Don't have <directory> be an argument; just do it in the current.
- fixme
- Have a subset of LaTeX converted into html for the .d files?
- fixme
- Encoding is an issue; especially the newsfeed, 7bit.
- fixme
- It's not robust; eg @(files)@(files){Don't do this.}.
Declarations
Function Summary
Return Type | Function Name | Argument List |
}
void |
usage |
const char *programme |
Function Detail
usage
}
void usage (const char *programme)
you must free() the memory!