Example #1
0
$toc->trim = '$ ';
// Initialize Docs Menu
$menu = new menu();
$menu->dir =& $config->path;
$menu->filetype =& $config->extension;
// Initialize GeSHi (Syntax Highlighting)
$geshi = new GeSHi_mDocs();
$geshi->default_language =& $config->language;
// Apply Markdown Syntax:
$doc = $markdown->transform($doc);
// Apply GeSHi Syntax Highlighting:
$doc = $geshi->parse_codeblocks($doc);
// Create Menu:
$menu->generate();
// Create TOC:
$toc->generate();
/**
 * Helper Functions:
 * @todo Possibly move this to a separate file
 */
/**
 * Clean Filename Path
 * 
 * Yes, it's overkill, but why not, it's fun!
 * This function allows only the following characters to pass:
 * 		A-Z a-z 0-9 - _ . /
 * 
 * It also goes into great detail to make sure that troublesome 
 * slash and period characters are not abused by would-be hackers.
 * So because of this, you can't read any file or folder that starts 
 * or ends with a period, but then again, you shouldn't have public