Socket
Socket
Sign inDemoInstall

@datacamp/rdocs-light

Package Overview
Dependencies
48
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @datacamp/rdocs-light

Embeddable RDocumentation widget


Version published
Weekly downloads
18
increased by100%
Maintainers
4
Install size
3.61 MB
Created
Weekly downloads
 

Readme

Source

rdocs-light

Embeddable RDocumentation widget

Widget Image

How does it work?

Html elements with the data-mini-rdoc attribute will show a tooltip with information when hovered over. The value of the attribute should be of the form package::topic or just package. The version of the package can also be defined with the optional data-mini-rdoc-version attribute.

If the version attribute is not provided:

  • For a package the documentation for the latest version of that package will be shown.
  • For a topic the documentation for the topic in the latest version of the package (which contains the topic) will be shown.

How to use?

  • Load rdocs-light.min.js in your webpage.
  • Call rdl.initRDocsLight(options); on page load
  • Tags with the data-mini-rdoc attribute can be automatically changed to link to the documentation.
  • Can also be used standalone (without initiating RDocsLight)
  • Call rdl.autoLink();

Options

Container
  • The DOM element the library searches through
  • Default to the body of the page
  • Option name: container
Auto Pinning
  • Whether or not the widget is pinned automatically.
  • Defaults to false
  • Option name: autoPin
Pin on click
  • Whether or not the widget is pinned when the user clicks on the widget.
  • Defaults to true
  • Option name: pinOnClick
Set top offset
  • If there is a fixed element positioned at the top of the scrollable element, you can set the offset
  • Defaults to 0
  • Option name: topOffset
Show Usage Section For Topics
  • Whether or not to show the usage section in the widget
  • Default to false
  • Option name: showTopicUsageSection
Show Arguments Section For Topics
  • Whether or not to show the arguments section in the widget
  • Default to false
  • Option name: showTopicArgumentsSection

Examples

You can find examples in the example folder in the repository.

Building

  • After you downloaded this repository, run npm install for all the necessary dependencies.
  • Create a .env file in which you define all environment variables. See .env.example for all variables that need to be defined. For example, if you also run the RDocumentation-app local, you will have to set API_BASE_URL to http://localhost:1337.
  • Afterwards you can use npm run dev to build RDocs Light and node web.js to serve random examples with local build on http://localhost:3003/.

FAQs

Last updated on 18 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc