Permalink
Browse files

Fix dead links on TOC page

GitHub helpfully renders the .md files in /doc, but the previous version
of _toc linked to <pagename>.html, which failed. Switching the links to
.md made the links work on github, but broke them in the generated
documentation.

Instead, switch links to .md but replace .md with .html in the doctool.

Tested by generating documentation locally - links work.

Fixes: #161
PR-URL: #171
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
  • Loading branch information...
1 parent 56852a2 commit 84cbec06dc7025e7898384550b31743cbb8cefaa @jamescgibson jamescgibson committed with trevnorris Nov 10, 2015
Showing with 8 additions and 7 deletions.
  1. +1 −0 build/doctool.js
  2. +7 −7 doc/md/_toc.md
View
@@ -85,6 +85,7 @@ function convertData(data) {
// Convert it to HTML from Markdown
var html = markdown.toHTML(markdown.parse(data), {xhtml:true})
.replace(/<hr><\/hr>/g, "<hr />")
+ .replace(/\.md/g, ".html")
.replace(/(\<h[2-6])\>([^<]+)(\<\/h[1-6]\>)/gmi, function(o, ts, c, te) {
return ts+' id="'+formatIdString(c)+'">'+c+te;
});
View
@@ -1,9 +1,9 @@
## Table of Contents
-* [Overview](overview.html)
-* [Core](core.html)
-* [Vector](vector.html)
-* [Special Functions](special-functions.html)
-* [Distributions](distributions.html)
-* [Linear Algebra](linear-algebra.html)
-* [Statistical Tests](test.html)
+* [Overview](overview.md)
+* [Core](core.md)
+* [Vector](vector.md)
+* [Special Functions](special-functions.md)
+* [Distributions](distributions.md)
+* [Linear Algebra](linear-algebra.md)
+* [Statistical Tests](test.md)

0 comments on commit 84cbec0

Please sign in to comment.