miscutils/mkgmap.1

55 lines
1.3 KiB
Groff

.Dd May 29, 2022
.Dt MKGMAP 1
.Os
.Sh NAME
.Nm mkgmap
.Nd Create a simple Gophermap for the current directory
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
generates a simple Gophermap in its standard output,
listing all text files in the current directory
in reverse alphabetical order.
.Pp
File names are assumed to follow the format
.Pa "" Ns Ar date Ns - Ns Ar word Ns -...- Ns Ar word Ns .txt,
where
.Ar date
is a sequence of six digits
\(em 4 for the year, 2 for the month and 2 for the day \(em
and
.Ar word
is a sequence of alphanumerical characters.
For example:
.Bd -literal -offset indent
20220512-this-is-an-example.txt.
.Ed
.Pp
Each Gophermap entry displays the date and the title of the file.
The date is extracted from the file name
and displayed as \(dq[yyyy.mm.dd]\(dq.
The first non empty line of the file is used as the title.
.Pp
If the file
.Pa ~/.mkgmap.head
exists, it will be included at the top of the Gophermap as a header.
.Sh FILES
.Pa ~/.mkgmap.head
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
.Bd -literal -offset indent
$ cat ~/.mkgmap.head # no file / empty
$ ls *.txt
20220601-sample.txt
$ mkgmap
0[2022.06.01] The first line in the file 20220601-sample.txt
$ echo 'Header!' > ~/.mkgmap.head
$ mkgmap
Header!
0[2022.06.01] The first line in the file 20220601-sample.txt
.Ed
.Sh AUTHORS
.An Adolfo Perez Alvarez Aq Mt adolfopa@sdf.org