diff options
author | Chris Johns <chrisj@rtems.org> | 2017-08-07 09:59:49 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-08-07 09:59:49 +1000 |
commit | 8b96e17c8abf61d97dd224b23370dc148f32fe3c (patch) | |
tree | e8eb043159d145ffbbbf9c23ef872226de5ab059 /source-builder/sb/asciidoc/javascripts/toc.js | |
parent | 4.12: Fix SIS patch URL (diff) | |
download | rtems-source-builder-8b96e17c8abf61d97dd224b23370dc148f32fe3c.tar.bz2 |
doc: Remove in source documentation and the asciidoc package
The RSB documentation is now in ReST format and part of the RTEMS
Documentation project. See https://docs.rtems.org/.
Remove support for the GPL based asciidoc tool and remove the
asciidoc package from the RSB.
Add the Python Markdown package and update the reporter to use
Markdown for HTML generation. The resuling HTML report is a single
self contained file.
Closes #3047.
Diffstat (limited to '')
-rw-r--r-- | source-builder/sb/asciidoc/javascripts/toc.js | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/source-builder/sb/asciidoc/javascripts/toc.js b/source-builder/sb/asciidoc/javascripts/toc.js deleted file mode 100644 index 06127bf..0000000 --- a/source-builder/sb/asciidoc/javascripts/toc.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * IMPORTANT: - * This file (toc.js is) deprecated (superceded by asciidoc-xhtml11.js in - * AsciiDoc 8.5.1. toc.js is retained for compatibility with user customised - * (pre 8.5.1) xhtml11 [header] and [footer] sections. - * - */ - -/* Author: Mihai Bazon, September 2002 - * http://students.infoiasi.ro/~mishoo - * - * Table Of Content generator - * Version: 0.4 - * - * Feel free to use this script under the terms of the GNU General Public - * License, as long as you do not remove or alter this notice. - */ - - /* modified by Troy D. Hanson, September 2006. License: GPL */ - /* modified by Stuart Rackham, October 2006. License: GPL */ - -function getText(el) { - var text = ""; - for (var i = el.firstChild; i != null; i = i.nextSibling) { - if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. - text += i.data; - else if (i.firstChild != null) - text += getText(i); - } - return text; -} - -function TocEntry(el, text, toclevel) { - this.element = el; - this.text = text; - this.toclevel = toclevel; -} - -function tocEntries(el, toclevels) { - var result = new Array; - var re = new RegExp('[hH]([2-'+(toclevels+1)+'])'); - // Function that scans the DOM tree for header elements (the DOM2 - // nodeIterator API would be a better technique but not supported by all - // browsers). - var iterate = function (el) { - for (var i = el.firstChild; i != null; i = i.nextSibling) { - if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { - var mo = re.exec(i.tagName) - if (mo) - result[result.length] = new TocEntry(i, getText(i), mo[1]-1); - iterate(i); - } - } - } - iterate(el); - return result; -} - -// This function does the work. toclevels = 1..4. -function generateToc(toclevels) { - var toc = document.getElementById("toc"); - var entries = tocEntries(document.getElementsByTagName("body")[0], toclevels); - for (var i = 0; i < entries.length; ++i) { - var entry = entries[i]; - if (entry.element.id == "") - entry.element.id = "toc" + i; - var a = document.createElement("a"); - a.href = "#" + entry.element.id; - a.appendChild(document.createTextNode(entry.text)); - var div = document.createElement("div"); - div.appendChild(a); - div.className = "toclevel" + entry.toclevel; - toc.appendChild(div); - } - if (entries.length == 0) - document.getElementById("header").removeChild(toc); -} |