{"_id":"gatsby-remark-component","_rev":"971742","name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","dist-tags":{"latest":"1.1.3"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"time":{"modified":"2024-09-04T19:23:20.000Z","created":"2018-02-04T07:28:55.889Z","1.1.3":"2018-02-16T12:16:56.240Z","1.1.2":"2018-02-13T20:01:14.195Z","1.1.1":"2018-02-13T19:58:37.801Z","1.1.0":"2018-02-05T20:37:10.630Z","1.0.2":"2018-02-04T10:34:51.099Z","1.0.1":"2018-02-04T09:56:31.487Z","1.0.0":"2018-02-04T07:28:55.889Z"},"users":{"hebilicious":true},"author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"versions":{"1.1.3":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.1.3","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"main":"lib.js","files":["src"],"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"pretest":"npm run build","test":"jest","dev":"rollup -c --watch","build":"rollup -c","prepublish":"npm run test"},"license":"MIT","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","rollup":"^0.55.3","remark":"^9.0.0","rollup-plugin-babel":"^3.0.3","rollup-plugin-node-resolve":"^3.0.2"},"gitHead":"79a5e6f0a269da251743373930d632c653d3f3dc","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.1.3","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-bRJ2r7FgdH12+ahsKSFe+OWPTmjw8lBD+S0ytm+p1M9Bfmq2Qai+ROacNAp7d18vZLEhRpzznWJgSU7gEejVXg==","shasum":"9a5276d19028b7eaf1ab30f44070124360b8e34e","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.1.3.tgz","fileCount":8,"unpackedSize":18216,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1jPVvL+YMSHPN7mFANGPEcEIdPd1bHz5qgf6hvxXpbgIhAINEJ9y/TdXQ4W/mexFW+8zK6bkc6ApZiD4L/GLv0Rlh"}],"size":4623,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.1.3.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component_1.1.3_1518783416176_0.5152967512515716"},"_hasShrinkwrap":false,"publish_time":1518783416240,"_cnpm_publish_time":1518783416240},"1.1.2":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.1.2","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"main":"lib.js","files":["src"],"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"pretest":"npm run build","test":"jest","dev":"rollup -c --watch","build":"rollup -c","prepublish":"npm run test"},"license":"MIT","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","rollup":"^0.55.3","remark":"^9.0.0","rollup-plugin-babel":"^3.0.3","rollup-plugin-node-resolve":"^3.0.2"},"gitHead":"9efac6915408d9e4839c1f5c83c3120ddb89d2a0","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.1.2","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-BNRdEFcoJVh3eyGRzhwmWsXv56NNJqbNjzw6AEgJGw479RxYm4kpZb5k5BqHScnb37vr32BwNK7rUTjCrb4rBQ==","shasum":"7cc783ea53a62d6daa0aa0bb4268c15eb51ce3ba","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.1.2.tgz","fileCount":8,"unpackedSize":18186,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF09XlMgu+jQ+HZus+gm7Ihe5Xpe6lGEIjfjvMQp1u6mAiAUYsPf2c0BZDMz8AxAo7Z+rs+4D4SeZ4SF3ozZVsMrfw=="}],"size":4614,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.1.2.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component_1.1.2_1518552073460_0.053155945910261515"},"_hasShrinkwrap":false,"publish_time":1518552074195,"_cnpm_publish_time":1518552074195},"1.1.1":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.1.1","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"main":"lib.js","files":["src"],"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"pretest":"npm run build","test":"jest","dev":"rollup -c --watch","build":"rollup -c","prepublish":"npm run test"},"license":"MIT","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","rollup":"^0.55.3","remark":"^9.0.0","rollup-plugin-babel":"^3.0.3","rollup-plugin-node-resolve":"^3.0.2"},"gitHead":"213871cb20d564d25ef36818780673706e7b9fbe","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-kbPHuvCyeyec3xwSukod09y/FflOxkfvQMS3mqPBDZP0IRWKXSYU509HHjIgmjJXiFKGc4vdlcwgvDSF6J7/NA==","shasum":"f44e71ae85a14f46121bceb46145be8133a7c548","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.1.1.tgz","fileCount":8,"unpackedSize":18186,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyjtrEjU6JNLejf3UmI7dshcLgMVXMMIMnY/P1xjVR1gIgFu4nykKwb1LXSwpIwubxLP3AkUZbTCTYGk3cTA2WGUI="}],"size":4612,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.1.1.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component_1.1.1_1518551917074_0.04121706506657663"},"_hasShrinkwrap":false,"publish_time":1518551917801,"_cnpm_publish_time":1518551917801},"1.1.0":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.1.0","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"main":"lib.js","files":["src"],"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"pretest":"npm run build","test":"jest","dev":"rollup -c --watch","build":"rollup -c","prepublish":"npm run test"},"license":"MIT","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","rollup":"^0.55.3","remark":"^9.0.0","rollup-plugin-babel":"^3.0.3","rollup-plugin-node-resolve":"^3.0.2"},"gitHead":"0744ba50074245a95fb98e42556a0fb57bc0efb6","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-nS+SPXTasIPlYt+w8W6silqc315GpdqKQ0jFJBCaYnMcaPJtWibdihYZCK7mnZ9xBwuHtcYBvIjnQ8DtTubPcw==","shasum":"993edfdd743500df9990f2d3e986dd62217f1c77","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHK3NHV/m8rEO7PcnSwtv7kwFNM6RtSDdS/DEWUBnDD8AiAHl2j35FIEChOAZn1S8aIl/Vp06LPLjCHksHYqtJmKLA=="}],"size":4580,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.1.0.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component-1.1.0.tgz_1517863029668_0.4117089929059148"},"directories":{},"publish_time":1517863030630,"_cnpm_publish_time":1517863030630},"1.0.2":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.0.2","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"test":"jest","build":"babel src --out-file index.js --ignore __tests__","minify":"minify index.js --out-file index.js","prepublish":"npm run test && npm run build && npm run minify"},"license":"MIT","main":"index.js","devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-minify":"^0.3.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","remark":"^9.0.0"},"gitHead":"af516a47fc6fdfc35b892e7a67d0a7e0e9678f1b","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-ZDvlyLf7iehDPZULHbHaPCaX44FbQldETE/OwTGgwz2GBYtu8z8YuhmXT22xtI9vUq+1c5KfmVM3ju5dsCrF2g==","shasum":"75fe6bf152d51f4dcfb9aa88c73b05a73e6b1ec5","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbr+mFUh1Co/dfU3Mp7MGBTWlFbE37l6+ojB2nS1PVDAiEArRIGg8h7sw0IX3xjg+FiWOakzwyBrBKak8/cWwcL0D8="}],"size":2528,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.0.2.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component-1.0.2.tgz_1517740490134_0.017494653817266226"},"directories":{},"publish_time":1517740491099,"_cnpm_publish_time":1517740491099},"1.0.1":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.0.1","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"scripts":{"test":"jest","build":"babel src --out-file dist/dist.js --ignore __tests__","prepublish":"npm run build && npm run test && minify dist -d dist"},"license":"MIT","main":"dist/dist.js","devDependencies":{"@babel/cli":"^7.0.0-beta.39","@babel/core":"^7.0.0-beta.39","@babel/preset-env":"^7.0.0-beta.39","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-jest":"^22.1.0","babel-minify":"^0.3.0","babel-preset-env":"^1.6.1","jest":"^22.1.4","remark":"^9.0.0"},"gitHead":"ee110b9d2d0bf2af46739bdf5488aae7106e1a2a","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-J5t6rT5VSscnTmwQyG39USC4Sdqh05PAU4a2jWWTB75bKl3x8tkbAKmr0PyYM1oQB6k7Z49Q8Z/vViGpGP521Q==","shasum":"4c8371e366117e8411aec0657ba0584b6885bf7a","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxT3ivfPcmLSmuRDijlGxImi37EZmT1Dt/ZffP4VuKsAIgPWTIw2LW1uDA4aRyI6BT+Bj9xeztFRBsubzuNQNQ0nI="}],"size":2554,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.0.1.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component-1.0.1.tgz_1517738191299_0.7368981887120754"},"directories":{},"publish_time":1517738191487,"_cnpm_publish_time":1517738191487},"1.0.0":{"name":"gatsby-remark-component","description":"When you use a React component in your markdown, it will insert it as a div instead of a p","version":"1.0.0","author":{"name":"Hebilicious","email":"xsh4k3@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/hebilicious/gatsby-remark-component.git"},"dependencies":{"unist-util-visit":"^1.1.1"},"keywords":["gatsby","gatsby-plugin","gatsby-transformer-remark","component","remark","markdown"],"license":"MIT","main":"index.js","gitHead":"a85dc323ac827b6d3c2cd80baa3aca8980287c63","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","_id":"gatsby-remark-component@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.4.0","_npmUser":{"name":"hebilicious","email":"xsh4k3@gmail.com"},"dist":{"integrity":"sha512-ZfdADTx3HDxZkmcLfSEqy9EbY/RVDM+y8DskYx0VfBUf9Zqe/ZZjTACwtk5m5t51hhQ4L9GiKYUkNKjAToxrzA==","shasum":"47142c754951fa33eb0f651a5901d6a038dc9382","tarball":"http://registry-npm.ywwl.com/gatsby-remark-component/download/gatsby-remark-component-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1a/0wNI84afdv3RiNfZ0CLh0xLvWswoYNfytkcV0rnAiEAyaHM2Je5Xb2HdTjrMjyPP3dGyu3lJJ2eIhutXiJuSZw="}],"size":1454,"noattachment":false,"key":"/gatsby-remark-component/-/gatsby-remark-component-1.0.0.tgz"},"maintainers":[{"name":"hebilicious","email":"xsh4k3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-remark-component-1.0.0.tgz_1517729334997_0.08762029907666147"},"directories":{},"publish_time":1517729335889,"_cnpm_publish_time":1517729335889}},"readme":"# Gatsby Remark Component [![Build Status](https://travis-ci.org/Hebilicious/gatsby-remark-component.svg?branch=master)](https://travis-ci.org/Hebilicious/gatsby-remark-component) [![npm version](https://badge.fury.io/js/gatsby-remark-component.svg)](https://badge.fury.io/js/gatsby-remark-component)\n\nA gatsby-transformer-remark plugin that change the AST node parent of a custom component to a div.\n\n> * [Gatsby](https://www.gatsbyjs.org/)\n> * [gatsby-transformer-remark](https://www.gatsbyjs.org/packages/gatsby-transformer-remark/)\n\n## Install\n\n```bash\nyarn add gatsby-transformer-remark gatsby-remark-component\n```\n\n## Release Notes\n\n> v 1.1\n\n* New configuration options!\n* Can now auto-detect your custom components.\n\n## How to use\n\n> Read the great custom component article on the official gatsby remark blog [here](https://using-remark.gatsbyjs.org/custom-components/).\n\nThis is the base settings, your components inside your markdown will be auto-detected.\n\n```js\n//In your gatsby-config.js ...\nplugins: [\n  {\n    resolve: \"gatsby-transformer-remark\",\n    options: {\n      plugins: [\"gatsby-remark-component\"]\n    }\n  }\n]\n```\n\nYou can explicitly declare the name of the components if you want to be strict. (it will disable the auto-detection\n)\n\n```js\nplugins: [\n  {\n    resolve: \"gatsby-transformer-remark\",\n    options: {\n      plugins: [\n        {\n          resolve: \"gatsby-remark-component\",\n          options: { components: [\"my-component\", \"other-component\"] }\n        }\n      ]\n    }\n  }\n]\n```\n\nWhen you start gatsby, your queries will be built from your components, and gatsby-remark-components will update the AST tree.\n\nThis will convert this graphql result:\n\n```json\n//...\n{\n  \"type\": \"element\",\n  \"tagName\": \"p\",\n  \"properties\": {},\n  \"children\": [\n    {\n      \"type\": \"element\",\n      \"tagName\": \"my-component\",\n      \"properties\": {},\n      \"children\": []\n    }\n  ]\n}\n```\n\nTo this:\n\n```json\n//...\n//Notice the tag name\n{\n  \"type\": \"element\",\n  \"tagName\": \"div\",\n  \"properties\": {},\n  \"children\": [\n    {\n      \"type\": \"element\",\n      \"tagName\": \"my-component\",\n      \"properties\": {},\n      \"children\": []\n    }\n  ]\n}\n```\n\nNow in your markdown template you can do:\n\n```jsx\nimport rehypeReact from \"rehype-react\"\nimport { MyComponent } from \"../pages/my-component\"\n\nconst renderAst = new rehypeReact({\n  createElement: React.createElement,\n  components: { \"my-component\": MyComponent }\n}).Compiler\n```\n\nReplace :\n\n```jsx\n<div dangerouslySetInnerHTML={{ __html: post.html }} />\n```\n\nby:\n\n```jsx\n<div>{renderAst(post.htmlAst)}</div>\n```\n\nAnd in your page query ... :\n\n```jsx\n//...\nmarkdownRemark(fields: { slug: { eq: $slug } }) {\n htmlAst // previously `html`\n\n //other fields...\n}\n//...\n```\n\nNow in your markdown you can do:\n\n```md\n# Some Title\n\nSome text\n\n<my-component></my-component>\n```\n\nThis will render your component without any validateDOMNesting warning.\n","_attachments":{},"homepage":"https://github.com/hebilicious/gatsby-remark-component#readme","bugs":{"url":"https://github.com/hebilicious/gatsby-remark-component/issues"},"license":"MIT"}