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

kc-cli-fork-nico

v4.8.0-beta.1

Published

CLI for serving slick Reveal.js presentations for the Info Support Kenniscentrum

Downloads

3

Readme

kc-cli

The one-stop-shop for @infosupport employees to create and serve slick Reveal.js presentations.

Install

Both local and global installations are possible. Global is easiest and therefore the recommended approach.

Global

This has the advantage that you only have to install it and you're ready to go.

npm install --global @infosupport/kc-cli # Windows
npm install --global @infosupport/kc-cli --unsafe-perm=true # Linux

Local

With this, you are free to choose when you want to upgrade to newer versions of the CLI with, for example, a new corporate design.

You will have to make it an npm project.

npm init --yes
npm install @infosupport/kc-cli # Windows
npm install @infosupport/kc-cli --unsafe-perm=true # Linux

Then, in the package.json, add a start script:

{
    "scripts": {
        "start": "kc serve"
    }
}

Usage

TO get a setup quick and easy, run kc init. This will generate a folder structure similar to this:

|-- css
    |-- code.css
    |-- layout.css
|-- assets
    |-- logo.svg
|-- slides
    |-- 01-welcome
    |    |-- 01-intro.md
    |    |-- 02-agenda.md
    |-- 02-finance
        |-- 01-intro.md
        |-- 02-past-year.md
        |-- 03-projections.md
|-- web-components
    |-- cool-graph
        |-- cool-graph.js
        |-- cool-graph.html.js
        |-- cool-graph.css.js

From there, use your favorite text editor (e.g., Visual Studio Code) to change the content of the slides, modify the custom CSS, etc.

A couple of notes on the project folders:

  • /slides contains subdirectories for each chapter/module and holds markdown files (the slides) inside those subfolders. /slides is the only required folder for a minimal setup
  • /css is for customizing the style of your presentation using CSS
  • /assets is for holding assets like images and videos. You can also name this folder something else like /img
  • /web-components is for your own custom, interactive presentation widgets. It's advanced stuff. Scroll down for more information.

To view your presentation:

kc serve     # for global installations
npm start    # for local installations

Serve

option | description ---------------------|-------------- kc serve | serve presentation from current directory on default port kc serve -o | open presentation in default browser kc serve -p | use random port kc serve -p <port> | use specified <port> kc serve --nolive | disable live reload

Print

This will export your slides to PDF using Decktape and pdf-lib. First, Decktape reads all the presentation slides and uses pdf-lib to generate a PDF where every page is a slide. With a bit of custom code, this PDF is transformed into a PDF that fits our corporate design.

kc print will serve the presentation itself.

option | description --------------|------------------- kc print | print presentation to PDF using default url (http://localhost:15000) and the folder name as filename kc print --url [url] | use specified url kc print --output [filename] | use specified filename kc print --module [module number] | generate a PDF for a specific module kc print --per-module | generate a PDF for each module. The module titles will be used for filenames

Linting

option | description --------------------|-------------- kc lint | diagnose issues for when the presentation isn't running as it should

Corporate identity

By default, the corporate identity is applied to every slide. Certain slides can receive specific theming.

  • For the welcoming slide, often the very first slide, add <!-- .slide: class="is-welcome" -->
  • For a new chapter, add <!-- .slide: class="is-module" -->
  • For the closing slide, the very last slide, add <!-- .slide: class="is-closing" -->
  • To add a lab slide, add <!-- .slide: class="is-lab" -->
  • To disable theming, add <!-- .slide: class="is-empty" -->

Layouting and styling

The CLI offers a few options out of the box:

  • kc-flex to turn an element into a flex container
  • kc-columns to turn an element into a flex container where all its children have an equal width
  • kc-grid to apply a grid to an element
  • kc-gap1 through kc-gap5 to create a gap between flex/grid items
  • kc-table to apply alternating row colors to a table
  • kc-smaller to decrease font size
  • kc-smallest to decrease font size further
  • kc-left and kc-right for floating left/right
    • or alignment with margin for tables

Apply these classes with a bit of HTML

<div class="kc-flex">

* item 1
* item 2
* item 3

</div>

or with special comments

![Example image](img/example.png)
<!-- .element: class="kc-right" -->

See the example/ folder for exact implementations.

Web Components

With Reveal.js, we can leverage Web Components to make slides more awesome. Right now, you can use these components out-of-the-box.

Note that web components are not natively supported in IE and this CLI is quite comfortable with not making any effort whatsoever to make it work in those browsers.

web component | description --------------|------------ <kc-timeline events='[{ "year": 2019, "caption": "cool stuff", "description": "detailed explanation of cool stuff" }]'> | A graphical visualization of a timeline. <npm-weekly-downloads package="@stryker-mutator/core"></npm-weekly-downloads> | Retrieves the number of weekly downloads for an npm package. Also caches the number in the session storage as to unburden npm's servers

If you have (created or not) a web component that should be in this list, please let us know.

Customization and fun stuff

  • The free version of font awesome v5 is included by default.
  • Add your own custom CSS by creating a folder css and placing .css files in there.
  • Add your own web components by creating a folder web-components with subfolders for every components. The main .js file should be the same name as the folder it's in.

Example folder structure:

|-- css
    |-- ...
|-- slides
    |-- ...
|-- web-components
    |-- cool-graph
        |-- cool-graph.js
        |-- cool-graph.html.js
        |-- cool-graph.css.js

Roadmap

  • Integrate kc-cli with DevOps.

Known issues

None at the moment.