com web/php: Generate quick toc for function reference pages (needs new PhD release to generate the anchors): include/shared-manual.inc js/common.js
styles/doc.css
| From: | Paul Dragoonis | Date: | Tue, 28 Dec 2010 08:09:04 +0000 |
| Subject: | com web/php: Generate quick toc for function reference pages (needs new PhD release to generate the anchors): include/shared-manual.inc js/common.js styles/doc.css |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-23735@lists.php.net to get a copy of this message | ||
Commit: 262e753a8f7e36ba2e7b09b498dfb6ee57502de7
Author: Hannes Magnusson <bjori@php.net> Tue, 28 Dec 2010 08:09:04 +0000
Parents: 3e0128b79ddbc928cfae4df2bd759b6b60d32015
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=262e753a8f7e36ba2e7b09b498dfb6ee57502de7
Log:
Generate quick toc for function reference pages (needs new PhD release to
generate the anchors)
Changed paths:
M include/shared-manual.inc
M js/common.js
M styles/doc..css
Diff:
diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index a4a58ad..e4f2938 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -530,6 +530,7 @@ function manual_setup_beta($setup) {
$_SERVER["BASE_PAGE"] = "/manual/" . $setup["head"][1] .
"/" . $setup["this"][0];
site_header($setup["this"][1] . " - Manual ", array("current"
=> "docs", "leftmenu" => $menu));
+ echo '<aside id="quicktoc"></aside>';
}
function manual_header_beta(){}
diff --git a/js/common.js b/js/common.js
index a3198f9...bf3d814 100644
--- a/js/common.js
+++ b/js/common.js
@@ -35,6 +35,18 @@ $(document).ready(function() {
}
);
});
+ if ($("#quicktoc").length) {
+ var l = "";
+ $(".refsect1 h3").each(function() {
+ var id = $(this).parent().attr("id");
+ l += "<li><a href='#" + id + "'>" +
$(this).text() + "</a></li>";
+ });
+ if (l) {
+ $("#quicktoc").append("<h5>Quick TOC</h5><ul>" +
l + "<li><a href='#usernotes'>User
notes</a></li></ul>");
+ } else {
+ $("#quicktoc").remove();
+ }
+ }
});
diff --git a/styles/doc.css b/styles/doc.css
index 6cdb98d..50292e3 100644
--- a/styles/doc.css
+++ b/styles/doc.css
@@ -1,3 +1,10 @@
+aside#quicktoc {
+ padding: 10px;
+ width: 125px;
+ border: 1px solid #C3ADD9;
+ position: fixed;
+ right: 0px;
+}
.docs i .parameter {
font-style: normal;
}