#!/bin/bash
# text - text file support
set -e
lib_load 'doc/tool/enscript'
######
# Config
doc_text_config_init() {
	:
}
doc_text_config_check() {
	:
}
######
# text support
text_pdf() {
	min_args 1 "$@"
	local src=$1
	local dst=${2:-$src.pdf}
	local tmp
	tmp=$(cmd_tempfile)
	run_enscript "$src" -o - >"$tmp"
	run_ps2pdf "$tmp" "$dst"
}
run_text_pdf_viewer() {
	local tmp
	tmp=$(cmd_tempfile)
	text_pdf "$1" "$tmp"
	run_pdf_viewer "$tmp"
}