61

GitHub - chunqiuyiyu/qov: The terminal presentation tool.

 5 years ago
source link: https://github.com/chunqiuyiyu/qov
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Qov · Build Status npm PRs Welcome GitHub license

The terminal presentation tool.

preivew

Features

  • No third-party dependencies
  • Tagged template literals
  • Styled characters
  • Fragments support
  • Customized keyBinding
  • Auto-sliding
  • Easy to work with other libraries

Getting started

npm install qov

Prepare texts for rendering slides.

const Qov = require('qov')
const qov = new Qov()

qov.section`Section One`            
qov.section`Section Two`           

// Expression interpolation
qov.section`Section ${() => 'Three'}` 

// Render slides
qov.render()

Check demo for more details.

APIs

Constructor

const qov = new Qov({ step?, keymap? })

step: milliseconds between auto-sliding, default is 2000. keymap: customize keyBindings by yourself, defalut keymap is here.

Styles

qov.styles.<Style>(str)

Style: style name, possiable value is blod, faint, italic, underline, slowBlink, rapidBlink, reverse or crossedOut.

str: characters which you want to render.

Colors

Use paint() functon to render characters with color and backgroundColor.

qov.colors.<Color>(str, isBg?)
qov.colors.paint(bgColor, fgColor, str)

Color, bgColor, fgColor: color name(black, red, green, yellow, blue, magenta, cyan, white).

isBg: render characters by backgroundColor or not, default is false.

Much more

via Tagged template literals, you can use other JS packages in Qov slides.The only requirement is that package needs to return a string.

License

MIT


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK