Socket
Socket
Sign inDemoInstall

kc-cli-fork-nico

Package Overview
Dependencies
285
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    kc-cli-fork-nico

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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

optiondescription
kc serveserve presentation from current directory on default port
kc serve -oopen presentation in default browser
kc serve -puse random port
kc serve -p <port>use specified <port>
kc serve --nolivedisable 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.

optiondescription
kc printprint 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-modulegenerate a PDF for each module. The module titles will be used for filenames

Linting

optiondescription
kc lintdiagnose 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 componentdescription
<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.

FAQs

Last updated on 24 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc