diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-10-13 10:53:51 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-10-13 10:53:51 +0200 |
commit | 26fad5b8888d0cc5ce271abe568ac45640dea96b (patch) | |
tree | 35b8b75a62c4f61370a89c41654a740c4d3131db | |
parent | f049576575ccb71d50064a92882de4cf23e1c52f (diff) | |
download | gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.zip gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.tar.gz gitbook-26fad5b8888d0cc5ce271abe568ac45640dea96b.tar.bz2 |
Remove ref to github options
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | lib/parse/renderer.js | 17 |
2 files changed, 5 insertions, 20 deletions
@@ -62,10 +62,6 @@ Here are the options that can be stored in this file: // It's not advised this option in the book.json "extension": null, - // GitHub information (defaults are extracted using git) - "github": null, - "githubHost": "https://github.com/", - // Plugins list, can contain "-name" for removing default plugins "plugins": [], @@ -119,10 +115,10 @@ Here are the options that can be stored in this file: "top": 36, "bottom": 36 }, - + //Header HTML template. Available variables: _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_. "headerTemplate": null, - + //Footer HTML template. Available variables: _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_. "footerTemplate": null } diff --git a/lib/parse/renderer.js b/lib/parse/renderer.js index e6854f2..faa416c 100644 --- a/lib/parse/renderer.js +++ b/lib/parse/renderer.js @@ -56,20 +56,9 @@ GitBookRenderer.prototype.link = function(href, title, text) { var o = this._extra_options; // Relative link, rewrite it to point to github repo - if(links.isRelative(_href)) { - if (path.extname(parsed.path) == ".md") { - _href = links.toAbsolute(_href, o.dir || "./", o.outdir || "./"); - - if (o.singleFile) { - _href = "#"+_href; - } else { - _href = _href.replace(".md", ".html"); - } - } else if (o && o.repo && o.dir) { - href = url.resolve('https://github.com/' + o.repo + '/blob/', [o.dir, _href].join("/")); - parsed = url.parse(href); - _href = parsed.href; - } + if(links.isRelative(_href) && path.extname(parsed.path) == ".md") { + _href = links.toAbsolute(_href, o.dir || "./", o.outdir || "./"); + _href = _href.replace(".md", ".html"); } // Generate HTML for link |