X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=index.php;h=5c4b909b5057fe201b23b09978d73c0a785222dd;hb=4199b3fd65d963057c82c1541df6e2f786e6bd9d;hp=7ae8e478efa5eac7432ab39c0d68dd2e4b524cd4;hpb=068cc669809ce51220d433e26928db3dc390d13a;p=mdref%2Fmdref diff --git a/index.php b/index.php index 7ae8e47..5c4b909 100644 --- a/index.php +++ b/index.php @@ -101,37 +101,15 @@ function ls($dir) { if ($dir !== ".") { printf("\n"); } @@ -148,44 +126,20 @@ function ml($file) { if ($pi["extension"] !== "md") { return; } - if (!ctype_upper($pi["filename"][0])) { - // namespaced functions - $dir = $pi["dirname"] . "/" . $pi["filename"]; - if (is_dir($dir)) { - printf("

Functions:

\n"); - printf("\n"); - } - } else { - // methods - $dir = $pi["dirname"] . "/" . $pi["filename"]; - if (is_dir($dir)) { - printf("

Methods:

\n"); - printf("\n"); + $dir = $pi["dirname"] . "/" . $pi["filename"]; + if (($glob = glob("$dir/[_a-z]*.md"))) { + printf("

%s:

\n", !ctype_upper($pi["filename"][0]) ? + "Functions" : "Methods"); + printf("\n"); } } @@ -199,7 +153,7 @@ function md($file, $res) { $r = fopen($file, "r"); $md = MarkdownDocument::createFromStream($r); $md->compile(MarkdownDocument::AUTOLINK|MarkdownDocument::TOC); - print str_replace("
","
",$md->getHtml()); + print $md->getHtml(); fclose($r); ml($file); break; @@ -263,12 +217,29 @@ ob_start($s); + +
+ + + +