Skip to content

Commit

Permalink
Sort tutorials.
Browse files Browse the repository at this point in the history
Name all tutorials in one file.

Ensure that they are displayed in the same order as they are named
in the JSON file.

Change-Id: I013bcd987e564ea9f345dd80bd1497b55296713a
  • Loading branch information
joeyparrish committed Apr 16, 2015
1 parent 1723ba0 commit 2125330
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 21 deletions.
2 changes: 2 additions & 0 deletions third_party/jsdoc/lib/jsdoc/tutorial/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function addTutorialConf(name, meta) {
if (hasOwnProp.call(conf, name)) {
logger.warn('Metadata for the tutorial %s is defined more than once. Only the first definition will be used.', name );
} else {
meta.index = Object.keys(conf).length;
conf[name] = meta;
}
} else {
Expand Down Expand Up @@ -169,6 +170,7 @@ exports.resolve = function() {
}

item = conf[name];
current.index = item.index;

// set title
if (item.title) {
Expand Down
5 changes: 5 additions & 0 deletions third_party/jsdoc/templates/default/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ function buildNav(members) {
globalNav = '';

if (members.tutorials.length) {
members.tutorials.sort(function(a, b) {
if (a.index < b.index) return -1;
if (a.index > b.index) return 1;
return 0;
});
nav += '<h3>Tutorials</h3><ul>';
members.tutorials.forEach(function(t) {
nav += '<li>' + tutoriallink(t.name) + '</li>';
Expand Down
3 changes: 0 additions & 3 deletions tutorials/caveats.json

This file was deleted.

3 changes: 0 additions & 3 deletions tutorials/dev.json

This file was deleted.

9 changes: 9 additions & 0 deletions tutorials/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{ "intro": { "title": "Intro to DASH Streams" } },
{ "player": { "title": "DASH Playback with the Shaka Player" } },
{ "windows": { "title": "Building on Windows" } },
{ "language": { "title": "Language Support" } },
{ "dev": { "title": "Shaka Player Development" } },
{ "polyfills": { "title": "Polyfills" } },
{ "caveats": { "title": "Content Restrictions" } }
]
3 changes: 0 additions & 3 deletions tutorials/intro.json

This file was deleted.

3 changes: 0 additions & 3 deletions tutorials/language.json

This file was deleted.

3 changes: 0 additions & 3 deletions tutorials/player.json

This file was deleted.

3 changes: 0 additions & 3 deletions tutorials/polyfills.json

This file was deleted.

3 changes: 0 additions & 3 deletions tutorials/windows.json

This file was deleted.

0 comments on commit 2125330

Please sign in to comment.