{"_id":"remark-tree-sitter","_rev":"6-112c8667657847154ad17c664ff4cba6","name":"remark-tree-sitter","dist-tags":{"latest":"1.0.3"},"versions":{"0.0.1":{"name":"remark-tree-sitter","version":"0.0.1","description":"A remark + rehype plugin using tree-sitter to syntax-highlight code snippets","license":"MIT","main":"index.js","types":"index.d.js","author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"repository":{"type":"git","url":"https://github.com/samlanning/tree-sitter-hast"},"devDependencies":{"gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-sourcemaps":"1.6.0","gulp-tslint":"^8.1.3","gulp-typescript":"^5.0.0","run-sequence":"^1.2.2","tslint":"^5.9.1","typescript":"^3.5.2","unified":"^7.1.0"},"scripts":{"build":"gulp"},"dependencies":{"@types/cson":"^0.0.31","@types/node":"^12.0.8","cson":"^5.1.0","highlight-tree-sitter":"^1.0.0","language-javascript":"^0.128.0-0","tree-sitter":"^0.15.5","tree-sitter-javascript":"^0.15.0","unist-util-visit":"^1.4.1"},"_id":"remark-tree-sitter@0.0.1","dist":{"shasum":"8f786c18a57e62d0adf99a171d78e0ff297bc3f5","integrity":"sha512-lM6qFGtj39EUyuSw1h6fDEdAHE1YFoeFyvMCbAGUjfD7QrK+EWs+DIjGcqiCzt9oBSCXft25xA6cQcQJ4cx3tQ==","tarball":"https://registry.npmjs.org/remark-tree-sitter/-/remark-tree-sitter-0.0.1.tgz","fileCount":6,"unpackedSize":3217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBGTwCRA9TVsSAnZWagAATOAP/RM+ioTVvPrNoyig4Hxw\n6yyBUv9OBO8FXoZryDRHJ7QBW91dPsPZau+9TQsMD0mBzSyHNX9ufJWIs8I0\nvgLZchqCKqGVhL3rGMxzPrRZopSdGyIrJPbVMXIO7OsIomuzqx+JQrDteybL\nAjPDlheuRSxMdV/7TetJfkQhurxqh3ZGkNtKw6Ah4NncHuFs/YFrmy8A8jq6\nyGQXKJ7e8ohkA4hRcq72NxltFvTKKfVm/luXE+32vy0B7YVWWsq33Wuq0e05\nTtI0ocWgOxioUrdF7igEpx+Fp8QOIh2pNVGzEIfjXsc00IJ5WMuOx5r0rnUV\nLKa6Aq9m9f5o2A4O7OiHzuM3Ta9iP8g/UZQM8Hs1ajPyJoW6Pkyf7Lxx24DO\nWYpDU6/Fh32egUE5tKMuTCLirPi5d9ElsApCBBp/KNTdRdMn656F9puKdtpe\nmBHJ8pjJ1xCO5CrOTXfER2702IEaBGjmnA58zDMZD2X6yiX5NeOZNq4R8zih\nWnQnbWJW2jlethWGxbKW+7EfDWTgZWiS8Zh1SU8OAjmJaGrM86oJ4OgKMIGt\n+9U2Lt+54LPVTzgtV29HjgONQaau5g/ppmbjJftZnw/R2HmFSD2jtFkIyRIR\n9EaUCDTps4xmnq+NDf4PV20wvaUTW+lKkXTwNNgnP2UpdIk/jxGsmARh/VIM\nOHlF\r\n=9MRf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY6gIaUmO6z134uLdisBtN9Rkb+aD0sWxdboa7HH4eMAIgVPEnrlxlbbCnIQ9fxV2HYH07cg5tXcWhHKI6lJC7wpQ="}]},"maintainers":[{"name":"samlanning","email":"sam@samlanning.com"}],"_npmUser":{"name":"samlanning","email":"sam@samlanning.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-tree-sitter_0.0.1_1560569072231_0.44427083618529495"},"_hasShrinkwrap":false},"1.0.0":{"name":"remark-tree-sitter","version":"1.0.0","description":"Highlight code in Markdown files using tree-sitter and remark","license":"MIT","main":"index.js","types":"index.d.js","author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"repository":{"type":"git","url":"https://github.com/samlanning/remark-tree-sitter"},"devDependencies":{"gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-sourcemaps":"1.6.0","gulp-tslint":"^8.1.3","gulp-typescript":"^5.0.0","run-sequence":"^1.2.2","tslint":"^5.9.1","typescript":"^3.5.2","unified":"^7.1.0"},"scripts":{"build":"gulp"},"dependencies":{"tree-sitter":"^0.15.5","tree-sitter-hast":"^1.1.0","unist-util-visit":"^1.4.1"},"_id":"remark-tree-sitter@1.0.0","dist":{"shasum":"2994dbc0843f9c656886b89eab8cca5bc9210835","integrity":"sha512-Df6Ij9NZmXkX6SzfDRJJlR73f5J2KAotN/dMpq5K7bSC5t/S0X0Y4FigMkPF69YqJZaJlPH0ejEcp5TM/mxpVg==","tarball":"https://registry.npmjs.org/remark-tree-sitter/-/remark-tree-sitter-1.0.0.tgz","fileCount":7,"unpackedSize":6097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBbpQCRA9TVsSAnZWagAA7voQAI8QrMsGgQeeYwlM0Pea\nkhCFaFJzAhpUJw4XwK+dP1KXQBO12hAHdT45isMJxJQpVnypKpoe84VZ+SVV\nhBYsGIiTF9fVIWAZg9/pQDKB/qfPSVojcp9Q2aFcV4mkrNYolq+LZd6sph4l\nK4fMxQYDRpvEsv2S3KPZqgqLJEA7DSJXZMteI+gR3EdmQaHTuFGFAvEE5fve\nA5z85q1alWhPy+0Yponp2yIW7F3hf56rR03WqCQdxVF6En/MNIgVAVPUbVyi\nNEHFgFKtnwUNQncRacU1EVSRkQgbrsrgei/5BI2TREwuPHvkWXGLdDyIbaY1\n9A7E1IXS0/chxe6yUh9WZouSTk7FmLDU8OeWyta7N4CUrZkFC/b0LDFR0/Ct\nP4csC2aLNFDEE4ZuLRQ0sLiSREsmULxCW9yW7I3Me28+cqeexV1tEpJnE/EJ\n7tjUe6sorkiWCTBH5/vT8bEs9K9ah5Si5zKw7+D6YcEeDPn4wTY+sMduVZhp\nG5/T0N/ASLB5dCSYM+7vNrPqmGjZXjf0Nw9f4ny+btLdt4cwROtGBi21XSsS\nMK+Qn2dQ5R6EfPFCWUppYegZhvysiiDkbZ/sBKySiNkQeslv9EPsb7/wm3tO\nRJc/KmBrcWSdtJK1WGsA+YeVKUflJm9vKOC1jexAGzcdUK71TPb8iCifW/rO\nILYS\r\n=sXLK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWvAvWy5koFK0Nr9x0OXw72TrR+7fg1aFqqPuV9dF63wIhANunXSYgbciJ9rmeKRjQooZ5Q37tSluuPlwKkWqSvB8z"}]},"maintainers":[{"name":"samlanning","email":"sam@samlanning.com"}],"_npmUser":{"name":"samlanning","email":"sam@samlanning.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-tree-sitter_1.0.0_1560656463726_0.2552017576731962"},"_hasShrinkwrap":false},"1.0.1":{"name":"remark-tree-sitter","version":"1.0.1","description":"Highlight code in Markdown files using tree-sitter and remark","license":"MIT","main":"index.js","types":"index.d.js","author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"repository":{"type":"git","url":"https://github.com/samlanning/remark-tree-sitter"},"devDependencies":{"gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-sourcemaps":"1.6.0","gulp-tslint":"^8.1.3","gulp-typescript":"^5.0.0","run-sequence":"^1.2.2","tslint":"^5.9.1","typescript":"^3.5.2","unified":"^7.1.0"},"scripts":{"build":"gulp"},"dependencies":{"tree-sitter":"^0.15.5","tree-sitter-hast":"^1.1.0","unist-util-visit":"^1.4.1"},"_id":"remark-tree-sitter@1.0.1","dist":{"shasum":"4fca1b47e8e2e2d2031e545c61d7b8c92b8c92f3","integrity":"sha512-6RKZGdDdnaVmqk1//uTdQQhSTKIFYnytoZGEKk4/p5vcSTemSt61TXuS2vtLk/ke0y10k4+OY1+xcTaQblvp+w==","tarball":"https://registry.npmjs.org/remark-tree-sitter/-/remark-tree-sitter-1.0.1.tgz","fileCount":7,"unpackedSize":11928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBe8iCRA9TVsSAnZWagAAbNQQAKRWsOdHQA4awo4divXi\nX5lRVMjotbsrvWhYOodzmwQI6UhZrkwX7/dF6sLO9yxj48PUS73TlUpSnKiO\nEyKhswsbLYea59DWBW44v/ytBskquxmZZu6phsMjwbgn6ozjbDel1MBN6LXl\nX5Fj9vMQRDJAF9zdsC4poDcqPz59lFkNWzOJjyXzp6fLpMYQ56OZLAlRrdha\nFL3snC/VGdbZHzWsTAKgXZ4bH02HLVTtw77CcItmpB1r6PmTvkBSA6gdysns\nEGBFvVTO4fzYs+Ah67zwuqa/isNm74y5oSK8qG+J1w/KHV3pXZojEr4j5Ii1\npUWxG+FzSPDV6mSleixcVbgMlEYHvNLmmiELVP9RSlTRtDp4Cmce9cRLXYkT\nIdqIaM5uYT/6GlCJszawDHpyxxoDtThY3ut19QrLcHVbemYg6F+NDNuIhEI7\nvN3DkKToev4rvb9MxjgiKH3JSKQE3yeg+ov5vbRHk0Mmi9za8MDzz+ixXnfv\ngWD5/HCiLk+Tg90HTRmx75uBJ1DhY07dC2ahzjhxKpFjwtVHt+WZnWhHrZQ7\ntGH1/a2EOEDNmECv4YEq2yq+xIz2R/pbW2MOnB9YEtJZ2dIzuATgz4XUs2bb\nsg7bEQ+izW6T7hRAsY1iBQJ9oKiRQRs2gJHktc/UEhUc0lXGhzBZ9ickXVNY\n5Sel\r\n=R9vJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaHIQHA2coh9YND1kaK1FN3qPTKfnYOBhO7J+ZdKxqcAiAy1kuJJjCkv6TvAZzZwao+gWmNZf2rBoD8lWMuMyQFfw=="}]},"maintainers":[{"name":"samlanning","email":"sam@samlanning.com"}],"_npmUser":{"name":"samlanning","email":"sam@samlanning.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-tree-sitter_1.0.1_1560669985382_0.6725448643852294"},"_hasShrinkwrap":false},"1.0.2":{"name":"remark-tree-sitter","version":"1.0.2","description":"Highlight code in Markdown files using tree-sitter and remark","keywords":["remark-plugin","tree-sitter","remark","syntax-highlighting"],"license":"MIT","main":"index.js","types":"index.d.js","author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"repository":{"type":"git","url":"https://github.com/samlanning/remark-tree-sitter"},"devDependencies":{"gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-sourcemaps":"1.6.0","gulp-tslint":"^8.1.3","gulp-typescript":"^5.0.0","run-sequence":"^1.2.2","tslint":"^5.9.1","typescript":"^3.5.2","unified":"^7.1.0"},"scripts":{"build":"gulp","build-and-test":"gulp; yarn --cwd tests run test"},"dependencies":{"tree-sitter":"^0.15.5","tree-sitter-hast":"^1.1.0","unist-util-visit":"^1.4.1"},"_id":"remark-tree-sitter@1.0.2","dist":{"shasum":"5e3205b3e9809c17df8b66301ab073aff5722d86","integrity":"sha512-E1jRw0ggauMy9WWTYRIJCPvbwrjn1v1LdJJn4PsEZ576orzXdC+xBzwg7JSxhgY193ABCKapmOSqNydVoVylcw==","tarball":"https://registry.npmjs.org/remark-tree-sitter/-/remark-tree-sitter-1.0.2.tgz","fileCount":9,"unpackedSize":12530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBoleCRA9TVsSAnZWagAAy5gQAJfnk5HYvLVFN+8jeZpk\n6UZRmfu0lBJv+/jFh8blx2RoYnndOXNBEAb3odiFnaQGC4CMuordhUiZkCm3\nfcXrqJ3avZh7vPEwlZHRe3zQLZGP/RD+FNMyb2FwelS4BvLQnB2a2F4RMTBI\nTtKlpVsuF23M+PvfhkY+gjbIJNgiNWc2X36cb+pU6wB1kUHW60w1ROxlM68D\nHl1jIgPk/Y25CdjvIhxWwDOCpv9zGGxY30/lie+gTT064Ys7utkfa3Z58/U4\nU7mLlPi2KgD36/XtvU9YIp40pIbktFxVclc64Zrb1tnM9UZH0NIWnucbwsS/\n45VLIkxsBK2OAME/nuQ+K7/vhYKJGOHZPrSWoZcvlWh01fCFHWmF/w+j35sD\nQym683cTOeB5VjdITsch7ujosYAbrzynVF8CPf4+wxGwLD0mxcV6MRd4Fky6\ncUPTa/uCHUdtnUytc9XHsz1ZqDot3pAQ2MgQgaBhVtTu/7j1s38z6rr18fM5\n7wOCk/Iy0S3NfimBM4QnssPOcMMnWcPWk0BIOkG1O5m9tLt9QnMqJ8AZQYZr\nb1EwjWQ6HJ2Nuk+P8J0wnmWeoUb3mK3vB3UbT9nJN1e2r+kZfq/+pbdd3mzA\nqIVV4NBOlfny+3pjE5dtils5qZGa11RPRkODlbu9rYpCeghCWKGhvk8BEL/5\nW/Ay\r\n=YgZO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbyjxvgekaCTbOmVT2/53xriHigWNO9mWf+TpTBfmzMAiAhlxFC5Ak4bXBMetW1NoDhDf5+wJBRkhpaOCaXJxcE9w=="}]},"maintainers":[{"name":"samlanning","email":"sam@samlanning.com"}],"_npmUser":{"name":"samlanning","email":"sam@samlanning.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-tree-sitter_1.0.2_1560709469688_0.7353818756940074"},"_hasShrinkwrap":false},"1.0.3":{"name":"remark-tree-sitter","version":"1.0.3","description":"Highlight code in Markdown files using tree-sitter and remark","keywords":["remark-plugin","tree-sitter","remark","syntax-highlighting"],"license":"MIT","main":"index.js","types":"index.d.js","author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"repository":{"type":"git","url":"https://github.com/samlanning/remark-tree-sitter"},"devDependencies":{"gulp":"^3.9.1","gulp-clean":"^0.3.2","gulp-sourcemaps":"1.6.0","gulp-tslint":"^8.1.3","gulp-typescript":"^5.0.0","run-sequence":"^1.2.2","tslint":"^5.9.1","typescript":"^3.5.2","unified":"^7.1.0"},"scripts":{"build":"gulp","build-and-test":"gulp; yarn --cwd tests run test"},"dependencies":{"tree-sitter":"^0.15.5","tree-sitter-hast":"^1.1.1","unist-util-visit":"^1.4.1"},"_id":"remark-tree-sitter@1.0.3","dist":{"shasum":"08114adb219425269c2e5cbb4acca302d56dac0d","integrity":"sha512-ely3TF4sQFxdCXTwqE9Tju+9v0YAFczyb5iN/L4CnDeW6Q6mvLb+XG9rLMAkLkYk8vyjPzbSi+655GOTj2YDcQ==","tarball":"https://registry.npmjs.org/remark-tree-sitter/-/remark-tree-sitter-1.0.3.tgz","fileCount":9,"unpackedSize":12550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBpnTCRA9TVsSAnZWagAA2ScQAKSnlrclp54HkJIM+wEC\nokCjeRJ370wU73KG+QytRvHilgPJdzb4LG9DB9DREGvkKgIwz7l6Lx8++ZT1\nF4hRYS8DTQEjVx4rB8faEu1cuxOPN8G5oX1k6AL8IsO6/DIxqqcJBQPvNGqB\nSCbbHqvqvZ9cNYRsLbMhm6JIJcr7zEwM/MR+MqO56aZuxdA/JJoNYiMOW3fk\nGKbxohdZi32iAqTzk9OsHFr9xFGyZ6Wo5CIMfNa0MpA+0w17fEgB/50Gc4Jr\nHvCriu1vufm03xykH/0ytazoebZl50IW+TQSk7fyC+5kOr8TommfW+PmFYaL\nXFZ+degX3UrDhqdhe+50xGOOJrOYN1tijWB6waCF92xjSc9+RVIJMzVNpiII\neZ2J/Q8DAGVGAbG51lRo9kFbRAaGfz3sptw+Xrwc6M5u4N8eSx14P+aTIOHx\ncWgpd81wE5YpofN8b/mVpkiviYMwyfCrfuwsBJVqnJUloz371kt7VfjVsdZs\nQ6mvU4kpFLoyVl4L20xp5TMvLPoBW04LuzUwJ5SFLDznUd09G5xzVLcLCPiz\nKAxqbez5qsSHV/sW5EGAOo8B2LQWSz0Jaszy7ONzozywpFRW8NpvU94yCr0f\ncero/2mh8dvdKfiF2ola8o57GAuIil9xI1Pt2YIgQvPtDxSTKzKUaJxlife7\nqMm8\r\n=KWdf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBSrh48HmTzrjlXK/uS/aTnGFjqwdoPg3LdqvkcYaxfgIgeE+3IDTtK6AOGbDTMTsonLUstV/zU5pD+lrzIRQdtFA="}]},"maintainers":[{"name":"samlanning","email":"sam@samlanning.com"}],"_npmUser":{"name":"samlanning","email":"sam@samlanning.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-tree-sitter_1.0.3_1560713683193_0.8569502449965452"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-15T03:24:32.231Z","0.0.1":"2019-06-15T03:24:32.418Z","modified":"2022-05-15T18:13:48.756Z","1.0.0":"2019-06-16T03:41:03.865Z","1.0.1":"2019-06-16T07:26:25.528Z","1.0.2":"2019-06-16T18:24:29.829Z","1.0.3":"2019-06-16T19:34:43.383Z"},"maintainers":[{"email":"sam+npm@samlanning.com","name":"s0"}],"description":"Highlight code in Markdown files using tree-sitter and remark","repository":{"type":"git","url":"https://github.com/samlanning/remark-tree-sitter"},"author":{"name":"Sam Lanning","email":"sam@samlanning.com","url":"https://samlanning.com/"},"license":"MIT","readme":"# remark-tree-sitter\n\n[![Build Status](https://dev.azure.com/samlanning/tree-sitter/_apis/build/status/remark-tree-sitter?branchName=master)](https://dev.azure.com/samlanning/tree-sitter/_build/latest?definitionId=3&branchName=master) [![Total alerts](https://img.shields.io/lgtm/alerts/g/samlanning/remark-tree-sitter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/samlanning/remark-tree-sitter/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/samlanning/remark-tree-sitter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/samlanning/remark-tree-sitter/context:javascript) [![](https://img.shields.io/npm/v/remark-tree-sitter.svg)](https://www.npmjs.com/package/remark-tree-sitter)\n\nHighlight code in Markdown files using\n[tree-sitter](https://github.com/tree-sitter/tree-sitter) and\n[remark](https://github.com/remarkjs/remark).\nPowered by [tree-sitter-hast](https://github.com/samlanning/tree-sitter-hast).\n\n## Installation\n\n```bash\nnpm install remark-tree-sitter\n```\n\nor\n\n```bash\nyarn add remark-tree-sitter\n```\n\n## Usage\n\nThis plugin uses the same mechanism and data as Atom for syntax highlighting,\nSo to highlight a particular language, you need to either:\n\n* Install the APM (Atom) package for that language and tell `remark-tree-sitter`\n  to import it, using the [`grammarPackages` option](#options.grammarpackages).\n  *(See [Atom language packages](#atom-language-packages))*\n* Provide the `tree-sitter` grammar and scopeMappings manually,\n  using the using the [`grammars` option](#options.grammars).\n\n*For more information on how this mechanism works,\n[check out the documentation for `tree-sitter-hast`](https://github.com/samlanning/tree-sitter-hast#scope-mappings).*\n\nAny code blocks that are encountered for which there is not a matching language will be ignored.\n\n### Example\n\nThe following example is also in the [examples](examples/) directory\nand can be run directly from there.\nIt uses `@atom-languages/language-typescript` to provide the TypeScript grammar and \n\n```\nnpm install to-vfile vfile-reporter remark remark-tree-sitter remark-html @atom-languages/language-typescript\n```\n\n[`examples/example.js`](examples/example.js)\n```js\nconst vfile = require('to-vfile')\nconst report = require('vfile-reporter')\nconst remark = require('remark')\nconst treeSitter = require('remark-tree-sitter')\nconst html = require('remark-html')\n\nremark()\n  .use(treeSitter, {\n    grammarPackages: ['@atom-languages/language-typescript']\n  })\n  .use(html)\n  .process(vfile.readSync('example.md'), (err, file) => {\n    console.error(report(err || file))\n    console.log(String(file))\n  })\n```\n\n**Output:**\n\n```html\nexample.md: no issues found\n<pre><code class=\"tree-sitter language-typescript\"><span class=\"source ts\"><span class=\"storage type function\">function</span> <span class=\"entity name function\">foo</span><span class=\"punctuation definition parameters begin bracket round\">(</span><span class=\"punctuation definition parameters end bracket round\">)</span> <span class=\"punctuation definition function body begin bracket curly\">{</span>\n  <span class=\"keyword control\">return</span> <span class=\"constant numeric\">1</span><span class=\"punctuation terminator statement semicolon\">;</span>\n<span class=\"punctuation definition function body end bracket curly\">}</span></span></code></pre>\n```\n\n## Atom language packages\n\nTo use an Atom language package,\nlike any package you first need to install it using `npm install` or `yarn add`.\nUnfortunately most **APM** packages are not made available on **NPM**,\nso I've started to make some of them available under the NPM organization\n[`@atom-languages`](https://www.npmjs.com/org/atom-languages).\nHere's a list of packages with which languages they provide highlighting for.\n\n* [`@atom-languages/language-typescript`](https://www.npmjs.com/package/@atom-languages/language-typescript):\n  `typescript`, `tsx` (TypeScriptReact), `flow`\n\n## API\n\n### `remark.use(treeSitter, options)`\n\nNote that `options` is required, and either `grammarPackages` or `grammars` needs to be provided. (Both can be provided, and grammars specified in `grammars` will overide those loaded in `grammarPackages`).\n\n#### `options.grammarPackages`\n\nAn array of all [Atom language packages](#atom-language-packages) that should be loaded.\n\n**Example:**\n\n```ts\nremark().use(treeSitter, {\n    grammarPackages: ['@atom-languages/language-typescript']\n  })\n```\n\nThe language names that code blocks must then use\nto refer to a language is based on the filenames in the atom package.\nFor example the above package\n[has the files](https://github.com/atom/language-typescript/tree/master/grammars):\n`tree-sitter-flow.cson`, `tree-sitter-tsx.cson`, `tree-sitter-typescript.cson`...\nso this will make the languages `flow`, `tsx` and `typescript`\navailable for use within code blocks.\n\nIf you want to make loaded languages available to use via different names,\nyou can use [`options.languageAliases`](#options.languagealiases).\n\n#### `options.grammars`\n\nAn object mapping language keys objects containing `grammar` and `scopeMappings`.\n\nAnything specified here will overwrite the languages loaded by [`options.grammarPackages`](#options.grammarpackages).\n\n*For more information on scopeMappings, [check out the documentation for `tree-sitter-hast`](https://github.com/samlanning/tree-sitter-hast#scope-mappings).*\n\n**Example:**\n\nSee a working example at [`examples/example-grammars.js`](examples/example-grammars.js).\n\n```ts\nremark().use(treeSitter, {\n    grammars: {\n      typescript: {\n        grammar: typescriptGrammar,\n        scopeMappings: typescriptScopeMappings\n      },\n      'custom-language': {\n        grammar: customLanguageGrammar,\n        scopeMappings: customLanguageScopeMappings\n      }\n    }\n  })\n```\n\nYou can then use both the `typescript` and `custom-language` languages in code blocks:\n\n````md\n```custom-language\nsome code\n```\n\n```typescript\nlet foo = 'bar';\n```\n````\n\nIf you want to make loaded languages available to use via different names,\nyou can use [`options.languageAliases`](#options.languagealiases).\n\n#### `options.classWhitelist`\n\nSometimes including the full list of classes applied by the scope mappings\ncan be too much,\nand you'd like to only include those that you have stylesheets for.\n\nTo do this, you can pass in a whitelist of classes that you actually care about.\n\n**Example:** The following configuration...\n\n```ts\nremark().use(treeSitter, {\n    grammarPackages: ['@atom-languages/language-typescript'],\n    classWhitelist: ['storage', 'numeric']\n  })\n```\n\n...will convert the following markdown...\n\n````md\n```typescript\nfunction foo() {\n  return 1;\n}\n```\n````\n\n...to this:\n\n```html\n<pre><code class=\"tree-sitter language-typescript\"><span><span class=\"storage\">function</span> foo() {\n  return <span class=\"numeric\">1</span>;\n}</span></code></pre>\n```\n\n\n#### `options.languageAliases`\n\n*TODO: `options.languageAliases` is not implemented yet*\n\nTODO:\n\n* Add unit tests for `grammars` option","readmeFilename":"README.md","keywords":["remark-plugin","tree-sitter","remark","syntax-highlighting"]}