From 7142d623da92435163cb40c2f10cf1c703a10ea7 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Fri, 13 Jan 2017 10:34:32 +0100 Subject: [PATCH] documentation: use version-specific project URLs --- index.js | 4 ++-- scripts/version-urls | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 65211172..e3b0f419 100644 --- a/index.js +++ b/index.js @@ -3532,9 +3532,9 @@ //. [Z.map]: v:sanctuary-js/sanctuary-type-classes#map //. [`of`]: v:fantasyland/fantasy-land#of-method //. [parseInt]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt -//. [sanctuary-def]: https://github.com/sanctuary-js/sanctuary-def +//. [sanctuary-def]: v:sanctuary-js/sanctuary-def //. [thrush]: https://github.com/raganwald-deprecated/homoiconic/blob/master/2008-10-30/thrush.markdown -//. [type identifier]: https://github.com/sanctuary-js/sanctuary-type-identifiers +//. [type identifier]: v:sanctuary-js/sanctuary-type-identifiers //. //. [`Either#fantasy-land/bimap`]: #Either.prototype.fantasy-land/bimap //. [`Either#fantasy-land/map`]: #Either.prototype.fantasy-land/map diff --git a/scripts/version-urls b/scripts/version-urls index f2613413..c608a8fb 100755 --- a/scripts/version-urls +++ b/scripts/version-urls @@ -10,11 +10,13 @@ var pkg = require('../package.json'); var deps = Object.assign({}, pkg.dependencies, pkg.devDependencies); process.stdout.write(fs.readFileSync(process.argv[2], 'utf8').replace( - new RegExp(' v:(.+)/(.+)#(.+)', 'g'), - function(_, owner, name, id) { + new RegExp(' v:(.+)/(.+)', 'g'), + function(_, owner, rest) { + var parts = rest.split(/(?=#)/); + var name = parts[0]; if (name in deps && /^\d+[.]\d+[.]\d+$/.test(deps[name])) { return ' https://github.com/' + owner + '/' + name + - '/tree/v' + deps[name] + '#' + id; + '/tree/v' + deps[name] + parts.slice(1).join(''); } process.stderr.write('Exact version not specified for ' + name + '\n'); process.exit(1);