Skip to content

Commit 2445c4e

Browse files
committed
.
0 parents  commit 2445c4e

File tree

12 files changed

+711
-0
lines changed

12 files changed

+711
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/workflows/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: main
2+
on:
3+
- pull_request
4+
- push
5+
jobs:
6+
main:
7+
name: ${{matrix.node}}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: dcodeIO/setup-node-nvm@master
12+
with:
13+
node-version: ${{matrix.node}}
14+
- run: npm install
15+
- run: npm test
16+
- uses: codecov/codecov-action@v1
17+
strategy:
18+
matrix:
19+
node:
20+
- lts/dubnium
21+
- node

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.nyc_output/
2+
coverage/
3+
node_modules/
4+
*.log
5+
.DS_Store
6+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage/
2+
*.html
3+
*.json
4+
*.md

from-markdown.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var expression = require('mdast-util-mdx-expression/from-markdown')
2+
var jsx = require('mdast-util-mdx-jsx/from-markdown')
3+
var esm = require('mdast-util-mdxjs-esm/from-markdown')
4+
5+
var own = {}.hasOwnProperty
6+
7+
module.exports = configure([expression, jsx, esm])
8+
9+
function configure(extensions) {
10+
var config = {canContainEols: []}
11+
var index = -1
12+
13+
while (++index < extensions.length) {
14+
extension(config, extensions[index])
15+
}
16+
17+
return config
18+
}
19+
20+
function extension(config, extension) {
21+
var key
22+
var left
23+
var right
24+
25+
for (key in extension) {
26+
left = own.call(config, key) ? config[key] : (config[key] = {})
27+
right = extension[key]
28+
29+
if (key === 'canContainEols') {
30+
config[key] = [].concat(left, right)
31+
} else {
32+
Object.assign(left, right)
33+
}
34+
}
35+
}

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exports.fromMarkdown = require('./from-markdown')
2+
exports.toMarkdown = require('./to-markdown')

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) 2020 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.

package.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "mdast-util-mdx",
3+
"version": "0.0.0",
4+
"description": "mdast extension to parse and serialize MDX (or MDX.js)",
5+
"license": "MIT",
6+
"keywords": [
7+
"unist",
8+
"mdast",
9+
"mdast-util",
10+
"util",
11+
"utility",
12+
"markdown",
13+
"markup",
14+
"mdx",
15+
"mdxjs",
16+
"esm",
17+
"expression",
18+
"jsx"
19+
],
20+
"repository": "syntax-tree/mdast-util-mdx",
21+
"bugs": "https://github.com/syntax-tree/mdast-util-mdx/issues",
22+
"funding": {
23+
"type": "opencollective",
24+
"url": "https://opencollective.com/unified"
25+
},
26+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
27+
"contributors": [
28+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
29+
],
30+
"files": [
31+
"from-markdown.js",
32+
"index.js",
33+
"to-markdown.js"
34+
],
35+
"dependencies": {
36+
"mdast-util-mdx-expression": "~0.1.0",
37+
"mdast-util-mdx-jsx": "~0.1.0",
38+
"mdast-util-mdxjs-esm": "~0.1.0"
39+
},
40+
"devDependencies": {
41+
"micromark-extension-mdx": "^0.1.0",
42+
"micromark-extension-mdxjs": "^0.1.0",
43+
"nyc": "^15.0.0",
44+
"prettier": "^2.0.0",
45+
"remark-cli": "^9.0.0",
46+
"remark-preset-wooorm": "^8.0.0",
47+
"tape": "^5.0.0",
48+
"xo": "^0.36.0"
49+
},
50+
"scripts": {
51+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
52+
"test-api": "node test",
53+
"test-coverage": "nyc --reporter lcov tape test.js",
54+
"test": "npm run format && npm run test-coverage"
55+
},
56+
"nyc": {
57+
"check-coverage": true,
58+
"lines": 100,
59+
"functions": 100,
60+
"branches": 100
61+
},
62+
"prettier": {
63+
"tabWidth": 2,
64+
"useTabs": false,
65+
"singleQuote": true,
66+
"bracketSpacing": false,
67+
"semi": false,
68+
"trailingComma": "none"
69+
},
70+
"xo": {
71+
"prettier": true,
72+
"esnext": false,
73+
"rules": {
74+
"guard-for-in": "off",
75+
"unicorn/prefer-optional-catch-binding": "off"
76+
}
77+
},
78+
"remarkConfig": {
79+
"plugins": [
80+
"preset-wooorm"
81+
]
82+
}
83+
}

0 commit comments

Comments
 (0)