1.4.3 • Published 8 months ago

textpresentation v1.4.3

Weekly downloads
-
License
GPL-2.0-only
Repository
github
Last release
8 months 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",
    "align": "left",
    "style": {
        "textColor": "black",
        "backgroundColor": "bgWhite",
        "styles": ["bold", "underline"]
    }
}
PropertyRequiredTypeDefault valueDescription
typeString"text"Specifies type
textStringText to display
alignString"left"Text alignment
styleObjectText style properties

Text style properties

PropertyDescriptionEnum
textColorForeground text colorblackredgreenyellowbluemagentacyanwhitegraygrey
backgroundColorBackground color of textbgBlackbgRedbgGreenbgYellowbgBluebgMagentabgCyanbgWhite
stylesList of formatting stylesbolddimitalicunderlineinversehiddenstrikethrough

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

Code

Code segment with highlighting

{
    "type": "code",
    "lang": "",
    "code": [
        "console.log('Hello');"
    ]
}
PropertyRequiredTypeDefault valueDescription
typeString"text"Specifies type
langStringundefinedLanguage of code (can be empty)
codeString[]trueCode to dispay, each line as array item

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.

Other Projects

A list of projects which can be useful for making text based presentations.

  • Boxart Svelte app to easily create Unicode box arts.
  • Diagon Interactive ASCII art diagram generators. 🌟
  • taag Interactive FIG driver
1.4.3

8 months ago

1.4.2

8 months ago

1.3.3

9 months ago

1.4.1

8 months ago

1.3.1

9 months ago

1.2.5

3 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.2.1

3 years ago

1.1.0

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago