Skip to content

Commit

Permalink
Rename mdast-validate-links > remark-validate-links
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 24, 2015
1 parent f8fc60d commit c9e9391
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 53 deletions.
18 changes: 9 additions & 9 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@
1.1.1 / 2015-09-18
==================

* Add support for future changes in unified ([fab6a89](https://github.com/wooorm/mdast-validate-links/commit/fab6a89))
* Add related section, table-of-contents ([0b6c35b](https://github.com/wooorm/mdast-validate-links/commit/0b6c35b))
* Add support for future changes in unified ([fab6a89](https://github.com/wooorm/remark-validate-links/commit/fab6a89))
* Add related section, table-of-contents ([0b6c35b](https://github.com/wooorm/remark-validate-links/commit/0b6c35b))

1.1.0 / 2015-09-07
==================

* Add support for changes in mdast-slug ([8749876](https://github.com/wooorm/mdast-validate-links/commit/8749876))
* Update test fixtures for updates in mdast ([e9b32d4](https://github.com/wooorm/mdast-validate-links/commit/e9b32d4))
* Add support for changes in mdast-slug ([8749876](https://github.com/wooorm/remark-validate-links/commit/8749876))
* Update test fixtures for updates in mdast ([e9b32d4](https://github.com/wooorm/remark-validate-links/commit/e9b32d4))

1.0.0 / 2015-08-20
==================

* Update dependencies, dev-dependencies ([986797a](https://github.com/wooorm/mdast-validate-links/commit/986797a))
* Update dependencies, dev-dependencies ([986797a](https://github.com/wooorm/remark-validate-links/commit/986797a))

0.3.1 / 2015-07-27
==================

* Fix for changes in mdast ([e9702cf](https://github.com/wooorm/mdast-validate-links/commit/e9702cf))
* Fix for changes in mdast ([e9702cf](https://github.com/wooorm/remark-validate-links/commit/e9702cf))

0.3.0 / 2015-07-26
==================

* Add suggestions for similar references on failure ([ddabfe2](https://github.com/wooorm/mdast-validate-links/commit/ddabfe2))
* Add suggestions for similar references on failure ([ddabfe2](https://github.com/wooorm/remark-validate-links/commit/ddabfe2))

0.2.1 / 2015-07-19
==================

* Update mdast ([10411ef](https://github.com/wooorm/mdast-validate-links/commit/10411ef))
* Update mdast ([10411ef](https://github.com/wooorm/remark-validate-links/commit/10411ef))

0.2.0 / 2015-07-19
==================

* Add support for inspecting referenced files ([763c0d1](https://github.com/wooorm/mdast-validate-links/commit/763c0d1))
* Add support for inspecting referenced files ([763c0d1](https://github.com/wooorm/remark-validate-links/commit/763c0d1))

0.1.0 / 2015-07-18
==================
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:validate-links
* @module remark:validate-links
* @fileoverview Validate links to headings and files in markdown.
*/

Expand Down Expand Up @@ -284,7 +284,7 @@ function gatherExposedFactory() {
function done() {
if (hasHeadings && !hasSlugs) {
throw new Error(
'Missing slugs. Use for example `mdast-slug` to generate ' +
'Missing slugs. Use for example `remark-slug` to generate ' +
'heading IDs'
);
}
Expand Down Expand Up @@ -371,7 +371,7 @@ function validate(exposed, file, project) {
/*
* Check if files without `hash` can be linked to.
* Because there’s no need to inspect those files
* for headings they are not added to mdast. This
* for headings they are not added to remark. This
* is especially useful because they might be
* non-markdown files. Here we check if they exist.
*/
Expand Down Expand Up @@ -448,7 +448,7 @@ function completerFactory(project) {
done();
}

completer.pluginId = 'mdast-validate-links';
completer.pluginId = 'remark-validate-links';

return completer;
}
Expand Down Expand Up @@ -513,16 +513,16 @@ function transformerFactory(project, fileSet) {
* Attacher.
*
* @example
* attacher(mdast())
* // [Error: mdast-validate-links only works on the CLI]
* attacher(remark())
* // [Error: remark-validate-links only works on the CLI]
*
* @param {MDAST} mdast - Processor.
* @param {Remark} remark - Processor.
* @param {Object?} options - Settings.
* @param {FileSet?} fileSet - Virtual file-set.
* @throws {Error} - When `fileSet` is not given (when not on
* the CLI).
*/
function attacher(mdast, options, fileSet) {
function attacher(remark, options, fileSet) {
var repo = (options || {}).repository;
var pack;

Expand All @@ -531,7 +531,7 @@ function attacher(mdast, options, fileSet) {
*/

if (!fileSet) {
throw new Error('mdast-validate-links only works on the CLI');
throw new Error('remark-validate-links only works on the CLI');
}

/*
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mdast-validate-links",
"name": "remark-validate-links",
"version": "1.1.1",
"description": "Validate links to headings and files in markdown",
"license": "MIT",
Expand All @@ -9,17 +9,17 @@
"reference",
"file",
"heading",
"mdast"
"remark"
],
"dependencies": {
"github-url-to-object": "^2.1.0",
"mdast-slug": "^2.0.0",
"remark-slug": "^3.0.0",
"mdast-util-definitions": "^1.0.0",
"unist-util-visit": "^1.0.0",
"propose": "0.0.5",
"urljoin": "^0.1.5"
},
"repository": "wooorm/mdast-validate-links",
"repository": "wooorm/remark-validate-links",
"author": "Titus Wormer <tituswormer@gmail.com>",
"files": [
"index.js"
Expand All @@ -30,10 +30,10 @@
"istanbul": "^0.4.0",
"jscs": "^2.0.0",
"jscs-jsdoc": "^1.0.0",
"mdast": "^2.2.2",
"mdast-comment-config": "^1.0.0",
"mdast-github": "^1.0.0",
"mdast-lint": "^1.0.0",
"mdast": "^3.0.0-alpha.5",
"mdast-comment-config": "^2.0.0-alpha.1",
"mdast-github": "^2.0.0-alpha.1",
"mdast-lint": "^2.0.0-alpha.1",
"mdast-toc": "^1.0.0",
"mocha": "^2.0.0"
},
Expand Down
30 changes: 15 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mdast-validate-links [![Build Status](https://img.shields.io/travis/wooorm/mdast-validate-links.svg)](https://travis-ci.org/wooorm/mdast-validate-links) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/mdast-validate-links.svg)](https://codecov.io/github/wooorm/mdast-validate-links)
# remark-validate-links [![Build Status](https://img.shields.io/travis/wooorm/remark-validate-links.svg)](https://travis-ci.org/wooorm/remark-validate-links) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/remark-validate-links.svg)](https://codecov.io/github/wooorm/remark-validate-links)

[**mdast**](https://github.com/wooorm/mdast) plug-in to validate if links to
[**remark**](https://github.com/wooorm/remark) plug-in to validate if links to
headings and files in markdown point to existing things.

For example, this document does not have a heading named `Hello`. So if I
Expand All @@ -27,18 +27,18 @@ is fine.
[npm](https://docs.npmjs.com/cli/install):

```bash
npm install mdast-validate-links
npm install remark-validate-links
```

## Command line

![Example of how mdast-validate-links looks on screen](https://cdn.rawgit.com/wooorm/mdast-validate-links/master/screenshot.png)
![Example of how remark-validate-links looks on screen](https://cdn.rawgit.com/wooorm/remark-validate-links/master/screenshot.png)

Use **mdast-validate-links** together with [**mdast**](https://github.com/wooorm/mdast)
and [**mdast-slug**](https://github.com/wooorm/mdast-slug):
Use **remark-validate-links** together with [**remark**](https://github.com/wooorm/remark)
and [**remark-slug**](https://github.com/wooorm/remark-slug):

```bash
npm install --global mdast mdast-slug mdast-validate-links
npm install --global remark remark-slug remark-validate-links
```

Let’s say `readme.md` is this document, and `example.md` looks as follows:
Expand All @@ -55,10 +55,10 @@ But this does exist: [LICENSE](LICENSE).
So does this: [README](readme.md#installation).
```

Then, to run **mdast-validate-links** on `example.md` and `readme.md`:
Then, to run **remark-validate-links** on `example.md` and `readme.md`:

```bash
mdast -u mdast-slug -u mdast-validate-links example.md
remark -u remark-slug -u remark-validate-links example.md
#
# Yields:
#
Expand All @@ -71,25 +71,25 @@ mdast -u mdast-slug -u mdast-validate-links example.md

## Programmatic

This plug-in is **not** available on the API of mdast.
This plug-in is **not** available on the API of remark.

## Configuration

You can pass a `repository`, containing anything `package.json`s
[`repository`](https://docs.npmjs.com/files/package.json#repository) can
handle. If this is omitted, **mdast-validate-links** will try
handle. If this is omitted, **remark-validate-links** will try
the `package.json` in your current working directory.

```bash
mdast --use 'validate-links=repository:"foo/bar"' example.md
remark --use 'validate-links=repository:"foo/bar"' example.md
```

When a repository is given or detected, links to GitHub are normalized
to the file-system. E.g., `https://github.com/foo/bar/blob/master/example.md`
becomes `example.md`.

You can define this repository in `.mdastrc` or `package.json` [files](https://github.com/wooorm/mdast/blob/master/doc/mdastrc.5.md)
too. An example `.mdastrc` file could look as follows:
You can define this repository in `.remarkrc` or `package.json` [files](https://github.com/wooorm/remark/blob/master/doc/remarkrc.5.md)
too. An example `.remarkrc` file could look as follows:

```json
{
Expand All @@ -106,7 +106,7 @@ too. An example `.mdastrc` file could look as follows:

## Related

* [`mdast-lint`](https://github.com/wooorm/mdast-lint)
* [`remark-lint`](https://github.com/wooorm/remark-lint)
— Markdown code style linter.

## License
Expand Down
24 changes: 12 additions & 12 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:validate-links:test
* @fileoverview Test suite for `mdast-validate-links`.
* @module remark:validate-links:test
* @fileoverview Test suite for `remark-validate-links`.
*/

'use strict';
Expand Down Expand Up @@ -64,7 +64,7 @@ function test(config, callback) {
* Tests.
*/

describe('mdast-validate-links', function () {
describe('remark-validate-links', function () {
beforeEach(function () {
process.chdir('./test/fixtures');
});
Expand All @@ -76,7 +76,7 @@ describe('mdast-validate-links', function () {
it('should throw an error when not on the CLI', function () {
assert.throws(function () {
mdast().use(links);
}, /Error: mdast-validate-links only works on the CLI/);
}, /Error: remark-validate-links only works on the CLI/);
});

it('should warn when used without slugs', function (done) {
Expand All @@ -92,7 +92,7 @@ describe('mdast-validate-links', function () {
equal(res.stderr.split('\n').slice(0, 2).join('\n'), [
'example.md',
' 1:1 error Error: Missing slugs. Use for ' +
'example `mdast-slug` to generate heading IDs'
'example `remark-slug` to generate heading IDs'
].join('\n'));

done(err);
Expand All @@ -106,7 +106,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand All @@ -255,7 +255,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': {
'../../../node_modules/mdast-slug': null,
'../../../node_modules/remark-slug': null,
'../../../index.js': {
'repository': 'wooorm/test'
}
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand Down Expand Up @@ -436,7 +436,7 @@ describe('mdast-validate-links', function () {
'detectRC': false,
'detectIgnore': false,
'plugins': [
'../../../node_modules/mdast-slug',
'../../../node_modules/remark-slug',
'../../../index.js'
]
}, function (err, res) {
Expand Down

0 comments on commit c9e9391

Please sign in to comment.