1.2.1 • Published 2 years ago

textpresentation v1.2.1

Weekly downloads
-
License
GPL-2.0-only
Repository
github
Last release
2 years ago

tpt

Text presention program on command line.

TYPESCRIPT NODE.JS Known Vulnerabilities

This program is inspired from tpp.

Contents

Installation

The program can be installed using npm/yarn.

yarn global add textpresentation # yarn
#    OR
npm install -g textpresentation # npm

OR

Compile from source

git clone git@github.com:HARDY8118/tpt.git
cd tpt
yarn install
yarn run build
yarn link

Usage

The program can be used to display presentations from using only command line. To open a presentation use the command line utility and provide with location of presentation

tpt presentation

Controls

Once presentation is started, use the following keys to navigate

KeyFunction
Down, Right, K, LGo to next slide
Up, Left, J, HGo back to previous slide
EscEnd presentation

Slides

Presentations can be created using any text editor and are defined using JSON standard.

{
    "meta": {
        "author": "<author name/email/info>",
    },
    "config": {
        "min-width": 100,
    },
    "slides":[
        {
            "title": "<Slide title>",
            "content": [
                {"type":"text", "text": "content"},
                {"type":"line", "style": "-"},
            ],
            "timming": {
                "NextAfter": 4
            }
        }
    ]
}

Writing slides

Slides can be defined as an array of object, each object holds type and specific properties associated with it.

Following items can be used in slides.

Line

Draw line

{
    "type": "line",
    "width": 50,
    "style": "-"
}
PropertyRequiredTypeDefault valueDescription
typeString"line"Specifies type
widthNumber<terminal width>Width of line in charactters
styleString"-"Line style using (length 1 or 3)
1 Use same character throughtout
3 1st and 3rd characters on sides, 2nd in minddle

List

Show bullet list

{
    "type": "list",
    "items" [ "item1", "item2", "item3" ]
    "style": "> ",
    "margin": 0,
    "heading": "Items"
}
PropertyRequiredTypeDefault valueDescription
typeString"list"Specifies type
itemsString[]List items
styleString"> "Bullet style
marginNumber0Left margin for list
headingString""List heading

Figlet

Figlet can be used to draw large font ascii text.

Internally this program uses figlet package to draw figlet.

Refer figlet documentation for figlet options.

{
    "type": "figlet",
    "text" "figlet"
    "options": {},
}
PropertyRequiredTypeDefault valueDescription
typeString"figlet"Specifies type
textStringFiglet text
optionsFiglet Options{}Options for figlet text

Text

Show plain text

{
    "type": "text",
    "text" "sample text"
}
PropertyRequiredTypeDefault valueDescription
typeString"text"Specifies type
textStringText to display

Hchart

Show horizontal bar chart

{
    "type": "hchart",
    "items": [
        ["item1", 1],
        ["item2", 2],
        ["item3", 3]
    ],
    "showValues": true,
    "style": "■"
}
PropertyRequiredTypeDefault valueDescription
typeString"text"Specifies type
items[String, Number]Items and values
showValuesBooleantrueShow absolute values
styleString"■"Chart style

Timming

Additionally a timming object can be provided with slide to control timming of slide. The supported properties are:

PropertyTypeDescription
NextAfterNumberScroll to next page after specified seconds

Contributing

Refer to CONTRIBUTING.md for instructions on how to contribute.

1.2.5

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.0

3 years ago