Recursor
Copyright 2008, 2012 Neil Edelman, distributed under the terms of the
GNU General Public License, see copying.txt
Recusor is the main part of MakeIndex, a 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.
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
- POSIX.1
- author
- Neil
- version
- 1.1; 2017-03 fixed pedantic warnings; command-line improvements
- 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, which requires 7-bit.
- fixme
- It's not robust; eg @(files)@(files){Don't do this.}.
Declarations
struct Recursor
struct Recursor
See Recursor.
Function Summary
Return Type | Function Name | Argument List |
struct Recursor * |
Recursor |
const char *idx, const char *map, const char *news |
void |
Recursor_ |
void |
int |
RecursorGo |
void |
Function Detail
Recursor
struct Recursor * Recursor (const char *idx, const char *map, const char *news)
- parameter: idx
- file name of the prototype index file, eg, ".index.html".
- parameter: map
- file name of the prototype map file, eg, ".sitmap.xml".
- parameter: news
- file name of the prototype news file, eg, ".newsfeed.rss".
Recursor_
void Recursor_ (void)
Destructor.
RecursorGo
int RecursorGo (void)
Actually does the recursion.