Template:JSGToC

  • Revision slug: Template:JSGToC
  • Revision title: Template:JSGToC
  • Revision id: 237244
  • Created:
  • Creator: lmorchard
  • Is current revision? No
  • Comment

Revision Content

<% // Note: If you want to add chapters to this table of contents, // add their links to https://developer.mozilla.org/Template:JSGChapters var chapterList = string.deserialize(template("JSGChapters")); var expTOC = ""; var link1 = ""; %>

Quick Table of Contents

    <% for (var i=0; i<chapterlist.length; %="" i++)="" link1="web.link(path," path="chapterList[i];" var="" wiki.getpage(path).title);="" {="">
  1. <%- link1 %>
  2. <% // Need support for wiki.toc() // expTOC += "

    " + link1 + "

    " + wiki.toc(path); } %> </chapterlist.length;>
} <% if (expTOC) { %>

Expanded Table of Contents

<%- expTOC %>; <% } %>

Revision Source

<%
// Note: If you want to add chapters to this table of contents,
// add their links to https://developer.mozilla.org/Template:JSGChapters
var chapterList = string.deserialize(template("JSGChapters"));

var expTOC = "";
var link1 = "";
%>
<h2>Quick Table of Contents</h2>
<ol>
<% 
for (var i=0; i<chapterList.length; i++) {
    var path = chapterList[i];
    var link1 = web.link(path, wiki.getPage(path).title);
    %><li><%- link1 %></li><%
    // Need support for wiki.toc()
    // expTOC += "<h3>" + link1 + "</h3>" + wiki.toc(path);
}
%>
</ol>
}
<% if (expTOC) { %>
<h2>Expanded Table of Contents</h2>
<%- expTOC %>;
<% } %>
Revert to this revision