From 8783408f37f66e1d76a9a5267c01fff69386b316 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 5 Nov 2013 12:14:13 +0100 Subject: [PATCH] flush --- VERSION | 2 +- index.css | 10 +++++-- index.js | 11 +++++--- index.php | 80 ++++++++++++++++++++++++++++++++++++++++--------------- 4 files changed, 76 insertions(+), 27 deletions(-) diff --git a/VERSION b/VERSION index 6e8bf73..a163131 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.1.0alpha diff --git a/index.css b/index.css index e91ade1..afc59ec 100644 --- a/index.css +++ b/index.css @@ -2,8 +2,10 @@ font-size: 99.9%; } -body { +body, code { font-family: Inconsolata, Monospace, 'Courier New', Courier, monospace; +} +body { font-size: 1.5em; margin: 0; padding: 0; @@ -17,12 +19,16 @@ body>* { .sidebar { font-size: .9em; float: right; - width: 500px; background: #f0f0f0; border-bottom-left-radius: 10px; padding: 0; + width: auto; + padding-right: 1em; + /* + width: 520px; margin-bottom: .2em; margin-left: 2em; + * */ } .sidebar>ul { } diff --git a/index.js b/index.js index f02ac5a..45b5bb8 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,11 @@ function log() { } function is_constant(s) { - return s.length > 1 && s.toUpperCase(s) === s; + s = s.replace(/v\d+(_\d+)?$/, ""); + if (s.length < 2) { + return false; + } + return s.toUpperCase(s) === s; } function is_variable(s) { @@ -48,6 +52,7 @@ function type(s, nn) { case "RecursiveArrayIterator": case "SplObserver": case "SplSubject": + case "SplObjectStorage": return ""; // keywords @@ -145,10 +150,10 @@ function walk(i, e) { function blink(c) { var $c = $(c); - $c.fadeOut("slow").queue(function(next) { + $c.fadeOut("fast").queue(function(next) { this.style.color = "red"; next(); - }).fadeIn("fast").fadeOut("fast").queue(function(next) { + }).fadeIn("fast").fadeOut("slow").queue(function(next) { this.style.color = ""; next(); }).fadeIn("slow"); diff --git a/index.php b/index.php index 93454ec..1e09d32 100644 --- a/index.php +++ b/index.php @@ -62,7 +62,25 @@ function head($file, $lines = 1) { return $ld; } -function ns($file) { +function ns($path) { + $ns = ""; + $parts = explode("/", $path); + $upper = ctype_upper($path[0]); + for ($i = 0; $i < count($parts); ++$i) { + if (!strlen($parts[$i]) || $parts[$i] === ".") { + continue; + } + if (strlen($ns)) { + if ($upper && !ctype_upper($parts[$i][0])) { + $ns .= "::"; + } else { + $ns .= "\\"; + } + } + $ns .= $parts[$i]; + $upper = ctype_upper($parts[$i][0]); + } + return $ns; return str_replace("/", "\\", str_replace("//", "/", trim($file, "/."))); } @@ -98,12 +116,13 @@ function ls($dir) { if (!isset($pi["extension"]) || $pi["extension"] != "md") { continue; } - if (!is_dir("$dir/".$pi["filename"])) { + /* ignore files where an accompanying directory exists */ + if (is_dir("$dir/".$pi["filename"])) { continue; } } else { - /* ignore directories where an companying file exists */ - if (is_file("$path.md")) { + /* ignore directories where no accompanying file exists */ + if (!is_file("$path.md")) { continue; } } @@ -130,24 +149,43 @@ function ml($file) { return; } if (!ctype_upper($pi["filename"][0])) { - return; - } - $dir = $pi["dirname"] . "/" . $pi["filename"]; - if (is_dir($dir)) { - printf("

Methods:

\n"); - printf("\n"); } } @@ -160,7 +198,7 @@ function md($file) { case "md": $r = fopen($file, "r"); $md = MarkdownDocument::createFromStream($r); - $md->compile(MarkdownDocument::AUTOLINK); + $md->compile(MarkdownDocument::AUTOLINK|MarkdownDocument::TOC); print str_replace("
","
",$md->getHtml()); fclose($r); ml($file); -- 2.30.2