{"id":21571547,"url":"https://github.com/zheeeng/rehype-meta-string","last_synced_at":"2025-03-18T06:16:21.380Z","repository":{"id":195519796,"uuid":"693098464","full_name":"zheeeng/rehype-meta-string","owner":"zheeeng","description":"A rehype plugin for parsing the meta string of markdown code fence","archived":false,"fork":false,"pushed_at":"2023-12-21T02:22:35.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T05:47:51.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zheeeng.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-18T10:49:57.000Z","updated_at":"2024-10-14T07:57:39.000Z","dependencies_parsed_at":"2023-12-21T05:13:47.785Z","dependency_job_id":"141ef77b-36e4-4673-ae84-e1f0735ff67a","html_url":"https://github.com/zheeeng/rehype-meta-string","commit_stats":null,"previous_names":["zheeeng/rehype-meta-string"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Frehype-meta-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Frehype-meta-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Frehype-meta-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zheeeng%2Frehype-meta-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zheeeng","download_url":"https://codeload.github.com/zheeeng/rehype-meta-string/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166760,"owners_count":20409180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T11:16:39.872Z","updated_at":"2025-03-18T06:16:21.362Z","avatar_url":"https://github.com/zheeeng.png","language":"TypeScript","readme":"# rehype-meta-string\n\n\u003cdiv align=\"center\"\u003e\n\n[![Known Vulnerabilities][known-vulnerabilities-image]][known-vulnerabilities-url]\n[![Maintainability][maintainability-image]][maintainability-url]\n![publish workflow][publish-workflow-image]\n[![license][license-image]][license-url]\n[![GitHub issues][github-issues-image]][github-issues-url]\n![NPM bundle size(minified + gzip)][bundle-size-image]\n\n[known-vulnerabilities-image]: https://snyk.io/test/github/zheeeng/rehype-meta-string/badge.svg\n[known-vulnerabilities-url]: https://snyk.io/test/github/zheeeng/rehype-meta-string\n\n[maintainability-image]: https://api.codeclimate.com/v1/badges/d3eaf22221bf57742429/maintainability\n[maintainability-url]: https://codeclimate.com/github/zheeeng/rehype-meta-string/maintainability\n\n[publish-workflow-image]: https://github.com/zheeeng/rehype-meta-string/actions/workflows/publish.yml/badge.svg\n\n[license-image]: https://img.shields.io/github/license/mashape/apistatus.svg\n[license-url]: https://github.com/zheeeng/rehype-meta-string/blob/master/LICENSE\n\n[github-issues-image]: https://img.shields.io/github/issues/zheeeng/rehype-meta-string\n[github-issues-url]: https://github.com/zheeeng/rehype-meta-string/issues\n\n[bundle-size-image]: https://img.shields.io/bundlephobia/minzip/rehype-meta-string.svg\n\n[![NPM](https://nodei.co/npm/rehype-meta-string.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/rehype-meta-string/)\n\n\u003c/div\u003e\n\n\u003e A rehype plugin for parsing the meta string of markdown code fence.\n\nThis plugin parse the meta string into key-value paris and assign them to `code` tag ast nodes.\n\nThe parsing contains rules below:\n\n* **`true`**: empty or literal value `true` is treated as `true`\n* **`false`**: literal value `false` is treated as `false`\n* **word**: literal string without spaces is treated as word.\n* **sentence**: double quoted, singled quoted, back-ticked string are treated as string.\n* **range**: square brackets wrapped string is treated as range numbers. It requires format like `{digits}-{digits}`.\n* **mixed**: mix all the markers above.\n\nThere is the illustration table:\n\n| meta string     | parsed |\n| --------------- | ------------------- |\n| foo             | { foo: true }       |\n| foo=true        | { foo: true }      |\n|  |  |\n| foo=false       | { foo: false }      |\n|  |  |\n| foo=bar         | { foo: \"bar\" }      |\n|  |  |\n| foo=\"false\"     | { foo: \"false\" }    |\n| foo='false'     | { foo: \"false\" }    |\n| foo=\\`false\\`   | { foo: \"false\" }    |\n| foo=\"true\"      | { foo: \"true\" }     |\n| foo='true'      | { foo: \"true\" }     |\n| foo=\\`true\\`    | { foo: \"true\" }     |\n| foo=\"bar baz\"   | { foo: \"bar baz\" }  |\n| foo='bar baz'   | { foo: \"bar baz\" }  |\n| foo=\\`bar baz\\` | { foo: \"bar baz\" }  |\n|  |  |\n| foo=[42-71]     | { foo: [42, 71] }   |\n|  |  |\n| foo foo1=true foo2=false foo3=bar foo4=\"true\" foo5='false' foo6=\\`hello world\\` foo7=[42-71] | { foo: true, foo1: true, foo2: false, foo3: \"bar\", foo4: \"true\", foo5: \"false\", foo6=\"hello world\", foo7: [42, 71] }\n\n## 🧩  Installation\n\n```bash\nyarn add rehype-meta-string (or npm/pnpm)\n```\n\n## 💫 Options\n\n* **metaString**?: string\n\n\u003e Specify the field name which holds the raw meta string. By default, it is `metaString`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheeeng%2Frehype-meta-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzheeeng%2Frehype-meta-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzheeeng%2Frehype-meta-string/lists"}