From b68ebb8e338114da3a21991e8423d00fbd83a0b9 Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Wed, 25 Oct 2023 17:43:11 -0400 Subject: Rewrite man page in mdoc --- .gitignore | 1 - Makefile | 16 ++++------------ README.md | 14 +++++--------- srtplay.1 | 38 ++++++++++++++++++++++++++++++++++++++ srtplay.1.scd | 32 -------------------------------- 5 files changed, 47 insertions(+), 54 deletions(-) delete mode 100644 .gitignore create mode 100644 srtplay.1 delete mode 100644 srtplay.1.scd diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 172332b..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/srtplay.1 diff --git a/Makefile b/Makefile index 931eb44..4cedf7b 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,17 @@ .POSIX: +.SUFFIXES: PREFIX=/usr/local BINDIR=$(PREFIX)/bin MANDIR=$(PREFIX)/share/man -all: srtplay srtplay.1 +all: -srtplay: - perl -c srtplay - -srtplay.1: srtplay.1.scd - scdoc < $< > $@ - -clean: - rm -f srtplay.1 - -install: srtplay srtplay.1 +install: install -Dm755 srtplay $(BINDIR)/srtplay install -Dm644 srtplay.1 $(MANDIR)/man1/srtplay.1 uninstall: rm -f $(BINDIR)/srtplay $(MANDIR)/man1/srtplay.1 -.PHONY: all srtplay clean install uninstall +.PHONY: install uninstall diff --git a/README.md b/README.md index acfbaeb..48aa2f5 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,20 @@ # srtplay -Play .srt subtitle files in a terminal. +Play SRT subtitle files in a terminal. ## Installation -1. Install [Perl](https://perl.org) and [scdoc](https://git.sr.ht/~sircmpwn/scdoc) +1. Install [Perl](https://perl.org) 2. Install the Time::HiRes, Term::ReadKey, and XML::Parser Perl modules -3. `make` -4. `make install` +3. `make install` ## Usage ```sh -srtplay .srt +srtplay ``` -See the [man page](https://git.sr.ht/~stonks3141/srtplay/tree/main/item/srtplay.1.scd) -for further information. - -### TUI key bindings +### Key bindings - `q`, ``: exit the program - `k`, ``: pause or resume playback diff --git a/srtplay.1 b/srtplay.1 new file mode 100644 index 0000000..56d1ee2 --- /dev/null +++ b/srtplay.1 @@ -0,0 +1,38 @@ +.Dd $Mdocdate$ +.Dt SRTPLAY 1 +.Os +.Sh NAME +.Nm srtplay +.Nd text-mode player for SRT subtitle files +.Sh SYNOPSIS +.Nm +.Ar FILE +.Sh DESCRIPTION +.Nm +plays SRT subtitle files in a text-based interface. After running +.Nm +with the name of the subtitle file to play, it displays the elapsed time +as well as the subtitles. The , , and HTML tags are +supported in the subtitles and will be displayed as bold, italic, and +underlined, respectively. Other tags are ignored and stripped from the +output. +.Ss KEY BINDINGS +The following keys may be pressed at any time. +.Bl -hang +.It q, +exit the program +.It k, +pause or resume playback +.It j +fast-backward by 10 seconds +.It l +fast-forward by 10 seconds +.El +.Sh AUTHORS +Maintained by +.An Sam Nystrom +.Mt sam@samnystrom.dev . +Source code is available at +.Lk https://git.sr.ht/~stonks3141/srtplay . +Send patches and bug reports to +.Mt ~stonks3141/public-inbox@lists.sr.ht . diff --git a/srtplay.1.scd b/srtplay.1.scd deleted file mode 100644 index fe5ee9c..0000000 --- a/srtplay.1.scd +++ /dev/null @@ -1,32 +0,0 @@ -srtplay(1) - -# NAME - -srtplay - play .srt subtitle files in a terminal - -# SYNOPSIS - -*srtplay* <_file_>.srt - -# DESCRIPTION - -*srtplay* plays a .srt subtitle file in a TUI (Terminal User Interface). After -running *srtplay* with the name of the subtitle file to play, it displays the -elapsed time as well as the subtitles. The , , and HTML tags are -supported in the subtitles and will be displayed as bold, italic, and -underlined, respectively. - -# KEY BINDINGS - -The following keys may be pressed at any time. - -- *q*, **: exit the program -- *k*, **: pause or resume playback -- *j*: fast-backward by 10 seconds -- *l*: fast-forward by 10 seconds - -# AUTHORS - -Maintained by Sam Nystrom . Source code is available at -https://git.sr.ht/~stonks3141/srtplay. Send patches and bug reports to -~stonks3141/public-inbox@lists.sr.ht. -- cgit v1.2.3