Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: use version-specific project URLs #324

Merged
merged 1 commit into from
Jan 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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