examples/with-gatsby-remark-vscode/README.md
What is gatsby-remark-vscode ?
create-docz-appnpx create-docz-app docz-app-with-gatsby-remark-vscode
# or
yarn create docz-app docz-app-with-gatsby-remark-vscode
curl https://codeload.github.com/doczjs/docz/tar.gz/main | tar -xz --strip=2 docz-main/examples/with-gatsby-remark-vscode
mv with-gatsby-remark-vscode docz-with-gatsby-remark-vscode-example
cd docz-with-gatsby-remark-vscode-example
yarn # npm i
yarn dev # npm run dev
yarn build # npm run build
yarn serve # npm run serve
There are two kinds of code blocks in docz.
The first is embedded in the markdown ( ```js ``` ) and the other used with the Playground component (
<Playground>
<SomeComponent />
</Playground>
).
For the one in the playground you won't be able to use gatsby-remark-vscode plugin because it's editable and rendered on the client.
For the second you should be able to add gatsby-remark-vscode :
yarn add gatsby-remark-vscodedoczrc.js file add :gatsbyRemarkPlugins: [
{
resolve: 'gatsby-remark-vscode',
// OPTIONAL
options: {},
},
]
src/gatsby-theme-docz/components/index.js (original can be found here) and add to it :import * as headings from 'gatsby-theme-docz/src/components/Headings'
import { Layout } from 'gatsby-theme-docz/src/components/Layout'
import { Playground } from 'gatsby-theme-docz/src/components/Playground'
import { Props } from 'gatsby-theme-docz/src/components/Props'
export default {
...headings,
playground: Playground,
layout: Layout,
props: Props,
}
Then run yarn docz dev and you should see your code block rendered using gatsby-remark-vscode 🎉 .