Giter Club home page Giter Club logo

kittik's Introduction

kittik

Travis (.com) branch Code Coverage GitHub code size in bytes GitHub last commit

GitHub followers Twitter Follow

Do you have a conference soon? Are you tired of presenting slides in Keynote, PowerPoint or any HTML based tool? Why not to create and present slides in the terminal using ASCII only!

NOTE: I’m not arguing that kittik is better than X tool designed for presentations. I’m saying that we can use it for fun in small topics or conferences.

Why

I was always in love with the terminal and what we can do with it, and still is, actually. Someday, I thought, why not to be a little creative and present speech on the conference in the terminal by using ASCII characters only? I tried and turned out that it is a hard task. That is why, I decided, we need a tooling for it!

That is how a name was born, Keynote In the Terminal (KIT) and a palindrome for KIT - KITTIK.

Features

  • Unique shapes rendered via ASCII characters only, e.g. rectangle, ASCII art (aka figlet), code with syntax highlighting and more.
  • Customize how shapes must look like in the terminal, their background and foreground color, positioning in the terminal, width and height.
  • Animate every shape you want. YES! Kittik supports animations and still uses ASCII only. Create a rectangle and slide it in from the left side or make a text printing on the screen.
  • Everything in kittik comes with a builder. No more typing JSON, YAML or objects and guessing keys.
  • Developer Experience is a key feature. Everything in kittik is typed, even your custom names will be typed and suggested to you through autocompletion.
  • Presenter mode. Run your slides and manage them with a keyboard (N - next slide, P - previous slide, Q - quit).

Demo

How to convert an RGB to HEX
demo.ts

Getting Started

All you need is a single dependency - kittik.

npm install kittik

The package provides everything you need to create your own slides - builders. There are builders for shapes, animations, slides and deck. Start with a builder for Deck.

import { DeckBuilder } from "kittik";

DeckBuilder
  .start()
  .end()
  .render();

Every builder has a start() and end() methods. So it is easier to write them down at first place before configuring, that way you will not forget about end(). Although, type check does not allow this situation.

Every deck comprises your slides. To add more slides, just call withSlide() method. It accepts a function where the slide builder will be passed by the deck.

NOTE: the builder is already started in withSlide(), so you need to end it only.

import { DeckBuilder } from "kittik";

DeckBuilder
  .start()
  .withSlide((slide) => slide.end())
  .end()
  .render();

Now, slide builder provides two essential methods withAnimation() and withShape(). withAnimation() accepts a name for your animation (for further references) and the animation that must be built through animation builder. The same applies to withShape(). It accepts a name, and a shape built with shape builder.

That way you can specify animations and shapes for your slide. But kittik does not know in what order to render those shapes and what animations animate what shape. To handle this situation there is withOrder() method. It accepts a name of the shape you defined before and an array of animation names you want to use.

import { DeckBuilder, ShapeBuilder } from "kittik";

DeckBuilder
  .start()
  .withSlide((slide) =>
    slide
      .withShape(
        "Hello, World!",
        ShapeBuilder.start("Text").withText("Hello, World!").end()
      )
      .withOrder("Hello, World!")
      .end()
  )
  .end()
  .render();

Congratulations, you just created a simple Deck with one slide and “Hello, World” in it. Add more slides, animate them and bring them to live.

More Examples

You can find more examples in examples folder.

FAQ

  • It is too hard to create a presentation even with builders and auto-completion

True, if you want to create a lot of slides, it will be not an exceptional experience in declaring them through builders. That is why there is work in progress (only in my mind) for the concept of themes and parsers for different input, e.g. Markdown.

  • Have questions?

Ask them in issues, I’ll be glad to answer them.

License

MIT

kittik's People

Contributors

ghaiklor avatar greenkeeperio-bot avatar shvaikalesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kittik's Issues

Make several useful examples

Add some examples to show what kittik can do, e.g.:

  • Minimal example to show that it can print "Hello, World" in the slide (text.ts);
  • An example to show that it can render distinct shapes with custom options (rectangle.ts);
  • An example to show that shapes can be animated (animation.ts);
  • An example with JavaScript code that is printing out on the console (code.ts);
  • An example to show that kittik has a shape to render figlet art (figlet.ts);
  • An example to show that it can render an image (image.ts);
  • An example to show how builder can be used to build deck with several slides (builder.ts);
  • An example to show that shapes and animations can be created aot and shared across all slides (reusable.ts);

Explain the design behind kittik in contributing guide

  • What are the entities: animation, shape, slide, deck?
  • How does shape render itself on the canvas?
  • How does animation animate properties on the shape?
  • How does slide aggregates animations and shapes and render sequentially?
  • Why Deck?

Improve eslint configuration

ESLint published a major release and it will be nice to dig through change log and adapt our configuration (if needed).

Migrate from Lerna to Rush

There is too much going on in the packages and now it is hard to maintain with lerna. Rush will allow to:

  • Make sure that scripts in each package has defined and add a CLI command to rush to call them;
  • Parallelize some of the commands;
  • Get rid of some strange behaviour (sometimes) when resolving dependencies;
  • Minor stuff

Add a meta package that re-exports all we need to use kittik

There is must be a package named kittik that will hold modules from other packages and provide CLI feature set:

  • Export DeckBuilder
  • Export SlideBuilder
  • Export AnimationBuilder, AnimationType, AnimationObject, AnimationOptions
  • Export ShapeBuilder, ShapeType, ShapeObject, ShapeOptions
  • CLI command to run presentation from *.ts file there are some issues with that one, for beta will be enough to run ts-node itself

Improve version management

Rush cannot handle the versions the way I want. I need to hack it a little and make a unified set of a single version for all packages in kittik. So I could bump everything to the required version by calling rush version.

Support for Markdown

It is hard to use Builder pattern if you want to create an enormous deck with a lot of slides, too much code. So we should support a way to write slides in Markdown, parse it and build a Deck from it automatically.

It will remove a lot of flexibility, but we gain a lot easier way to create slides.

So there should be two ways to create a deck:

  • Through Builder pattern if you want to have a lot of flexibility, like custom positioning on the canvas, your own animations, etc...
  • Through Markdown if you don't care about flexiblity, but about easier slide creation

Improve code highlighting

Shape for the Code supports only JavaScript at the moment. Makes sense to think about how can we improve it to support more languages and still highlight it through our custom renderer.

Maybe, we could use highlight.js, but it does not seem like its parsers returns annotated AST we could use to translate it to our renderer calls API. It returns an HTML with already annotated elements.

So maybe... we could parse an HTML then and extract annotations from there and use it to translate into renderer calls API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.