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

Commit d20468c

Browse files
committed
Initial commit
0 parents  commit d20468c

18 files changed

+1244
-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-to-hyperscript.js
4+
hast-to-hyperscript.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-to-hyperscript.js
6+
hast-to-hyperscript.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-to-hyperscript.js",
6+
"hast-to-hyperscript.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+
"comment-config",
5+
"github",
6+
"lint",
7+
"usage",
8+
"validate-links"
9+
],
10+
"settings": {
11+
"bullet": "*"
12+
}
13+
}

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
- '0.11'
5+
- '0.12'
6+
- '4.0'
7+
- '5.0'
8+
after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov
9+
deploy:
10+
- provider: npm
11+
email: tituswormer@gmail.com
12+
api_key:
13+
secure: axBZhF+WDhda7IgSoM+a2yqYeVRFZP+KGWCHYUBH6dlsI2mrcxR4WaV5aBD++5R0dpRQ7h65laoF6SBtA6kVU3vWUlLalr7V8zvxDp0tucmPQ7tvh4Ldx1+0YEgtx92Qm340/Z/wVi0mb4/4yvEAczuH0dgazYtE+EEQeI30wOS0cQFeT5nzeKMtz0MyKeDgbKg3d1jO8fgBqDgJ1Ev7kxRSbRgF0TmsdYuldvpfgQClyXF7+Li4tfGbDOKAwox9BD+o794jy3pK4F0g/xvLvx/cCoH045rwmwS8soiQLN3CCwCZ30N4MnGGmxxP5AIpRhUV7OgMS48/MCM33HofNwn89zGQYggEDs7NqVJvNZx//1wFv0DLd0dSnkoJ60fPmuPdGGqRNNMDiFCGJE4VvhLdLN1HH7mDYgemWhkdkU+YhBfsGcspsdNyH+yzsroinBrMTPGTUD3zg/5Mgkk4w/lezG2lvrI/nhsYRbkPTQU2OoQ5l34d+m/I0VrF/aLg8NIOwzlzOaaMzz9rMVZ0qa76RbkI782NYYQpAZsOvJ2h3j6/jGPpmxkWtjk+XxEy6PXzNp2SQmxwDUXVDcQW2vyzEc18R3+0WKxa/gV1IBkV8I60XO6sWn1a5BaCE9F5LVICoYkELYnVCuWqawpdj5JbvJY/tcF2xo11tAJfFG4=
14+
on:
15+
tags: true
16+
node: '5.0'
17+
- provider: releases
18+
api_key:
19+
secure: l2cYsafuSX1mC35YGxFau3uMsjlF4rJExLap+SDVO01B23TavJe9sGeO2L7T+CZf0pM+W4JHm7/WamSlpi+ZyoSZiXfwiXq50HQKLPMiA3cBkd01GZ2TOxx6CfgyAZgbScj5RvV5miYOt3BRnl5okRjXK1SS56TCbQdi9xutcwwmW6lEI09lg1A4sfpos9OKNVSX/f5wr6/xZNh4wI1W18tgqtjnYXnqrcdhmHgzJ/gkllu9vydtDJHh0Dvgvf85LYYLbBtkWb8ujsihC3rfmLHQ/214vA/EHvy0foVTOCpRZDMhPdlswx7EpGOOugomz4P3ZSlhd6INUbu9vIxMVLAl7x/IOqjGILU8lJquu95bjLOH0zQnojLojlElISq8OiNRLuJ6liFKBWiu34rYhyUPIsNAHx38SSEbfoW1O8BljW/wbTN0qi2rx4wWtKEU/yYMZVBAPSvUT0XnY6aXJoGjwoxw29EcJ041RH3+HqLXa6TBalvCNgDN6tyce2ojXv9mJqAIXqAB2gnmKA0e6BukoPXUwIc3oo67MiF8iuCp80Ol3LBnJNaUiOffOuYdjc1q5Ej1szIsNY/gD58fPZonMZ6fa8x6tdIzeS148mQvfAB/KpVWtPjZ4vd+/s1KhEWg7nsCEgpttPaSxUG7lYGjCI1YSeCSeIn6zec1oxE=
20+
file:
21+
- "hast-to-hyperscript.js"
22+
- "hast-to-hyperscript.min.js"
23+
on:
24+
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 <tituswormer@gmail.com>
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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Dependencies:
2+
var toHyperscript = require('./index.js');
3+
var React = require('react');
4+
var h = require('hyperscript');
5+
var v = require('virtual-dom/h');
6+
7+
// HAST Tree:
8+
var tree = {
9+
'type': 'element',
10+
'tagName': 'a',
11+
'properties': {
12+
'href': 'http://alpha.com',
13+
'id': 'bravo',
14+
'className': ['charlie', 'delta'],
15+
'download': true
16+
},
17+
'children': [{
18+
'type': 'text',
19+
'value': 'Echo'
20+
}]
21+
};
22+
23+
// Compiling with `hyperscript`:
24+
var result = toHyperscript(tree, h).outerHTML;
25+
26+
// Yields:
27+
console.log('html', result);
28+
29+
// Or with `virtual-dom/h`:
30+
result = toHyperscript(tree, v);
31+
32+
// Yields:
33+
console.log('js', require('util').inspect(result));
34+
35+
// Or `React.createElement`:
36+
result = toHyperscript(tree, React.createElement);
37+
38+
// Yields:
39+
console.log('js', require('util').inspect(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-18
6+
==================

0 commit comments

Comments
 (0)