Skip to content

Commit

Permalink
Rename mdast-github > remark-github
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 24, 2015
1 parent 63cdcab commit 811ce91
Show file tree
Hide file tree
Showing 28 changed files with 351 additions and 213 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ build/
components/
coverage/
build.js
mdast-lint.js
mdast-lint.min.js
remark-lint.js
remark-lint.min.js
4 changes: 2 additions & 2 deletions .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"coverage/",
"node_modules/",
"build.js",
"mdast-lint.js",
"mdast-lint.min.js"
"remark-lint.js",
"remark-lint.min.js"
],
"jsDoc": {
"checkAnnotations": "jsdoc3",
Expand Down
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "mdast-lint",
"main": "mdast-lint.js",
"description": "Lint markdown with mdast",
"name": "remark-lint",
"main": "remark-lint.js",
"description": "Lint markdown with remark",
"license": "MIT",
"keywords": [
"markdown",
"lint",
"validate",
"mdast"
"remark"
],
"repository": {
"type": "git",
"url": "https://github.com/wooorm/mdast-lint.git"
"url": "https://github.com/wooorm/remark-lint.git"
},
"authors": [
"Titus Wormer <tituswormer@gmail.com>"
Expand Down
8 changes: 4 additions & 4 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "mdast-lint",
"name": "remark-lint",
"version": "1.1.1",
"description": "Lint markdown with mdast",
"description": "Lint markdown with remark",
"license": "MIT",
"keywords": [
"markdown",
"lint",
"validate",
"mdast"
"remark"
],
"repository": "wooorm/mdast-lint",
"repository": "wooorm/remark-lint",
"dependencies": {
"sindresorhus/plur": "^2.0.0",
"wooorm/mdast-range": "^1.0.0",
Expand Down
12 changes: 6 additions & 6 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
Dependencies:

```javascript
var mdast = require('mdast');
var lint = require('mdast-lint');
var processor = mdast().use(lint);
var remark = require('remark');
var lint = require('remark-lint');
var processor = remark().use(lint);
```

Example document.
Expand Down Expand Up @@ -49,10 +49,10 @@ processor.process(doc, function (err, file, res) {
});
```

## [mdast](https://github.com/wooorm/mdast#api).[use](https://github.com/wooorm/mdast#mdastuseplugin-options)(lint, options)
## [remark](https://github.com/wooorm/remark#api).[use](https://github.com/wooorm/remark#remarkuseplugin-options)(lint, options)

Adds warnings for style violations to a given [virtual file](https://github.com/wooorm/mdast/blob/master/doc/mdast.3.md#file)
using mdast’s [warning API](https://github.com/wooorm/mdast/blob/master/doc/mdast.3.md#filewarnreason-position).
Adds warnings for style violations to a given [virtual file](https://github.com/wooorm/remark/blob/master/doc/remark.3.md#file)
using remark’s [warning API](https://github.com/wooorm/remark/blob/master/doc/remark.3.md#filewarnreason-position).

When processing a file, these warnings are available at `file.messages`, and
look as follows:
Expand Down
8 changes: 4 additions & 4 deletions doc/comparison/markdownlint.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This table documents the similarity and difference between
[**markdownlint**](https://github.com/mivok/markdownlint/blob/master/docs/RULES.md)
rules and **mdast-lint**’s rules.
rules and **remark-lint**’s rules.

| markdownlint | mdast | note |
| markdownlint | remark | note |
| ------------ | ----------------------------- | ---------------------------------------------------------------------------------------- |
| MD001 | heading-increment | |
| MD002 | first-heading-level | |
Expand All @@ -30,14 +30,14 @@ rules and **mdast-lint**’s rules.
| MD026 | no-heading-punctuation | |
| MD027 | blockquote-indentation | Won’t warn when that’s your preferred, consistent style |
| MD028 | no-blockquote-without-caret | |
| MD029 | ordered-list-marker-value | markdownlint defaults to `one`, whereas mdast-lint defaults to `ordered` |
| MD029 | ordered-list-marker-value | markdownlint defaults to `one`, whereas remark-lint defaults to `ordered` |
| MD030 | list-item-indent | |
| MD031 | no-missing-blank-lines | |
| MD032 | no-missing-blank-lines | |
| MD033 | no-html | |
| MD034 | no-literal-urls | |
| MD035 | rule-style | |
| MD036 | emphasis-heading | mdast-lint only warns when the emphasis is followed by a colon, but that might change. |
| MD036 | emphasis-heading | remark-lint only warns when the emphasis is followed by a colon, but that might change. |
| MD037 | no-inline-padding | |
| MD038 | no-inline-padding | |
| MD039 | no-inline-padding | |
Expand Down
64 changes: 32 additions & 32 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,78 @@
1.1.1 / 2015-09-12
==================

* Add support for camel-case properties ([35c4066](https://github.com/wooorm/mdast-lint/commit/35c4066))
* Add support for camel-case properties ([35c4066](https://github.com/wooorm/remark-lint/commit/35c4066))

1.1.0 / 2015-08-31
==================

* Add en- and disabling multiple rules in one comment ([29976d0](https://github.com/wooorm/mdast-lint/commit/29976d0))
* Replace `vfile` patching of data with vfile-namespaces ([c1136a1](https://github.com/wooorm/mdast-lint/commit/c1136a1))
* Add en- and disabling multiple rules in one comment ([29976d0](https://github.com/wooorm/remark-lint/commit/29976d0))
* Replace `vfile` patching of data with vfile-namespaces ([c1136a1](https://github.com/wooorm/remark-lint/commit/c1136a1))

1.0.0 / 2015-08-17
==================

* Update dependencies ([4936d35](https://github.com/wooorm/mdast-lint/commit/4936d35))
* Update dependencies ([4936d35](https://github.com/wooorm/remark-lint/commit/4936d35))

0.4.5 / 2015-08-08
==================

* Fix typo in definition-case warning ([490ac16](https://github.com/wooorm/mdast-lint/commit/490ac16))
* Fix typo in definition-case warning ([490ac16](https://github.com/wooorm/remark-lint/commit/490ac16))

0.4.4 / 2015-08-05
==================

* Remove maximum-line-length warnings on definitions ([1119ca8](https://github.com/wooorm/mdast-lint/commit/1119ca8))
* Add `linter-markdown` to `readme.md` ([7de8847](https://github.com/wooorm/mdast-lint/commit/7de8847))
* Remove maximum-line-length warnings on definitions ([1119ca8](https://github.com/wooorm/remark-lint/commit/1119ca8))
* Add `linter-markdown` to `readme.md` ([7de8847](https://github.com/wooorm/remark-lint/commit/7de8847))

0.4.3 / 2015-08-04
==================

* Fix failure on block-quotes without children ([a9aaff7](https://github.com/wooorm/mdast-lint/commit/a9aaff7))
* Update mdast dev-dependency ([34df79c](https://github.com/wooorm/mdast-lint/commit/34df79c))
* Add vfile as a dev-dependency ([84d1ce3](https://github.com/wooorm/mdast-lint/commit/84d1ce3))
* Fix failure on block-quotes without children ([a9aaff7](https://github.com/wooorm/remark-lint/commit/a9aaff7))
* Update mdast dev-dependency ([34df79c](https://github.com/wooorm/remark-lint/commit/34df79c))
* Add vfile as a dev-dependency ([84d1ce3](https://github.com/wooorm/remark-lint/commit/84d1ce3))

0.4.2 / 2015-07-12
==================

* Remove peer-dependencies ([8d70fcf](https://github.com/wooorm/mdast-lint/commit/8d70fcf))
* Remove peer-dependencies ([8d70fcf](https://github.com/wooorm/remark-lint/commit/8d70fcf))

0.4.1 / 2015-07-05
==================

* Remove component support ([58d7e6b](https://github.com/wooorm/mdast-lint/commit/58d7e6b))
* Refactor to externalise `lib/utilities/` ([eb78529](https://github.com/wooorm/mdast-lint/commit/eb78529))
* Remove component support ([58d7e6b](https://github.com/wooorm/remark-lint/commit/58d7e6b))
* Refactor to externalise `lib/utilities/` ([eb78529](https://github.com/wooorm/remark-lint/commit/eb78529))

0.4.0 / 2015-06-29
==================

* Add gap support ([136e760](https://github.com/wooorm/mdast-lint/commit/136e760))
* Update mdast ([2d122e4](https://github.com/wooorm/mdast-lint/commit/2d122e4))
* Add gap support ([136e760](https://github.com/wooorm/remark-lint/commit/136e760))
* Update mdast ([2d122e4](https://github.com/wooorm/remark-lint/commit/2d122e4))

0.3.0 / 2015-06-20
==================

* Add checkbox-content-indent rule ([7b55519](https://github.com/wooorm/mdast-lint/commit/7b55519))
* Fix dot-files from being read as fixtures ([ecbec2c](https://github.com/wooorm/mdast-lint/commit/ecbec2c))
* Add checkbox-character-style rule ([7ed4579](https://github.com/wooorm/mdast-lint/commit/7ed4579))
* Fix tests for invalid position given my mdast-range ([55d1128](https://github.com/wooorm/mdast-lint/commit/55d1128))
* Add missing jsdoc comment ([63b83b9](https://github.com/wooorm/mdast-lint/commit/63b83b9))
* Update eslint ([a3b0829](https://github.com/wooorm/mdast-lint/commit/a3b0829))
* Update mdast, mdast-yaml-config ([52bac04](https://github.com/wooorm/mdast-lint/commit/52bac04))
* Add checkbox-content-indent rule ([7b55519](https://github.com/wooorm/remark-lint/commit/7b55519))
* Fix dot-files from being read as fixtures ([ecbec2c](https://github.com/wooorm/remark-lint/commit/ecbec2c))
* Add checkbox-character-style rule ([7ed4579](https://github.com/wooorm/remark-lint/commit/7ed4579))
* Fix tests for invalid position given my mdast-range ([55d1128](https://github.com/wooorm/remark-lint/commit/55d1128))
* Add missing jsdoc comment ([63b83b9](https://github.com/wooorm/remark-lint/commit/63b83b9))
* Update eslint ([a3b0829](https://github.com/wooorm/remark-lint/commit/a3b0829))
* Update mdast, mdast-yaml-config ([52bac04](https://github.com/wooorm/remark-lint/commit/52bac04))

0.2.0 / 2015-06-13
==================

* Remove mdast-usage, add mdast-yaml-config as dependencies ([053674f](https://github.com/wooorm/mdast-lint/commit/053674f))
* Add images to blacklist for maximum-line-length ([ba6d270](https://github.com/wooorm/mdast-lint/commit/ba6d270))
* Refactor to use rawgit references to images in `readme.md` ([3f6344c](https://github.com/wooorm/mdast-lint/commit/3f6344c))
* Add support for external rules ([5162a09](https://github.com/wooorm/mdast-lint/commit/5162a09))
* Refactor additional, fileless, rules support ([6d2ba65](https://github.com/wooorm/mdast-lint/commit/6d2ba65))
* Adds support for automatic doc generation for file-less rules ([29965a3](https://github.com/wooorm/mdast-lint/commit/29965a3))
* Add `reset` docs to rule generation script ([77b8bfd](https://github.com/wooorm/mdast-lint/commit/77b8bfd))
* Adds `reset` rule to docs ([90a5f8a](https://github.com/wooorm/mdast-lint/commit/90a5f8a))
* Update wording re rules in `readme.md` ([00d9ba4](https://github.com/wooorm/mdast-lint/commit/00d9ba4))
* Update rule count in `readme.md` ([f937cf4](https://github.com/wooorm/mdast-lint/commit/f937cf4))
* Remove mdast-usage, add mdast-yaml-config as dependencies ([053674f](https://github.com/wooorm/remark-lint/commit/053674f))
* Add images to blacklist for maximum-line-length ([ba6d270](https://github.com/wooorm/remark-lint/commit/ba6d270))
* Refactor to use rawgit references to images in `readme.md` ([3f6344c](https://github.com/wooorm/remark-lint/commit/3f6344c))
* Add support for external rules ([5162a09](https://github.com/wooorm/remark-lint/commit/5162a09))
* Refactor additional, fileless, rules support ([6d2ba65](https://github.com/wooorm/remark-lint/commit/6d2ba65))
* Adds support for automatic doc generation for file-less rules ([29965a3](https://github.com/wooorm/remark-lint/commit/29965a3))
* Add `reset` docs to rule generation script ([77b8bfd](https://github.com/wooorm/remark-lint/commit/77b8bfd))
* Adds `reset` rule to docs ([90a5f8a](https://github.com/wooorm/remark-lint/commit/90a5f8a))
* Update wording re rules in `readme.md` ([00d9ba4](https://github.com/wooorm/remark-lint/commit/00d9ba4))
* Update rule count in `readme.md` ([f937cf4](https://github.com/wooorm/remark-lint/commit/f937cf4))

0.1.0 / 2015-06-11
==================
4 changes: 2 additions & 2 deletions 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:lint
* @fileoverview Lint markdown with mdast.
* @module remark:lint
* @fileoverview Lint markdown with remark.
*/

'use strict';
Expand Down
8 changes: 4 additions & 4 deletions lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:lint:filter
* @fileoverview mdast plug-in used internally by
* mdast-lint to filter ruleId’s by enabled and disabled
* @module remark:lint:filter
* @fileoverview remark plug-in used internally by
* remark-lint to filter ruleId’s by enabled and disabled
* ranges, or by gaps.
* @todo Externalise into its own repository.
*/
Expand All @@ -25,7 +25,7 @@ function transformer(ast, file) {
var gaps = [];
var offset = 0;
var isGap = false;
var scope = file.namespace('mdast-lint').ranges;
var scope = file.namespace('remark-lint').ranges;

if (!file || !file.messages || !file.messages.length) {
return;
Expand Down
32 changes: 16 additions & 16 deletions lib/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:lint:library
* @fileoverview mdast plug-in providing warnings when
* @module remark:lint:library
* @fileoverview remark plug-in providing warnings when
* detecting style violations.
*/

Expand Down Expand Up @@ -44,22 +44,22 @@ var cwd = process && process.cwd();
*/
function attachFactory(id, rule, options) {
/**
* Attach the rule to an mdast instance, unless `false`
* Attach the rule to a remark instance, unless `false`
* is passed as an option.
*
* @return {Function?} - See `plugin` below.
*/
function attach() {
/**
* Attach the rule to an mdast instance, unless `false`
* Attach the rule to a remark instance, unless `false`
* is passed as an option.
*
* @param {Node} ast - Root node.
* @param {File} [file] - Virtual file.
* @param {Function} next - Signal end.
*/
function plugin(ast, file, next) {
var scope = file.namespace('mdast-lint');
var scope = file.namespace('remark-lint');

/*
* Track new messages per file.
Expand Down Expand Up @@ -200,15 +200,15 @@ function decamelizeSettings(source) {
* a non-nully and non-false value.
*
* @example
* var processor = lint(mdast, {
* var processor = lint(remark, {
* 'html': false // Ignore HTML warnings.
* });
*
* @param {MDAST} mdast - Host object.
* @param {Remark} remark - Host object.
* @param {Object?} options - Hash of rule names mapping to
* rule options.
*/
function lint(mdast, options) {
function lint(remark, options) {
var settings = decamelizeSettings(options || {});
var reset = settings.reset;
var rules = loadExternals(settings.external);
Expand All @@ -219,7 +219,7 @@ function lint(mdast, options) {
* Ensure offset information is added.
*/

mdast.use(range);
remark.use(range);

/**
* Get the latest state of a rule.
Expand All @@ -228,7 +228,7 @@ function lint(mdast, options) {
* @param {File} [file] - File (optional)
*/
function getState(ruleId, file) {
var scope = file && file.namespace('mdast-lint');
var scope = file && file.namespace('remark-lint');
var ranges = scope && scope.ranges && scope.ranges[ruleId];

if (ranges) {
Expand All @@ -250,7 +250,7 @@ function lint(mdast, options) {
* @param {File} file - Virtual file.
*/
function store(file) {
var scope = file.namespace('mdast-lint');
var scope = file.namespace('remark-lint');
var ranges = scope.ranges;
var ruleId;

Expand All @@ -271,7 +271,7 @@ function lint(mdast, options) {
}
}

mdast.use(function () {
remark.use(function () {
return function (ast, file) {
store(file);
};
Expand All @@ -282,7 +282,7 @@ function lint(mdast, options) {
*/

for (id in rules) {
mdast.use(attachFactory(id, rules[id], settings[id]));
remark.use(attachFactory(id, rules[id], settings[id]));
}

/**
Expand All @@ -294,7 +294,7 @@ function lint(mdast, options) {
* @param {*} ruleId - Rule to toggle.
*/
function toggle(file, marker, type, ruleId) {
var scope = file.namespace('mdast-lint');
var scope = file.namespace('remark-lint');
var markers;
var currentState;
var previousState;
Expand Down Expand Up @@ -345,7 +345,7 @@ function lint(mdast, options) {
}
}

mdast.use(zone({
remark.use(zone({
'name': 'lint',
'onparse': onparse
}));
Expand All @@ -354,7 +354,7 @@ function lint(mdast, options) {
* Filter.
*/

mdast.use(filter);
remark.use(filter);

/**
* Transformer sort messages.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @fileoverview
* Warn when HTML nodes are used.
*
* Ignores comments, because they are used by this tool, mdast, and
* Ignores comments, because they are used by this tool, remark, and
* because markdown doesn’t have native comments.
* @example
* <!-- Invalid: -->
Expand Down
1 change: 0 additions & 1 deletion mdast-lint.min.js

This file was deleted.

Loading

0 comments on commit 811ce91

Please sign in to comment.