Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codedoc-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codedoc-js

A small JS module to copy the content of script tags into code blocks for documentations

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

code-doc

A small JS module to copy the content of script tags into code blocks for documentations

usage

Create a div with the id code-doc:

<div id="code-doc"></div>

And add the class doc to each script tag that you want to copy:

<script class="doc">
// Your awesome code
</script>

Then code-doc will populate the div with the content from the script tags.

api

All API methods return the module itself in order to call them with chaining. If you want to have the first line of each code block as a heading, call

codedoc.heading();

Also, if any additional callback should be triggered (such as highlighting after the code blocks are populated), set it with `callback(func)``:

codedoc.callback(func);

This will trigger the function func once the blocks are ready.

To re-run the code generation, simply call

codedoc.run();

FAQs

Package last updated on 04 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc