{"name":"micromark-factory-title","version":"1.0.2","description":"micromark factory to parse markdown titles (found in resources, definitions)","license":"MIT","keywords":["micromark","factory","title"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-factory-space":"^1.0.0","micromark-util-character":"^1.0.0","micromark-util-symbol":"^1.0.0","micromark-util-types":"^1.0.0","uvu":"^0.5.0"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"77d9d891dd5279ac0715b337a03ec0cc5080c92f","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-title@1.0.2","_nodeVersion":"16.9.0","_npmVersion":"7.23.0","dist":{"integrity":"sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==","shasum":"7e09287c3748ff1693930f176e1c4a328382494f","tarball":"http://registry-npm.ywwl.com/micromark-factory-title/download/micromark-factory-title-1.0.2.tgz","fileCount":6,"unpackedSize":11269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2zMzCRA9TVsSAnZWagAAngUQAJw46PbhIQxGGqhg9wXL\nBCn5crPj8//LNRxafp//blIpJXpRsiM23oYXEc7dDrMz/SzxtHuX71uZTTsk\n08zdZuKqEjoLNgVuRosrAk/quPupir2p77INOL6rvNnSFjEx6DGT1+n5zxMf\n1w60v5AvJ27+WqTemPlQ4QMvJNb0Jo8IkubtEx0jC10gg0mwpbM+bq4lUKTM\n4fimEGSos9RN2bAhKRnCMHoGHJWebouFGXcQmM7/xILLN2Ea2tUuMkrQ8KDj\nRpYON6Fq0K7lSagK1OsMnB63tnDTZRVwbaoBOa3gsfT1boruRqgz7siabBQH\nhj6zUyeoC402ziFoPyVUjmUN3L4FZQa+bbp0AqVQLJYUrJHFxTbHYPDdaEGg\nPfLM1vmFCUu5mV/PhbMKvqbfwQjtAouK9Bg7fsbG3Ch2bwckbzvPmQPbpG7a\nUV6vjDgFsgY/zLCgq22sM7rxT9fVn6s16TnE9QkqYdgJ/f7AzLbj7JmQaMWr\nEnnPWY7nWG6GyebAlWu2E2dRO51KT4Mi3SdBqQihm1CaXZWprpL8CAREnMR0\nnrYjcgKFZjS2e9edxawxNt24E6JYNVLJEADhQ9MfXx62me9cpVTp33NvDjNi\nh9RM2XAtvpyS3GNEVFCF6H2u17N8WD7HiLuit5a6IBsLp8QM6oxr3mJRuJkZ\nzn0T\r\n=xyF2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr1QUEwVjfgs7n1g0k05YQ6IxlYTcMMPLUtc5NHeDFbgIgIapqrkgZZFseGWkwubf+Bf2Q7e/UG17TP4E+TrNaqOI="}],"size":2896,"noattachment":false,"key":"/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-title_1.0.2_1633765196637_0.8257944326907161"},"_hasShrinkwrap":false,"readme":"# micromark-factory-title\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] factory to parse markdown titles (found in resources,\ndefinitions).\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`factoryTitle(…)`](#factorytitle)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package exposes states to parse titles.\n\n## When should I use this?\n\nThis package is useful when you are making your own micromark extensions.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-factory-title\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {factorySpace} from 'https://esm.sh/micromark-factory-title@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {factorySpace} from 'https://esm.sh/micromark-factory-title@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {factoryTitle} from 'micromark-factory-title'\nimport {codes, types} from 'micromark-util-symbol'\n\n// A micromark tokenizer that uses the factory:\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n  return start\n\n  // …\n\n  /** @type {State} */\n  function before(code) {\n    if (\n      code === codes.quotationMark ||\n      code === codes.apostrophe ||\n      code === codes.leftParenthesis\n    ) {\n      return factoryTitle(\n        effects,\n        factorySpace(effects, after, types.whitespace),\n        nok,\n        types.definitionTitle,\n        types.definitionTitleMarker,\n        types.definitionTitleString\n      )(code)\n    }\n\n    return nok(code)\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the identifier [`factoryTitle`][api-factory-title].\nThere is no default export.\n\n### `factoryTitle(…)`\n\nParse titles.\n\n###### Examples\n\n```markdown\n\"a\"\n'b'\n(c)\n\"a\nb\"\n'a\n    b'\n(a\\)b)\n```\n\n###### Parameters\n\n*   `effects` (`Effects`)\n    — context\n*   `ok` (`State`)\n    — state switched to when successful\n*   `nok` (`State`)\n    — state switched to when unsuccessful\n*   `type` (`string`)\n    — type of the whole title (`\"a\"`, `'b'`, `(c)`)\n*   `markerType` (`string`)\n    — type for the markers (`\"`, `'`, `(`, and `)`)\n*   `stringType` (`string`)\n    — type for the value (`a`)\n\n###### Returns\n\nStart state (`State`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-factory-title@^2`, compatible with Node.js 16.\nThis package works with `micromark@^3`.\n\n## Security\n\nThis package is safe.\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-title.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-factory-title\n\n[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-title\n\n[bundle-size]: https://bundlejs.com/?q=micromark-factory-title\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/main/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[api-factory-title]: #factorytitle\n","publish_time":1633765196813,"_cnpm_publish_time":1633765196813,"dist-tags":{"latest":"2.0.1","next":"1.0.0-beta.1"}}