Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit ed9c432

Browse files
committed
Initial commit
0 parents  commit ed9c432

File tree

14 files changed

+624
-0
lines changed

14 files changed

+624
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.{json,remarkrc,eslintrc,sh}]
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage/
2+
example.js
3+
hast-util-menu-state.js
4+
hast-util-menu-state.min.js

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"rules": {
4+
"quotes": [2, "single"]
5+
}
6+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
*.log
3+
coverage/
4+
node_modules/
5+
hast-util-menu-state.js
6+
hast-util-menu-state.min.js

.jscs.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"excludeFiles": [
3+
"coverage/",
4+
"node_modules/",
5+
"hast-util-menu-state.js",
6+
"hast-util-menu-state.min.js"
7+
],
8+
"preset": "crockford",
9+
"requireMultipleVarDecl": false,
10+
"disallowDanglingUnderscores": false,
11+
"requireQuotedKeysInObjects": true,
12+
"disallowKeywords": [
13+
"with"
14+
],
15+
"maximumLineLength": {
16+
"value": 79,
17+
"allExcept": [
18+
"regex",
19+
"urlComments"
20+
]
21+
},
22+
"jsDoc": {
23+
"checkAnnotations": "jsdoc3",
24+
"checkParamExistence": true,
25+
"checkParamNames": true,
26+
"checkRedundantAccess": true,
27+
"checkRedundantParams": true,
28+
"checkRedundantReturns": true,
29+
"checkReturnTypes": true,
30+
"checkTypes": "strictNativeCase",
31+
"enforceExistence": true,
32+
"requireHyphenBeforeDescription": true,
33+
"requireNewlineAfterDescription": true,
34+
"requireParamDescription": true,
35+
"requireParamTypes": true,
36+
"requireReturnDescription": true,
37+
"requireReturnTypes": true
38+
}
39+
}

.remarkrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"output": true,
3+
"plugins": [
4+
"lint",
5+
"github",
6+
"comment-config",
7+
"usage",
8+
"validate-links"
9+
],
10+
"settings": {
11+
"bullet": "*"
12+
}
13+
}

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
- '0.11'
5+
- '0.12'
6+
- '4.0'
7+
- '5.0'
8+
sudo: false
9+
after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov
10+
deploy:
11+
- provider: npm
12+
13+
api_key:
14+
secure: A1Wnjw019KohzfSUrAycPBeQpvPQ7GmVXKeLJA79HydNnH0iu7JgHmbjTufmIDFyDvx8CFeQRrR0nCxFY1EgxY+A8ykkejL/M8+FgagI/5EdjJ+Cs+mf6IRih/K0nXYj7V91GrVICWlLgOvmCWlN+0uoz0AopKi89CMepysfTMuiNCeyIL9LzoTGNpx0waq8YWWE+0Jy9kMfha3Ua7rXSCsCINZN+XAHxQ9mkImC1tposdKgojeGzfnlISl6rzHDSx+qMD+fnJDUKCD3mjm1U7bGutqV6+/AijS45H2zn5nPzWOx+HGBPngsctEpmoX0ovwlZV3YeDyHo6i3YuEnNBZaXfNn/zoQ1+tsIchqdhz6CZJwScNzKJWjPpNf2yyTBhmOEnlQ+7b1jI8rmwGFSJCemOvRjcE468pvR6gnhfpnNJBfU1v/kf0ATn4SMZSwRDavqbBQBoIZvkdLHw/2aaRgw6mwZgxmihlHonNuzPVHm8OhsF4lWfQ7Fa6Z8Vd1rJAaP0GN/gCAkqTVnOuTcnsQzGAjlIw5Jp8oj6Qo7dUiVwh3CukB6hgvgwzmPTu29uF1pAv+yHaIBPA34WlbyIHHwxflBtApdlLXL8TBiXwPFO/OkDJmO8xU4LHyEsgryOwQ5v46EVhRaCxIRi7lrlObDCVA0Ib2w+SUpe54/7A=
15+
on:
16+
tags: true
17+
node: '5.0'
18+
- provider: releases
19+
api_key:
20+
secure: hZHi1o5z51PwY2Zx8pmMR1qhLPseHByo3CqUl0ZQolSlkLsTdf+hF1s6fgefM6EIAGOX0ROwitb3Gu75epOKFuV1Khxy55qqqoE7aRQUNkbpdo9ZCVL895pcAIWFBgbHoCR4xRpghg184xaYZbDBviWQnktJXrIFMPE9IObUZPEzbYAu4En1f/3bthzbbSNuh80v9Jrl4Z7rQr0nhwPTAWtAR29dBydZDjMnNkjZ2pUc97i2zIz4hiuP2AUIVtFF0kAp4NUgN26bLlvJ/HAMTC6waPruqmANdOccW9bqDYtRZpVIsWnRytC2c/Ipz62Zgc3ZcA+Dd5FfDCtvfA2wCzuC6BREFffRpIgGVuxRLo7SFdIfO1CsjKL4QQPPoCbhxLARIo+12kXFt6eMZCuOu99S8ZjO3eMJUoCiF8Rf5HzulmBmkYKDJ02dbTCjUL2D26KJM/wTUzIMtLu14bQ46sM+ZvfjDF/uwBwc2/X3fsH0TJaZBDKG+a69DFmuZMuwQY6bP8vZL/x7VMqMNGTsxMGMzCdNh+guRoXZ1R5VBDhTS5kdQEKTD+viZPEzeQTE2GrIkQejfKV6aL4uuiAPlOPTCeqrCXxNdFRNheOma0usa1fmx0OIASAammD305k9YHGaryWlaYl1nUCCl52TYLQDABSM7yMWH6pqq4fDjlI=
21+
file:
22+
- "hast-util-menu-state.js"
23+
- "hast-util-menu-state.min.js"
24+
on:
25+
tags: true

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(The MIT License)
2+
3+
Copyright (c) 2016 Titus Wormer <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
'Software'), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

example.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Dependencies:
2+
var menuState = require('./index.js');
3+
4+
// If there’s no last element or that node is not a `menu`:
5+
var result = menuState([{
6+
'type': 'element',
7+
'tagName': 'a'
8+
}]);
9+
10+
// You’ll get:
11+
console.log('js', String(result));
12+
13+
// If the last node is a `menu` without `type`:
14+
result = menuState([{
15+
'type': 'element',
16+
'tagName': 'menu'
17+
}]);
18+
19+
// You’ll get:
20+
console.log('json', JSON.stringify(result));
21+
22+
// If the last node is a `menu` with a `type`,
23+
// or that node has a parent `menu` with a type:
24+
result = menuState([
25+
{
26+
'type': 'element',
27+
'tagName': 'menu',
28+
'properties': {
29+
'type': 'context'
30+
}
31+
},
32+
{
33+
'type': 'element',
34+
'tagName': 'li'
35+
},
36+
{
37+
'type': 'element',
38+
'tagName': 'menu'
39+
}
40+
]);
41+
42+
// You’ll get:
43+
console.log('json', JSON.stringify(result));

history.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!--remark setext-->
2+
3+
<!--lint disable no-multiple-toplevel-headings-->
4+
5+
0.0.0 / 2016-04-15
6+
==================

0 commit comments

Comments
 (0)