-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0ed3b42
Showing
33 changed files
with
2,557 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"browser": true | ||
}, | ||
"rules": { | ||
"quotes": [2, "single"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
*.log | ||
bower_components/ | ||
build/ | ||
components/ | ||
coverage/ | ||
node_modules/ | ||
build.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
{ | ||
"plugins": [ | ||
"jscs-jsdoc" | ||
], | ||
"jsDoc": { | ||
"checkAnnotations": "jsdoc3", | ||
"checkParamNames": true, | ||
"requireParamTypes": true, | ||
"checkRedundantParams": true, | ||
"checkReturnTypes": true, | ||
"checkRedundantReturns": true, | ||
"requireReturnTypes": true, | ||
"checkTypes": "strictNativeCase", | ||
"checkRedundantAccess": true, | ||
"enforceExistence": true, | ||
"requireHyphenBeforeDescription": true | ||
}, | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInNamedFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireBlocksOnNewline": true, | ||
"disallowPaddingNewlinesInBlocks": true, | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInsideObjectBrackets": true, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"requireSpacesInsideObjectBrackets": "all", | ||
"disallowDanglingUnderscores": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireOperatorBeforeLineBreak": [ | ||
"?", | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==" | ||
], | ||
"requireSpaceAfterBinaryOperators": [ | ||
"+", | ||
"-", | ||
"/", | ||
"*", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==" | ||
], | ||
"disallowSpaceAfterPrefixUnaryOperators": [ | ||
"++", | ||
"--", | ||
"+", | ||
"-", | ||
"~", | ||
"!" | ||
], | ||
"disallowSpaceBeforePostfixUnaryOperators": [ | ||
"++", | ||
"--" | ||
], | ||
"disallowImplicitTypeConversion": [ | ||
"numeric", | ||
"boolean", | ||
"binary", | ||
"string" | ||
], | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"disallowKeywords": [ | ||
"with" | ||
], | ||
"disallowMultipleLineStrings": true, | ||
"disallowMultipleLineBreaks": true, | ||
"validateLineBreaks": "LF", | ||
"validateQuoteMarks": "'", | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowTrailingComma": true, | ||
"disallowKeywordsOnNewLine": [ | ||
"else" | ||
], | ||
"requireLineFeedAtFileEnd": true, | ||
"maximumLineLength": 78, | ||
"requireCapitalizedConstructors": true, | ||
"safeContextKeyword": "self", | ||
"requireDotNotation": true, | ||
"disallowYodaConditions": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"checkRedundantParams": true, | ||
"requireParamTypes": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.* | ||
*.log | ||
bower_components/ | ||
build/ | ||
components/ | ||
coverage/ | ||
node_modules/ | ||
test/ | ||
build.js | ||
example.js | ||
mdast-github.js | ||
mdast-github.min.js | ||
bower.json | ||
component.json | ||
History.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
language: node_js | ||
script: npm run-script test-travis | ||
node_js: | ||
- '0.10' | ||
- '0.11' | ||
- '0.12' | ||
- iojs | ||
after_script: npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls | ||
sudo: false | ||
deploy: | ||
provider: npm | ||
email: tituswormer@gmail.com | ||
api_key: | ||
secure: eXE7Veb+DIeH1B39sjwn22+LlJVqELk07/Mx48vWd5OGUK38NYN781mH+1cB6JrtIM0lJlAu1RJahbZo8uEcINEpZIXKR7UiUwOng1EbrSeV+DgC2HL71lPxapeYmU6eGkCiu2usAM6o7Wn8XY9//HP8+weBVnWhDCVuCqQSCx8= | ||
on: | ||
repo: wooorm/mdast-github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(The MIT License) | ||
|
||
Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# mdast-github [![Build Status](https://img.shields.io/travis/wooorm/mdast-github.svg?style=flat)](https://travis-ci.org/wooorm/mdast-github) [![Coverage Status](https://img.shields.io/coveralls/wooorm/mdast-github.svg?style=flat)](https://coveralls.io/r/wooorm/mdast-github?branch=master) | ||
|
||
Auto-link references to commits, issues, pull-requests, and users like GitHub: [Writing on GitHub](https://help.github.com/articles/writing-on-github/#references). | ||
|
||
## Installation | ||
|
||
[npm](https://docs.npmjs.com/cli/install) | ||
|
||
```bash | ||
$ npm install mdast-github | ||
``` | ||
|
||
[Component.js](https://github.com/componentjs/component) | ||
|
||
```bash | ||
$ component install wooorm/mdast-github | ||
``` | ||
|
||
[Bower](http://bower.io/#install-packages) | ||
|
||
```bash | ||
$ bower install mdast-github | ||
``` | ||
|
||
[Duo](http://duojs.org/#getting-started) | ||
|
||
```javascript | ||
var github = require('wooorm/mdast-github'); | ||
``` | ||
|
||
UMD: globals, AMD, and CommonJS ([uncompressed](mdast-github.js) and [compressed](mdast-github.min.js)): | ||
|
||
```html | ||
<script src="path/to/mdast.js"></script> | ||
<script src="path/to/mdast-github.js"></script> | ||
<script> | ||
mdast.use(mdastGitHub); | ||
</script> | ||
``` | ||
|
||
## Table of Contents | ||
|
||
- [Usage](#usage) | ||
- [API](#api) | ||
- [mdast.use(github)](#mdastusegithub) | ||
- [CLI](#cli) | ||
- [License](#license) | ||
|
||
## Usage | ||
|
||
Dependencies and input: | ||
|
||
```javascript | ||
var github = require('mdast-github'); | ||
var mdast = require('mdast').use(github); | ||
var input = [ | ||
'* SHA: a5c3785ed8d6a35868bc169f07e40e889087fd2e', | ||
'* User@SHA: jlord@a5c3785ed8d6a35868bc169f07e40e889087fd2e', | ||
'* User/Repository@SHA: jlord/sheetsee.js@a5c3785e', | ||
'* #Num: #26', | ||
'* GH-Num: GH-26', | ||
'* User#Num: jlord#26', | ||
'* User/Repository#Num: jlord/sheetsee.js#26', | ||
'* @mention', | ||
'* And @mentioning someone else', | ||
'* And nothing.' | ||
].join('\n'); | ||
``` | ||
|
||
Stringify: | ||
|
||
```javascript | ||
var doc = mdast.stringify(mdast.parse(input)); | ||
``` | ||
|
||
Yields: | ||
|
||
```markdown | ||
- SHA: [a5c3785](https://github.com/wooorm/mdast-github/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) | ||
- User@SHA: [jlord@a5c3785](https://github.com/jlord/mdast-github/commit/a5c3785ed8d6a35868bc169f07e40e889087fd2e) | ||
- User/Repository@SHA: [jlord/sheetsee.js@a5c3785](https://github.com/jlord/sheetsee.js/commit/a5c3785e) | ||
- # Num: [#26](https://github.com/wooorm/mdast-github/issues/26) | ||
- GH-Num: [GH-26](https://github.com/wooorm/mdast-github/issues/26) | ||
- User#Num: [jlord#26](https://github.com/jlord/mdast-github/issues/26) | ||
- User/Repository#Num: [jlord/sheetsee.js#26](https://github.com/jlord/sheetsee.js/issues/26) | ||
- [@mention](https://github.com/blog/821) | ||
- And [@mentioning](https://github.com/mentioning) someone else | ||
- And nothing. | ||
``` | ||
|
||
## API | ||
|
||
### [mdast](https://github.com/wooorm/mdast#api).[use](https://github.com/wooorm/mdast#mdastuseplugin)(github) | ||
|
||
Adds references to commits, issues, pull-requests, and users similar to how [GitHub](https://help.github.com/articles/writing-on-github/#references) renders these in issues, comments, and pull request descriptions. | ||
|
||
- SHA commits references: `e2c1dc7690932b0cef900fa4e7355df093448341` — [e2c1dc7](https://github.com/wooorm/mdast-github/commit/e2c1dc7690932b0cef900fa4e7355df093448341) | ||
- User@SHA: `wooorm@e2c1dc7690932b0cef900fa4e7355df093448341` — [wooorm@e2c1dc7](https://github.com/wooorm/mdast-github/commit/e2c1dc7690932b0cef900fa4e7355df093448341) | ||
- User/Repository@SHA: `wooorm/mdast-github@e2c1dc7690932b0cef900fa4e7355df093448341` — [wooorm/mdast-github@e2c1dc7](https://github.com/wooorm/mdast-github/commit/e2c1dc7690932b0cef900fa4e7355df093448341) | ||
- Hash-Num: `#1` — [#1](https://github.com/wooorm/mdast-github/issues/1) | ||
- GH-Num: `GH-1` — [GH-1](https://github.com/wooorm/mdast-github/issues/1) | ||
- User#Num: `wooorm#1` — [wooorm#1](https://github.com/wooorm/mdast-github/issues/1) | ||
- User/Repository#Num: `wooorm/mdast-github#1` — [wooorm/mdast-github#1](https://github.com/wooorm/mdast-github/issues/1) | ||
- At-mentions: `@mention` and `@wooorm` — [@mention](https://github.com/blog/821) and [@wooorm](https://github.com/wooorm) | ||
|
||
These links are generated relative to a project. In Node this is auto-detected by loading `package.json` and looking for a `repository` field. | ||
In the browser, or when overwriting this, you can pass a `repository` to [`mdast.parse`](https://github.com/wooorm/mdast#mdastparsevalue-options) or [`mdast.run()`](https://github.com/wooorm/mdast#mdastrunast-options). | ||
|
||
## CLI | ||
|
||
A simple wrapper around `mdast --use mdast-github` | ||
|
||
Install: | ||
|
||
```bash | ||
$ npm install --global mdast-github | ||
``` | ||
|
||
Use: | ||
|
||
```text | ||
Usage: mdast-github [mdast options] | ||
Auto-link references like in GitHub issues, PRs, and comments | ||
Options: | ||
-h, --help output usage information | ||
-v, --version output version number | ||
A wrapper around `mdast --use mdast-github` | ||
Help for mdast: | ||
https://github.com/wooorm/mdast | ||
Usage: | ||
# Pass `Readme.md` through mdast-github | ||
$ mdast-github Readme.md -o Readme.md | ||
# Pass stdin through mdast-github, with mdast options, and write to stdout | ||
$ cat Docs.md | mdast-github --setting setext > Docs-new.md | ||
# Use other plugins | ||
$ npm install mdast-usage | ||
$ mdast-github --use mdast-usage Readme.md | ||
``` | ||
|
||
## License | ||
|
||
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) |
Oops, something went wrong.