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

live-guide

v0.14.0

Published

Generate style guides based on commented style sheets.

Downloads

23

Readme

live-guide

live-guide is a subset of Markdown that allows developers one place to create both documentation and a styleguide for their end users. Simply write comments, get styleguides!

Example:

/**
 * ### Links
 * Link do not need any special class names to match stylistically, however they should follow some convetions
 * - links should direct users through the page
 * - links should direct pages to outside pages or pages of content within the site structure
 * - links **should not** be used to trigger user actions such as modals.
 *
 * @example html
 * <a href="#">I am a link</a>
 */
a {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    vertical-align: middle;
    font-weight: 700;
    border-bottom: 1px solid transparent;
}

a + a {
    margin-top: 1vw;
}

a:hover {
    border-bottom: 1px solid var(--primary-dk);
}

Use as module:

const styleguide = require('live-guide');
const options = {
    input: "src/**/*.css",
    resources: ['path/to/compiled/style.css', 'path/to/other/required/files/app.js']
};

styleguide(options)
    .then(function(data) {
        // Do something after styleguide is compiled.
        // data refers to an array of objects containing all the relevant data from your build
    });

Options

input

type: path

description: Glob pattern to files to read comments from.

required: true

default: none


output

type: path

description: Where to export HTML files.

required: false

default: ./styleguide


resources

type: Array

description: Path (relative or absolute) to files to import into styleguide examples

required: false

default: none


name

type: String

description name of style guide

required: false

default: Styleguide


Syntax

type: Module

description Additional syntax parsers that will be merged with the default syntaxes. This preforms a deepmerge so you can override existing functionality.

required: false

default: {}


Use in command line:

$ npm install --global live-guide
$ live-guide --input="path/to/**/*.css" --output=/var/www/styleguide --resource path/to/style.css another/path/here.js

Command Line API

styleguider --input **/*.css [options]

Options:
  --input, -i     file(s) (glob pattern) that should be evaulated and built into the Styleguide  [required]
  --output, -o    Where should the output styleguide go? Defaults to current working directory /styleguide
  --resource, -r  additional resources to be loaded into the code example iframes  [array]
  --name, -n      name for the style guide or product
  --syntax, -s    add or override syntax filters to our main parser, this preforms a deepmerge
  --help, -h      Show help  [boolean]

Comments Syntax

@author

Description: Contribute the code to someone. Example:

/* @author Jan Doe */

// @author Jon Doe

@color

Description: Create a color dot with name & description Example:

@color #131313 [Black] - Black is used for body copy

@description

Description: Set a description for this section of the styleguide, generally used after an @title Example:

/* @description This describes your component or module */

//@description This describes your component or module

@example

Description: A code example, similar to writing code blocks in Markdown Any example will need a blank comment line after it. You can add blank lines in examples with . Example:

//@example
//<button class="btn">Click me, I do stuff!</button>
//


/*
@example
*<button class="btn">Click me, I do stuff!</button>
*/

@skip

Description: Allows line to be skipped on output

@title

Description: The title of the component, module or API you are developing

@todo

Description: Let users know what needs to be done in this section of your styleguide

@url

Description: Add a link to the styleguide, automatically opens in a new tab

@writename

Description: If you want the file name to be different than the title, for instance setting up an index page. There is no need to provide a file extension

Todo

  • Log whats happening.
  • Internal Modules
    1. write-html - use all async solutions
  • Handlebars
    1. helpers
      • resource allow HTTP/S resources.