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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # mdast-util-to-string
  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. **[mdast][]** utility to get the plain text content of a node.
  10. ## Install
  11. [npm][]:
  12. ```sh
  13. npm install mdast-util-to-string
  14. ```
  15. ## Use
  16. ```js
  17. var unified = require('unified')
  18. var parse = require('remark-parse')
  19. var toString = require('mdast-util-to-string')
  20. var tree = unified()
  21. .use(parse)
  22. .parse('Some _emphasis_, **importance**, and `code`.')
  23. console.log(toString(tree)) // => 'Some emphasis, importance, and code.'
  24. ```
  25. ## API
  26. ### `toString(node)`
  27. Get the text content of a [node][] or list of nodes.
  28. The algorithm checks `value` of `node`, then `alt`, and finally `title`.
  29. If no value is found, the algorithm checks the children of `node` and joins them
  30. (without spaces or newlines).
  31. > This is not a markdown to plain-text library.
  32. > Use [`strip-markdown`][strip-markdown] for that.
  33. ## Security
  34. Use of `mdast-util-to-string` does not involve **[hast][]**, user content, or
  35. change the tree, so there are no openings for [cross-site scripting (XSS)][xss]
  36. attacks.
  37. ## Related
  38. * [`nlcst-to-string`](https://github.com/syntax-tree/nlcst-to-string)
  39. — Get text content in nlcst
  40. * [`hast-util-to-string`](https://github.com/wooorm/rehype-minify/tree/HEAD/packages/hast-util-to-string)
  41. — Get text content in hast
  42. * [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text)
  43. — Get text content in hast according to the `innerText` algorithm
  44. * [`hast-util-from-string`](https://github.com/wooorm/rehype-minify/tree/HEAD/packages/hast-util-from-string)
  45. — Set text content in hast
  46. ## Contribute
  47. See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
  48. started.
  49. See [`support.md`][support] for ways to get help.
  50. This project has a [code of conduct][coc].
  51. By interacting with this repository, organization, or community you agree to
  52. abide by its terms.
  53. ## License
  54. [MIT][license] © [Titus Wormer][author]
  55. <!-- Definitions -->
  56. [build-badge]: https://github.com/syntax-tree/mdast-util-to-string/workflows/main/badge.svg
  57. [build]: https://github.com/syntax-tree/mdast-util-to-string/actions
  58. [coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-string.svg
  59. [coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-string
  60. [downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-string.svg
  61. [downloads]: https://www.npmjs.com/package/mdast-util-to-string
  62. [size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-to-string.svg
  63. [size]: https://bundlephobia.com/result?p=mdast-util-to-string
  64. [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
  65. [backers-badge]: https://opencollective.com/unified/backers/badge.svg
  66. [collective]: https://opencollective.com/unified
  67. [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
  68. [chat]: https://github.com/syntax-tree/unist/discussions
  69. [npm]: https://docs.npmjs.com/cli/install
  70. [license]: license
  71. [author]: https://wooorm.com
  72. [contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md
  73. [support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md
  74. [coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md
  75. [mdast]: https://github.com/syntax-tree/mdast
  76. [node]: https://github.com/syntax-tree/mdast#nodes
  77. [strip-markdown]: https://github.com/remarkjs/strip-markdown
  78. [xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
  79. [hast]: https://github.com/syntax-tree/hast