npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datacamp/rdocs-light

v1.0.11

Published

Embeddable RDocumentation widget

Downloads

29

Readme

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

Auto Link to RDocumentation

  • 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

Show Widget also for Rdoc Links

  • Whether or not widgets are shown for links to rdocumentation.org
  • No need for the attribute, just the link
  • Defaults to false
  • Option name: widgetsForRdocsLinks
  • Example links
    • https://rdocumentation.org/packages/dplyr/versions/0.7.1
    • https://rdocumentation.org/packages/dplyr/versions/0.7.1/topics/arrange
    • https://rdocumentation.org/packages/dplyr/
    • https://rdocumentation.org/packages/dplyr/topics/arrange

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/.