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

@infosupport/kc-serve

v2.1.6

Published

serve @revealjs presentations straight from markdown and image files

Downloads

11

Readme

Create and serve reveal.js presentations with ease.

Inspired by reveal-md.

Usage

Global

npm i -g @infosupport/kc-serve
kc-serve --theme @infosupport/kc-cli-theme --highlight darkula

Local

npm i --save @infosupport/kc-serve

package.json:

  "scripts": {
    "start": "kc-serve --theme @infosupport/kc-cli-theme --highlight darkula"
  }

Library

TypeScript:

import serve from '@infosupport/kc-serve';

try {
    serve({
        cwd: process.cwd(), 
        title: 'title',
        theme: 'beige', // or a package
        highlight: 'darkula.css'
    }).listen(port)
    .then(url => console.log(url))
    .catch(err => console.error(err.message));
} catch (err) {
    console.error(err.message)
}

Special folders:

folder | description ----------------|-------------- ./slides | slides (markdown, png, gif, jpg & svg) ./img | image files (from markdown: ![alt-text](img/your-image.jpg)) ./css | custom css

Options:

The options are the same for the library as the command line except the first accepts a working directory and the latter default opens the presentation in the browser.

option | description ----------------|-------------- --theme | resolve to reveal.js theme --highlight | resolve to highlight.js style --port | serve from specified port --no-open | don't open presentation in browser

  • Pick a highlight style from demo or use the css file name from source

  • Use a default reveal.js theme: black, white, league, beige, sky, night, serif, simple or solarized (see: reveal.js#theming) or use a package containing a custom theme (it should resolve to the css via 'main' or explicitly), or override (parts of) a theme with a custom css in the ./css folder

Tips:

  • Order slides with a number prefix (leading zeros may be omitted)
  • Group slides in subdirectories to create vertical slides, see: reveal.js/#markup
  • Make image slides directly from 'png', jpg', 'gif' and 'svg'
  • Inject custom css in the './css' folder
  • Put images in the './img' folder and include from a markdown slide using ![alt-text](img/your-image.jpg)
  • Style images from custom-css with a selector on the alt-text img[alt='alt-text'] or filename img[src='img/your-image.jpg']

Notes

Wrap your own CLI around the library to create a tool with a custom default theme and/or highlight style. Take a look at bin/cli.ts for inspiration.

The main differences with reveal-md are:

  • The way subdirectories are treated. I want to break-up my presentation in small markdown files to make large presentations more maintainable and git-friendly.
  • The way how custom themes are resolved. I didn't want to include a copy of my company theme in each and every presentation.
  • Less configuration options.

Why not contribute to or fork reveal-md? When I tried to cut down the source I found it very entangled. It was a great start to find out what I needed but it was more easy to rebuild it from scratch.