Skip to content
Snippets Groups Projects
Commit 5c388a96 authored by Albert Gräf's avatar Albert Gräf
Browse files

Add the possibility to have section titles in the toc, and add some more entries to the toc.

parent 353aef91
No related branches found
No related tags found
No related merge requests found
...@@ -28,8 +28,15 @@ index.setRef("id"); ...@@ -28,8 +28,15 @@ index.setRef("id");
var filetypes = [".pd", ".txt", ".htm", ".html", ".pdf"]; var filetypes = [".pd", ".txt", ".htm", ".html", ".pdf"];
// Table of Contents to start with // Table of Contents to start with
/* NOTE: A section title is indicated by an entry consisting just of the title
field. All other entries *must* also contain the directory (relative to the
pd-l2ork lib directory) in the id field, and may optionally contain a
description field. */
var toc = [ var toc = [
// Original Pd documentation // Original Pd documentation
{
title: "Pure Data",
},
{ {
id: "doc/1.manual", id: "doc/1.manual",
title: "Pd Manual", title: "Pd Manual",
...@@ -61,29 +68,70 @@ var toc = [ ...@@ -61,29 +68,70 @@ var toc = [
description: "how to code control and signal objects in C" description: "how to code control and signal objects in C"
}, },
/* // Section 7 of the vanilla Pd docs, uncomment these if needed. /* // Section 7 of the vanilla Pd docs, uncomment these if needed.
{
title: "Stuff",
},
{ {
id: "doc/7.stuff/soundfile-tools", id: "doc/7.stuff/soundfile-tools",
title: "Stuff - Soundfile Tools", title: "Soundfile Tools",
description: "some standard audio transformations packaged to work with mono soundfiles" description: "some standard audio transformations packaged to work with mono soundfiles"
}, },
{ {
id: "doc/7.stuff/synth", id: "doc/7.stuff/synth",
title: "Stuff - Synth", title: "Synth",
description: "polyphonic subtractive synthesizer example" description: "polyphonic subtractive synthesizer example"
}, },
{ {
id: "doc/7.stuff/tools", id: "doc/7.stuff/tools",
title: "Stuff - Tools", title: "Tools",
description: "useful little helper patches" description: "useful little helper patches"
}, },
*/ */
// Pd-L2Ork extras // Pd-L2Ork extras
{
title: "Pd-L2Ork",
},
{ {
id: "doc/4.data.structures/pd-l2ork/ds-tutorials", id: "doc/4.data.structures/pd-l2ork/ds-tutorials",
title: "Pd-L2Ork Data Structure Tutorials", title: "Data Structure Tutorials",
description: "overview of svg-based data structure drawing commands" description: "overview of svg-based data structure drawing commands"
}, },
// Popular external libraries {
id: "extra/disis",
title: "DISIS",
description: "DISIS externals (wiimote et al)"
},
// PDDP tutorials
{
title: "PDDP Tutorials",
},
{
id: "doc/manuals/0.Intro",
title: "Intro",
description: "getting started with Pd"
},
{
id: "doc/manuals/1.Sound",
title: "Sound",
description: "Pd sound examples"
},
{
id: "doc/manuals/2.Image",
title: "Image",
description: "3D graphics with GEM"
},
{
id: "doc/manuals/3.Networking",
title: "Networking",
description: "introduction to Pd's networking facilities"
},
// External libraries
// NOTE: These are just some popular examples. Pd-L2Ork ships with
// many external libraries, too many to list them all. Feel free
// to edit this list as needed.
{
title: "Externals",
},
{ {
id: "extra/cyclone", id: "extra/cyclone",
title: "Cyclone", title: "Cyclone",
...@@ -94,6 +142,11 @@ var toc = [ ...@@ -94,6 +142,11 @@ var toc = [
title: "GEM", title: "GEM",
description: "Graphics Environment for Multimedia (OpenGL graphics in Pd)" description: "Graphics Environment for Multimedia (OpenGL graphics in Pd)"
}, },
{
id: "extra/lyon",
title: "LyonPotpourri",
description: "Eric Lyon's external collection"
},
]; ];
// Stop-gap translator // Stop-gap translator
...@@ -172,16 +225,24 @@ function display_toc() { ...@@ -172,16 +225,24 @@ function display_toc() {
text_node; text_node;
toc.forEach(function(doc, i, a) { toc.forEach(function(doc, i, a) {
div = document.createElement("div"); div = document.createElement("div");
a = document.createElement("a"); if (doc.id) {
a.href = "javascript: click_toc('" + doc.id + "');"; a = document.createElement("a");
a.textContent = doc.title; a.href = "javascript: click_toc('" + doc.id + "');";
// set title to path for tooltip a.textContent = doc.title;
a.title = doc.id; // set title to path for tooltip
header = document.createElement("h3"); a.title = doc.id;
header.appendChild(a); header = document.createElement("h3");
text_node = document.createTextNode(doc.description?doc.description:"no description"); header.appendChild(a);
div.appendChild(header); text_node = document.createTextNode(doc.description?doc.description:"no description");
div.appendChild(text_node); div.appendChild(header);
div.appendChild(text_node);
} else {
// make a session title
header = document.createElement("h2");
text_node = document.createTextNode(doc.title);
header.appendChild(text_node);
div.appendChild(header);
}
results_elem.appendChild(div); results_elem.appendChild(div);
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment