gitbook-plugin-codesandbox-placeholder

1.4.4 • Public • Published

gitbook-plugin-codesandbox-placeholder

Super duper basic CodeSandbox integration for Gitbook 3.x.

book.json

{
    "plugins": [
        "codesandbox-placeholder"
    ],
    "codesandbox-placeholder": {
        "height": "300px",
        "width": "100%",
        "style": "{css applied to the iframe}",
        "theme": "dark|light",
        "view": "editor|split|preview",
        "runonclick": "0|1",
        "editorsize:": "50"
    }
}

Embed your CodeSandbox:

Embed a working Link to a CodeSandbox:

{% codesandbox id="react-101-mzkeh" %}{% endcodesandbox %}

{% codesandbox id="react-101-mzkeh", height="400px", view="editor" %}{% endcodesandbox %}

Link to a CodeSandbox:

{% codesandbox id="mzkeh", link="Click here to go to open the Sandbox", title="custom title", target="_self" %}{% endcodesandbox %}

Default targets to _blank.

Add a CodeSandbox Button:

{% codesandbox id="mzkeh", button="1" %}{% endcodesandbox %}

Otions & Values

All the accepted options are listed in the example above. For values and defaults please refer to: https://codesandbox.io/docs/embedding.

Package Sidebar

Install

npm i gitbook-plugin-codesandbox-placeholder

Weekly Downloads

0

Version

1.4.4

License

MIT

Unpacked Size

4.72 kB

Total Files

3

Last publish

Collaborators

  • marcopeg