WIP - add extractor, generate snippet_data
This commit is contained in:
22
node_modules/unist-util-position/index.js
generated
vendored
Normal file
22
node_modules/unist-util-position/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
|
||||
var position = exports
|
||||
|
||||
position.start = factory('start')
|
||||
position.end = factory('end')
|
||||
|
||||
function factory(type) {
|
||||
point.displayName = type
|
||||
|
||||
return point
|
||||
|
||||
function point(node) {
|
||||
var point = (node && node.position && node.position[type]) || {}
|
||||
|
||||
return {
|
||||
line: point.line || null,
|
||||
column: point.column || null,
|
||||
offset: isNaN(point.offset) ? null : point.offset
|
||||
}
|
||||
}
|
||||
}
|
||||
22
node_modules/unist-util-position/license
generated
vendored
Normal file
22
node_modules/unist-util-position/license
generated
vendored
Normal file
@ -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.
|
||||
110
node_modules/unist-util-position/package.json
generated
vendored
Normal file
110
node_modules/unist-util-position/package.json
generated
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
{
|
||||
"_from": "unist-util-position@^3.0.0",
|
||||
"_id": "unist-util-position@3.0.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-28EpCBYFvnMeq9y/4w6pbnFmCUfzlsc41NJui5c51hOFjBA1fejcwc+5W4z2+0ECVbScG3dURS3JTVqwenzqZw==",
|
||||
"_location": "/unist-util-position",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "unist-util-position@^3.0.0",
|
||||
"name": "unist-util-position",
|
||||
"escapedName": "unist-util-position",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/hast-util-raw",
|
||||
"/mdast-util-to-hast",
|
||||
"/mdast-util-to-nlcst"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.0.3.tgz",
|
||||
"_shasum": "fff942b879538b242096c148153826664b1ca373",
|
||||
"_spec": "unist-util-position@^3.0.0",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/hast-util-raw",
|
||||
"author": {
|
||||
"name": "Titus Wormer",
|
||||
"email": "tituswormer@gmail.com",
|
||||
"url": "https://wooorm.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/syntax-tree/unist-util-position/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Titus Wormer",
|
||||
"email": "tituswormer@gmail.com",
|
||||
"url": "https://wooorm.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Utility to get the position of unist nodes",
|
||||
"devDependencies": {
|
||||
"browserify": "^16.0.0",
|
||||
"nyc": "^14.0.0",
|
||||
"prettier": "^1.0.0",
|
||||
"remark-cli": "^6.0.0",
|
||||
"remark-preset-wooorm": "^5.0.0",
|
||||
"tape": "^4.0.0",
|
||||
"tinyify": "^2.0.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/syntax-tree/unist-util-position#readme",
|
||||
"keywords": [
|
||||
"unist",
|
||||
"node",
|
||||
"position",
|
||||
"point",
|
||||
"util",
|
||||
"utility"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "unist-util-position",
|
||||
"nyc": {
|
||||
"check-coverage": true,
|
||||
"lines": 100,
|
||||
"functions": 100,
|
||||
"branches": 100
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"preset-wooorm"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/syntax-tree/unist-util-position.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build-bundle && npm run build-mangle",
|
||||
"build-bundle": "browserify . -s unistUtilPosition > unist-util-position.js",
|
||||
"build-mangle": "browserify . -s unistUtilPosition -p tinyify > unist-util-position.min.js",
|
||||
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
|
||||
"test": "npm run format && npm run build && npm run test-coverage",
|
||||
"test-api": "node test",
|
||||
"test-coverage": "nyc --reporter lcov tape test.js"
|
||||
},
|
||||
"version": "3.0.3",
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"esnext": false,
|
||||
"ignores": [
|
||||
"unist-util-position.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
114
node_modules/unist-util-position/readme.md
generated
vendored
Normal file
114
node_modules/unist-util-position/readme.md
generated
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
# unist-util-position
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][size-badge]][size]
|
||||
[![Sponsors][sponsors-badge]][collective]
|
||||
[![Backers][backers-badge]][collective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[**unist**][unist] utility to get the positional info of nodes.
|
||||
|
||||
## Install
|
||||
|
||||
[npm][]:
|
||||
|
||||
```sh
|
||||
npm install unist-util-position
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var remark = require('remark')
|
||||
var position = require('unist-util-position')
|
||||
|
||||
var tree = remark().parse('# foo\n\n* bar\n')
|
||||
|
||||
position.start(tree) // => {line: 1, column: 1}
|
||||
position.end(tree) // => {line: 4, column: 1}
|
||||
|
||||
position.start() // => {line: null, column: null}
|
||||
position.end() // => {line: null, column: null}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `position.start([node])`
|
||||
|
||||
### `position.end([node])`
|
||||
|
||||
Get the start or end points in the positional info of `node`.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `node` ([`Node?`][node]) — Node to check.
|
||||
|
||||
###### Returns
|
||||
|
||||
[`Point`][point] — Filled with `line` (nullable `uint32 >= 1`),
|
||||
`column` (nullable `uint32 >= 1`), `offset` (nullable `uint32 >= 0`).
|
||||
|
||||
Note that in [unist][], `line` and `column` are 1-indexed integers and
|
||||
`offset` is a 0-indexed integer.
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
|
||||
started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [Code of Conduct][coc].
|
||||
By interacting with this repository, organisation, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-position.svg
|
||||
|
||||
[build]: https://travis-ci.org/syntax-tree/unist-util-position
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-position.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/syntax-tree/unist-util-position
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/unist-util-position.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/unist-util-position
|
||||
|
||||
[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-position.svg
|
||||
|
||||
[size]: https://bundlephobia.com/result?p=unist-util-position
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[collective]: https://opencollective.com/unified
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
|
||||
|
||||
[chat]: https://spectrum.chat/unified/syntax-tree
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
|
||||
|
||||
[support]: https://github.com/syntax-tree/.github/blob/master/support.md
|
||||
|
||||
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
|
||||
|
||||
[unist]: https://github.com/syntax-tree/unist
|
||||
|
||||
[node]: https://github.com/syntax-tree/unist#node
|
||||
|
||||
[point]: https://github.com/syntax-tree/unist#point
|
||||
Reference in New Issue
Block a user