Skip to content

Commit

Permalink
Merge pull request #324 from sanctuary-js/dc-version-urls
Browse files Browse the repository at this point in the history
documentation: use version-specific project URLs
  • Loading branch information
davidchambers committed Jan 14, 2017
2 parents 7e9a622 + 7142d62 commit 62877fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions scripts/version-urls
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 62877fc

Please sign in to comment.