You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2014/01/23 17:59:32 UTC
svn commit: r1560748 - in /qpid/site: docs/site.js input/site.js
Author: jross
Date: Thu Jan 23 16:59:31 2014
New Revision: 1560748
URL: http://svn.apache.org/r1560748
Log:
QPID-5311: Make the section links also work with the anchors that docbook generates
Modified:
qpid/site/docs/site.js
qpid/site/input/site.js
Modified: qpid/site/docs/site.js
URL: http://svn.apache.org/viewvc/qpid/site/docs/site.js?rev=1560748&r1=1560747&r2=1560748&view=diff
==============================================================================
--- qpid/site/docs/site.js (original)
+++ qpid/site/docs/site.js Thu Jan 23 16:59:31 2014
@@ -245,15 +245,28 @@ function _addHeadingAnchors() {
return;
}
-
var headings = _getHeadings();
for (var i = 0; i < headings.length; i++) {
var heading = headings[i];
+ var id = heading.id;
+
+ if (!id) {
+ var docbookAnchor = _getDescendant(heading, "a");
+
+ if (docbookAnchor) {
+ id = docbookAnchor.id;
+ }
+ }
+
+ if (!id) {
+ console.log("Giving up on " + heading);
+ continue;
+ }
var anchor = document.createElement("a");
anchor.className = "heading-link";
- anchor.href = "#" + heading.id;
+ anchor.href = "#" + id;
var text = document.createTextNode(" \u00a7");
anchor.appendChild(text);
Modified: qpid/site/input/site.js
URL: http://svn.apache.org/viewvc/qpid/site/input/site.js?rev=1560748&r1=1560747&r2=1560748&view=diff
==============================================================================
--- qpid/site/input/site.js (original)
+++ qpid/site/input/site.js Thu Jan 23 16:59:31 2014
@@ -249,10 +249,23 @@ function _addHeadingAnchors() {
for (var i = 0; i < headings.length; i++) {
var heading = headings[i];
+ var id = heading.id;
+
+ if (!id) {
+ var docbookAnchor = _getDescendant(heading, "a");
+
+ if (docbookAnchor) {
+ id = docbookAnchor.id;
+ }
+ }
+
+ if (!id) {
+ continue;
+ }
var anchor = document.createElement("a");
anchor.className = "heading-link";
- anchor.href = "#" + heading.id;
+ anchor.href = "#" + id;
var text = document.createTextNode(" \u00a7");
anchor.appendChild(text);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org