Skip to content

krzysckh/prez

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

	__________________________
	___  __ \_  ___/  _ \__  /
	__  /_/ /  /   /  __/_  /_
	_  .___//_/    \___/_____/
	/_/                       

A simple, configurable terminal presentation tool.

INSTALLATION
============

	git clone https://github.com/krzysckh/prez
	cd prez
	make
	sudo make install

SYNTAX
======

Use a tilde (~) and a single letter command to write text.
After the command, use the same letter, but uppercase to end it.

command		description	usage example
------------------------------------------------------------
p		paragraph	~pThis is a paragraph!~P
h		header		~hThis is a header!~H
b		bold 		~bthis text is bold!~B
c		cursive		~cthis text is cursive~C
i		image		~i/path/to/image.png~I
|[\n]		code		~|\nthis text is code~|
-		next slide	~-


CONFIGURATION
=============

~/.config/prez/prez.cfg

Syntax:

option (tab) value

Configuration options:

option		values		description
------------------------------------------------------------
padding		int 		set padding for text
		(in chars)
header_height	int		set height of a header
		(in chars)	(read HANDLERS section)
code_tabsz	int		set \t size for default 
		(in chars)      code block handler
image_handler	prez | 		set image handler
		/path/to/prg	(read HANDLERS section)
header_handler	prez | 		set a title handler
		/path/to/prg	(read HANDLERS section)
code_handler	prez |		set a code handler
		/path/to/prg	(read HANDLERS section)
code_tmp_fname	/tmp/name	set a name for temporary
				code block files


HANDLERS
========

Handlers can be set in the configuration file.

- image_handler sets a program to run to show an image.
  It runs program with path to the image at the end.
  Defaults to "prez". If set as such, it will just show
  [IMAGE: filename].

  Recommended: imcat[1], img2txt[2], sxiv[3], prez_w3m_handler
  prez_w3m_handler is an experimental handler that uses
  w3mimgdisplay to show images in the terminal. to use it
  copy prez_w3m_handler to somewhere in the $PATH, and set
  image_handler to prez_w3m_handler.

- header_handler sets a program to run when rendering a header.
  It runs program with path to the image at the end.
  Defaults to "prez". If set as such, it will render a rather
  ugly header with letters defined in chars.h

  Recommended: figlet[4], toilet[5], banner[6]

- code_handler sets a program to run when rendering code blocks.
  It runs program with code_tmp_fname at the end.
  Defaults to "prez". If set as such, it will render code
  with padding set to 3*padding. Also it will use code_tabsz
  to set tab size (defaults to 8).

  Recommended: highlight[7], [8]


EXAMPLES
========

(remove tabs)

~/.config/prez/prez.cfg

	padding	5
	image_handler	imcat
	header_handler	figlet -f speed
	code_handler

example.prez 

	~hUNIX systems~H

	~iimage.png~I
	~-
	~pUnix (/ˈjuːnɪks/; trademarked as UNIX) is a family
	of multitasking, multiuser computer operating systems 
	that derive from the original AT&T Unix, whose 
	development started in 1969 at the Bell Labs research 
	center by Ken Thompson, Dennis Ritchie, and others.
	~P
	~-
	~p~bSources~B~P

	~p* https://wikipedia.org~P

BUGS
====

=> ~| (code tag) may not work correctly when used without newline
   after it.

   incorrect: 
	~| /* this is a code block */ ~|
   correct:
	~|
	/* this is a code block */
	~|


REFERENCES
==========

[1] - Preview any size image in a terminal window.
      https://github.com/stolk/imcat/
[2] - Colour ASCII Art Library.
      https://github.com/cacalabs/libcaca
[3] - Simple X Image Viewer.
      https://wiki.archlinux.org/title/Sxiv
[4] - FIGlet is a program for making large letters out of ordinary text.
      http://www.figlet.org/
[5] - The TOIlet project attempts to create a free replacement
      for the FIGlet utility.
      http://caca.zoy.org/wiki/toilet
[6] - The banner program on Unix and Unix-like operating systems outputs
      a large ASCII art version of the text that is supplied to
      it as its program arguments.
      https://en.wikipedia.org/wiki/Banner_(Unix)
[7] - Highlight converts sourcecode to HTML, [...] and terminal escape 
      sequences with coloured syntax highlighting. 
      http://www.andre-simon.de/doku/highlight/en/highlight.php
[8] - Recommended setting: highlight -O ansi --stdout --syntax <language>