filecoin-docs icon indicating copy to clipboard operation
filecoin-docs copied to clipboard

Adds non-copy-code-blocks.

Open johnnymatthews opened this issue 2 years ago • 0 comments

This PR is a port of https://github.com/filecoin-project/lotus-docs/pull/282.

The site now looks for <pre> tags that have an immediate sibling that is another <pre> tag. If there is one, the reduces the marginBottom to 0. Then on the next element (the second <pre> tag, it removes the copy button, sets the marginTop to 0, and reduces the opacity to 0.8.

This now means that if you've got a codeblock with an output, then you need to put the output in it's own codeblock immediately after the codeblock with the input:

1. Install the serve package:

    ```shell
    npm install serve
    ```

    ```shell
    npm installing blah blah blah
    whatever npm outputs these days
    honestly, nobody ever reads npm output anyway.
    ```

1. Run the serve thingy:

    ```shell
    serve
    ```

    You can also run serve with a path:

    ```shell
    serve ./public
    ```

This outputs this:

image

johnnymatthews avatar Jun 16 '22 17:06 johnnymatthews