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

rwt-xenotools

v1.0.10

Published

Search popular tech forums for questions and answers related to this document, a standards-based DOM Component

Downloads

6

Readme

Open Source DOM Component

Xenotools

Search popular tech websites

Motivation

Sometimes visitors are unsatisfied with the information provided in your document and need to further research the topic. As a convenience to your visitors you can provide quick links to external forums that may have additional information about the your document's main topic.

The rwt-xenotools DOM component facilitates this by keeping a social-media style linkbar hidden at the bottom of the page until the user needs it.

When activated, the linkbar slides over the page content, showing a collection of icons associated with popular tech forums.

Activation may also be initiated through the component's toggleMenu method or through its event interface.

The component has these features:

  • Each third-party link is prefilled with a query value that is determined by the document's <meta content=xenotools:query> value.
  • When appropriate, some links are prefilled with a hashtag values that are determined by the document's <meta content=xenotools:tagged> value.
  • The Reddit link uses any value provided by the document's <meta content=xenotools:subreddit> value.
  • The Github link uses any value provided by the document's <meta content=xenotools:language> value.
  • The linkbar has an event interface for showing and hiding itself.
  • The linkbar emits a custom event to close sibling menus and dialog boxes.
  • A keyboard listener is provided to allow a shortcut key to open/close the linkbar.

In the wild

To see an example of this component in use, visit the BLUEPHRASE website and press F6 "Link to Q&A forums". To understand what's going on under the hood, use the browser's inspector to view the HTML source code and network activity, and follow along as you read this documentation.

Installation

Prerequisites

The rwt-xenotools DOM component works in any browser that supports modern W3C standards. Templates are written using BLUE PHRASE notation, which can be compiled into HTML using the free Read Write View desktop app. It has no other prerequisites. Distribution and installation are done with either NPM or via Github.

Download

Using the DOM component

After installation, you need to add two things to your HTML page to make use of it.

  • Add a script tag to load the component's rwt-xenotools.js file:
<script src='/node_modules/rwt-xenotools/rwt-xenotools.js' type=module></script>             
  • Add the component tag somewhere on the page:
<rwt-xenotools id=xenotools shortcut='F6' role=navigation />

Self identification

The linkbar's inputs are prefilled with values provided in the document's tags. Here's an example:

<meta name=xenotools:query content='h1, h2, h3' />
<meta name=xenotools:tagged content=html />
<meta name=xenotools:language content=HTML />
<meta name=xenotools:subreddit content=HTML5 />

Customization

Dialog size and position

The linkbar is positioned in a fixed location at the bottom of the viewport. Its position and size may be overridden using CSS by defining new values for the bottom, width and height variables.

rwt-xenotools {
    --bottom: 3rem;
    --height: 11rem;
    --width: 30rem;
    --z-index: 1;
}

Dialog color scheme

The default color palette for the dialog uses a dark mode theme. You can use CSS to override the variables' defaults:

rwt-xenotools {
    --color: var(--white);
    --accent-color1: var(--pure-white);
    --background-color: var(--nav-black);
    --accent-background1: var(--pure-black);
    --accent-background2: var(--medium-black);
    --accent-background3: var(--light-black);
    --accent-background4: var(--title-blue);
    --border-color1: var(--gray);    
    --border-color2: var(--pure-white);    
    --border-color3: var(--pure-black);    
}

Life-cycle events

The component issues life-cycle events.


Reference

License

The rwt-xenotools DOM component is licensed under the MIT License.