', $name, '';
echo '
';
}
function listDir()
{
$dirList = array();
foreach (glob("content/*", GLOB_ONLYDIR) as $dir) {
$dirList[basename($dir)] = listFile($dir);
}
return $dirList;
}
function listFile($dir)
{
$fileList = array();
foreach (glob($dir . "/*.md") as $dir) {
$fileList[] = str_replace('.md', '', basename($dir));
}
return $fileList;
}
function makeMenu($getDir = null)
{
$dirList = listDir();
$menu = '';
foreach ($dirList as $dir => $files) {
if ($getDir === $dir) {
$expand = 'open';
} else {
$expand = 'close';
}
$menu .= '
' . $dir . '
';
foreach ($files as $value) {
$menu .= '- ' . $value . '
';
}
$menu .= '
';
}
return $menu;
}