jperasmus / docsify-copy-code

A docsify plugin that copies Markdown code block to your clipboard
MIT License
100 stars 73 forks source link

I cannot install the copy code plugin for docsify #18

Closed jackmatrix closed 4 years ago

jackmatrix commented 4 years ago

I am trying to install the docsify copy code plugin. However it doesn't work nothing change in my HTML yet I did all the required steps to make this works.

<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
<script>
window.$docsify = {

      copyCode: {
        buttonText : 'Copy to clipboard',
        errorText  : 'Error',
        successText: 'Copied'
      },
      plugins: [
        window.DocsifyCopyCodePlugin.init()
      ]
    }
<srcipt>

In my console log I have this error

(DevTools failed to load SourceMap: Could not load content for https://unpkg.com/docsify-copy-code.min.js.map: 
   HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)

Any suggestion ?

jperasmus commented 4 years ago

Hi @jackmatrix You can try adding the first script tag below the window.$docsify config object's script. If that doesn't work, here is an example of the plugin used in the wild that might give you some more insights: https://github.com/flamelink/flamelink-js-sdk/blob/master/docs/index.html

jackmatrix commented 4 years ago

Thank you. Works fine now . I put the script tag below window.$docsify as you advised at the extreme bottom. So Finally it works.

Thanks again.

jperasmus commented 4 years ago

Awesome! I'm glad to hear it is working now.