Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. # unist-util-stringify-position
  2. [![Build][build-badge]][build]
  3. [![Coverage][coverage-badge]][coverage]
  4. [![Downloads][downloads-badge]][downloads]
  5. [![Size][size-badge]][size]
  6. [![Sponsors][sponsors-badge]][collective]
  7. [![Backers][backers-badge]][collective]
  8. [![Chat][chat-badge]][chat]
  9. [**unist**][unist] utility to pretty print the positional information of a node.
  10. ## Install
  11. [npm][]:
  12. ```sh
  13. npm install unist-util-stringify-position
  14. ```
  15. ## Use
  16. ```js
  17. var stringify = require('unist-util-stringify-position')
  18. // Point
  19. stringify({line: 2, column: 3}) // => '2:3'
  20. // Position
  21. stringify({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1'
  22. // Node
  23. stringify({
  24. type: 'text',
  25. value: '!',
  26. position: {
  27. start: {line: 5, column: 11},
  28. end: {line: 5, column: 12}
  29. }
  30. }) // => '5:11-5:12'
  31. ```
  32. ## API
  33. ### `stringifyPosition(node|position|point)`
  34. Stringify one [point][], a [position][] (start and end [point][]s), or a node’s
  35. [positional information][positional-information].
  36. ###### Parameters
  37. * `node` ([`Node`][node])
  38. — Node whose `'position'` property to stringify
  39. * `position` ([`Position`][position])
  40. — Position whose `'start'` and `'end'` points to stringify
  41. * `point` ([`Point`][point])
  42. — Point whose `'line'` and `'column'` to stringify
  43. ###### Returns
  44. `string?` — A range `ls:cs-le:ce` (when given `node` or `position`) or a point
  45. `l:c` (when given `point`), where `l` stands for line, `c` for column, `s` for
  46. `start`, and `e` for end.
  47. An empty string (`''`) is returned if the given value is neither `node`,
  48. `position`, nor `point`.
  49. ## Related
  50. * [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated)
  51. — Check if a node is generated
  52. * [`unist-util-position`](https://github.com/syntax-tree/unist-util-position)
  53. — Get positional info of nodes
  54. * [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position)
  55. — Remove positional info from trees
  56. * [`unist-util-source`](https://github.com/syntax-tree/unist-util-source)
  57. — Get the source of a value (node or position) in a file
  58. ## Contribute
  59. See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
  60. started.
  61. See [`support.md`][support] for ways to get help.
  62. This project has a [code of conduct][coc].
  63. By interacting with this repository, organization, or community you agree to
  64. abide by its terms.
  65. ## License
  66. [MIT][license] © [Titus Wormer][author]
  67. <!-- Definition -->
  68. [build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg
  69. [build]: https://travis-ci.org/syntax-tree/unist-util-stringify-position
  70. [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg
  71. [coverage]: https://codecov.io/github/syntax-tree/unist-util-stringify-position
  72. [downloads-badge]: https://img.shields.io/npm/dm/unist-util-stringify-position.svg
  73. [downloads]: https://www.npmjs.com/package/unist-util-stringify-position
  74. [size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-stringify-position.svg
  75. [size]: https://bundlephobia.com/result?p=unist-util-stringify-position
  76. [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
  77. [backers-badge]: https://opencollective.com/unified/backers/badge.svg
  78. [collective]: https://opencollective.com/unified
  79. [chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg
  80. [chat]: https://spectrum.chat/unified/syntax-tree
  81. [npm]: https://docs.npmjs.com/cli/install
  82. [license]: license
  83. [author]: https://wooorm.com
  84. [contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
  85. [support]: https://github.com/syntax-tree/.github/blob/master/support.md
  86. [coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
  87. [unist]: https://github.com/syntax-tree/unist
  88. [node]: https://github.com/syntax-tree/unist#node
  89. [position]: https://github.com/syntax-tree/unist#position
  90. [point]: https://github.com/syntax-tree/unist#point
  91. [positional-information]: https://github.com/syntax-tree/unist#positional-information