diff options
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/manpages.sh | 39 | ||||
-rw-r--r-- | doc/remembering.eo.1.in | 38 | ||||
-rw-r--r-- | doc/remembering.eo.5.in | 28 | ||||
-rw-r--r-- | doc/remembering.es.1.in | 231 | ||||
-rw-r--r-- | doc/remembering.es.5.in | 106 | ||||
-rw-r--r-- | doc/remembering.fr.1.in | 30 | ||||
-rw-r--r-- | doc/remembering.fr.5.in | 26 | ||||
-rw-r--r-- | doc/remembering.pt.1.in | 34 | ||||
-rw-r--r-- | doc/remembering.pt.5.in | 24 |
9 files changed, 438 insertions, 118 deletions
diff --git a/doc/manpages.sh b/doc/manpages.sh index 5c83a37..c88e23b 100755 --- a/doc/manpages.sh +++ b/doc/manpages.sh @@ -1,7 +1,7 @@ #!/bin/sh set -eu -while getopts 'iuHo:p:' flag; do +while getopts 'iup:' flag; do case "$flag" in i) ACTION=install @@ -9,14 +9,8 @@ while getopts 'iuHo:p:' flag; do u) ACTION=uninstall ;; - H) - ACTION=html - ;; - o) - OUTDIR="$OPTARG" - ;; p) - MANPREFIX="$OPTARG" + MANDIR="$OPTARG" ;; *) exit 2 @@ -32,37 +26,30 @@ assert_arg() { fi } -assert_arg "${ACTION:-}" '-[iuH] for choosing action' +assert_arg "${ACTION:-}" '[-iu] for choosing action' for f in "$@"; do l="$(echo "$f" | awk -F. '{print $(NF-1)}')" n="$(echo "$f" | awk -F. '{print $NF}')" case "$ACTION" in - html) - assert_arg "${OUTDIR:-}" '-o OUTDIR' - to_name="$(basename "${f%.$l.$n}.$n.html")" - mkdir -p "$OUTDIR/$l" - pandoc -s -r man -w html --metadata "lang=$l" \ - < "$f" > "$OUTDIR/$l/$to_name" - ;; install) - assert_arg "${MANPREFIX:-}" '-p MANPREFIX' - to_name="$(basename "${f%.$l.$n}.$n")" - mkdir -p "$MANPREFIX/$l/man$n" "$MANPREFIX/man$n" - cp "$f" "$MANPREFIX/$l/man$n/$to_name" + assert_arg "${MANDIR:-}" '-p MANDIR' + to_name="$(basename "${f%."$l"."$n"}.$n")" + mkdir -p "$MANDIR/$l/man$n" "$MANDIR/man$n" + cp "$f" "$MANDIR/$l/man$n/$to_name" ln -fs "../en/man$n/$to_name" \ - "$MANPREFIX/man$n/$to_name" + "$MANDIR/man$n/$to_name" ;; uninstall) - assert_arg "${MANPREFIX:-}" '-p MANPREFIX' - to_name="$(basename "${f%.$l.$n}.$n")" + assert_arg "${MANDIR:-}" '-p MANDIR' + to_name="$(basename "${f%."$l"."$n"}.$n")" rm -f \ - "$MANPREFIX/$l/man$n/$to_name" \ - "$MANPREFIX/man$n/$to_name" + "$MANDIR/$l/man$n/$to_name" \ + "$MANDIR/man$n/$to_name" ;; *) echo "Bad ACTION: $ACTION" - exit 1 + exit 2 ;; esac done diff --git a/doc/remembering.eo.1.in b/doc/remembering.eo.1.in index 8ad9e8c..76b179d 100644 --- a/doc/remembering.eo.1.in +++ b/doc/remembering.eo.1.in @@ -6,17 +6,17 @@ .TH REMEMBERING 1 @DATE@ "remembering @VERSION@" -.SH NOMO +.SH NAME remembering \- sort list from \fISTDIN\fP using past choices as weight. -.SH RESUMO +.SH SYNOPSYS \fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP -.SH PRISKRIBO +.SH DESCRIPTION \fBremembering\fP takes a command that chooses an option as its behaviour, such as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as @@ -26,7 +26,7 @@ it is used, will put the most used choices at the beginning of the list. be sorted. -.SH EBLOJ +.SH OPTIONS .TP \fB\-c\fP \fICOMMAND\fP @@ -42,10 +42,10 @@ Show short help text. .TP \fB\-V\fP, \fB\-\-version\fP -Montras versian numeron. +Show version number. -.SH EKZEMPLOJ +.SH EXAMPLES List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: @@ -194,38 +194,38 @@ you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks line and writes to \fBSTDOUT\fP. -.SH "VIDU ANKAŬ" +.SH "SEE ALSO" \fBremembering\fP(5) -.SH AŬTOROJ +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -kaj la kontribuuloj. +and contributors. -.SH MISFUNKCIOJ +.SH BUGS .IP \(bu -Raportu misfunkcioj al la +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -dissendolisto +mailing list .ME . -Uzu la subjekton "\f(CR[remembering] BUG aŭ TASK: -<priskribo>\fR". +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". .IP \(bu -Foliumu misfunkcioj +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html -rete +online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/eo/ -Ĉefpaĝo +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Komentoj kaj diskutoj +Comments and discussions .UE . diff --git a/doc/remembering.eo.5.in b/doc/remembering.eo.5.in index f3f550f..3f78c56 100644 --- a/doc/remembering.eo.5.in +++ b/doc/remembering.eo.5.in @@ -6,7 +6,7 @@ .TH REMEMBERING 5 @DATE@ "remembering @VERSION@" -.SH NOMO +.SH NAME remembering \- format of the \fIPROFILE\fP text file. @@ -69,38 +69,38 @@ The current raking algorithm increments entries as a simple counter. Every time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. -.SH "VIDU ANKAŬ" +.SH "SEE ALSO" \fBremembering\fP(1) -.SH AŬTOROJ +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -kaj la kontribuuloj. +and contributors. -.SH MISFUNKCIOJ +.SH BUGS .IP \(bu -Raportu misfunkcioj al la +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -dissendolisto +mailing list .ME . -Uzu la subjekton "\f(CR[remembering] BUG aŭ TASK: -<priskribo>\fR". +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". .IP \(bu -Foliumu misfunkcioj +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html -rete +online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/eo/ -Ĉefpaĝo +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Komentoj kaj diskutoj +Comments and discussions .UE . diff --git a/doc/remembering.es.1.in b/doc/remembering.es.1.in index e69de29..76b179d 100644 --- a/doc/remembering.es.1.in +++ b/doc/remembering.es.1.in @@ -0,0 +1,231 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" + + +.SH NAME + +remembering \- sort list from \fISTDIN\fP using past choices as weight. + + +.SH SYNOPSYS + +\fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP + + +.SH DESCRIPTION + +\fBremembering\fP takes a command that chooses an option as its behaviour, such +as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as +it is used, will put the most used choices at the beginning of the list. + +\fBremembering\fP reads from STDIN and writes to STDOUT. It expects STDIN to +be sorted. + + +.SH OPTIONS + +.TP +\fB\-c\fP \fICOMMAND\fP +The \fICOMMAND\fP to be executed, reading from standard input (STDIN). + +.TP +\fB\-p\fP \fIPROFILE\fP +The name of the \fIPROFILE\fP where to look up and store raking data. + +.TP +\fB\-h\fP, \fB\-\-help\fP +Show short help text. + +.TP +\fB\-V\fP, \fB\-\-version\fP +Show version number. + + +.SH EXAMPLES + +List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: + +.RS +.nf +$ ls | remembering \-p fzf\-ls \-c fzf +.fi +.RE + + +Lists all executables available in \fI$PATH\fP, and feed those to \fBdmenu\fP(1) +via \fBremembering\fP, and execute with \fBsh\fP(1) the choice picked: + +.RS +.nf +$ dmenu_path | remembering \-p dmenu\-exe \-c 'dmenu' | sh +.fi +.RE + +.P +Successive invocations will put the frequent choices at the beginning. + +.SS "Simulation of an interactive session" + +Below is a simulation of an interactive session, comparing the usage of +plain \fBfzf\fP(1) against composing it with \fBremembering\fP: + +.RS +.nf +$ mkdir \-p example/ +$ cd example/ +$ touch a b c d e +$ ls +a b c d e +$ ls | fzf +.fi +.RE + +We begin creating a sample directory called "\f(CRexample/\fR", we cd into +it and create 5 empty files: a, b, c, d and e. + +\f(CRls\fR can list the directory for us, in this case in alphabetical +order. + +When we pipe the output of \f(CRls\fR into \fBfzf\fP(1), we are give given its +prompt to pick one option: + +.RS +.nf + e + d + c + b +> a + 5/5 +> +.fi +.RE + +Here \fBfzf\fP(1) lists the items it gets from \fISTDIN\fP in the order that it +was given, and starts at the first one, "a". + +Once we type "d" and press return, the output of \fBfzf\fP(1) is the choice: + +.RS +.nf +$ ls | fzf +d +.fi +.RE + +Now if we run the same command again, we'll be given the same options, in +the same order: + +.RS +.nf +$ ls | fzf + + e + d + c + b +> a + 5/5 +> + +$ ls | fzf +d +.fi +.RE + +\fBfzf\fP(1) is doing what it is told to: making a prompt with the options +given to it from \fISTDIN\fP, in the order it was given. + +In order to have our past choices show up in the beginning of the list, we +can compose \fBfzf\fP(1) with \fBremembering\fP: + +.RS +.nf +$ ls | remembering \-p tutorial\-example \-c 'fzf' + + e + d + c + b +> a + 5/5 +> + +$ ls | remembering \-p tutorial\-example \-c 'fzf' +d +.fi +.RE + +So far we get the exact same behaviour, but saying extra things. We tell +\fBremembering\fP that we want this specific \fIPROFILE\fP to be called +"\f(CRtutorial\-example\fR", and we give \fBremembering\fP the \f(CR'fzf'\fR +command to be ran. + +From now on if we run the exact same command again, \fBremembering\fP will +\fIremember\fP that the last choice was "d", and put it in the beginning of the +list, which \fBfzf\fP(1) happily displays in the order it was given: + +.RS +.nf +$ ls | remembering \-p tutorial\-example \-c 'fzf' + + e + c + b + a +> d + 5/5 +> + +$ ls | remembering \-p tutorial\-example \-c 'fzf' +d +.fi +.RE + +This time the "d" option was already the first one, and we can just press +return to get it as the output value from the command. + +This example used \fBfzf\fP(1) as the \fICOMMAND\fP given to \fBremembering\fP, but +you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks a +line and writes to \fBSTDOUT\fP. + + +.SH "SEE ALSO" + +\fBremembering\fP(5) + + +.SH AUTHORS + +.MT eu@euandre.org +EuAndreh +.ME +and contributors. + + +.SH BUGS + +.IP \(bu +Report bugs to the +.MT ~euandreh/public\-inbox@lists.sr.ht +mailing list +.ME . +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". +.IP \(bu +Browse bugs +.UR https://euandreh.xyz/remembering/TODOs.html +online +.UE . +.IP \(bu +.UR https://euandreh.xyz/remembering/en/ +Homepage +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D +Comments and discussions +.UE . diff --git a/doc/remembering.es.5.in b/doc/remembering.es.5.in index e69de29..3f78c56 100644 --- a/doc/remembering.es.5.in +++ b/doc/remembering.es.5.in @@ -0,0 +1,106 @@ +.\"******************************************************************* +.\" +.\" This file was generated with po4a. Translate the source file. +.\" +.\"******************************************************************* +.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" + + +.SH NAME + +remembering \- format of the \fIPROFILE\fP text file. + + +.SH PROFILE + +The \fIPROFILE\fP is a text file, stored on +\f(CR$XDG_DATA_HOME/remembering/profile\-name\fR if \f(CR$XDG_DATA_HOME\fR is +defined. Otherwise, it lives in +\f(CR~/.local/share/remembering/profile\-name\fR. + +Each line of the \fIPROFILE\fP contains three pieces of information: + +.RS +.IP 1 +the \fBrank\fP of the current entry; +.IP 2 +the \f(CR:\fR separator; +.IP 3 +the \fBentry\fP itself. +.RE + +The \fBrank\fP is a number, and the \fBentry\fP is all the text until the end of +the line after the \f(CR:\fR separator: + +.RS +.nf +0:an entry +0:banana +0:entry +0:something +0:zzz +.fi +.RE + +Above is an example of a \fIPROFILE\fP file where all the entries have the +default \fBrank\fP value: \fB0\fP. + +If the \fICOMMAND\fP runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fP will +be: + +.RS +.nf +0:an entry +1:banana +0:entry +0:something +0:zzz +.fi +.RE + +Now the next time the \fICOMMAND\fP runs it will get \f(CRbanana\fR at the +beginning of the list, and as new picks happen their weight will increase, +and will keep going up in priority. + +The entries of the \fIPROFILE\fP are created and kept sorted. +\fBremembering\fP(1) expects to always find sorted entries in the \fIPROFILE\fP. + +The current raking algorithm increments entries as a simple counter. Every +time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. + + +.SH "SEE ALSO" + +\fBremembering\fP(1) + + +.SH AUTHORS + +.MT eu@euandre.org +EuAndreh +.ME +and contributors. + + +.SH BUGS + +.IP \(bu +Report bugs to the +.MT ~euandreh/public\-inbox@lists.sr.ht +mailing list +.ME . +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". +.IP \(bu +Browse bugs +.UR https://euandreh.xyz/remembering/TODOs.html +online +.UE . +.IP \(bu +.UR https://euandreh.xyz/remembering/en/ +Homepage +.UE . +.IP \(bu +.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D +Comments and discussions +.UE . diff --git a/doc/remembering.fr.1.in b/doc/remembering.fr.1.in index f14bd96..76b179d 100644 --- a/doc/remembering.fr.1.in +++ b/doc/remembering.fr.1.in @@ -6,12 +6,12 @@ .TH REMEMBERING 1 @DATE@ "remembering @VERSION@" -.SH NOM +.SH NAME remembering \- sort list from \fISTDIN\fP using past choices as weight. -.SH SYNOPSIS +.SH SYNOPSYS \fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP @@ -42,7 +42,7 @@ Show short help text. .TP \fB\-V\fP, \fB\-\-version\fP -Imprime le numeró de version. +Show version number. .SH EXAMPLES @@ -194,40 +194,38 @@ you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks line and writes to \fBSTDOUT\fP. -.SH "VOIR AUSSI" +.SH "SEE ALSO" \fBremembering\fP(5) -.SH AUTEURS +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -et les contributeurs. +and contributors. .SH BUGS .IP \(bu -Soumettre un bogue dans la +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -liste -de diffusion +mailing list .ME . -Utilise le sujet "\f(CR[remembering] BUG ou TASK: +Use the subject "\f(CR[remembering] BUG or TASK: <description>\fR". .IP \(bu -Parcourir les bogues +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html -en -ligne +online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/fr/ -Page d'accueil +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Commentaires et discussions +Comments and discussions .UE . diff --git a/doc/remembering.fr.5.in b/doc/remembering.fr.5.in index 9ddeb42..3f78c56 100644 --- a/doc/remembering.fr.5.in +++ b/doc/remembering.fr.5.in @@ -6,7 +6,7 @@ .TH REMEMBERING 5 @DATE@ "remembering @VERSION@" -.SH NOM +.SH NAME remembering \- format of the \fIPROFILE\fP text file. @@ -69,40 +69,38 @@ The current raking algorithm increments entries as a simple counter. Every time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. -.SH "VOIR AUSSI" +.SH "SEE ALSO" \fBremembering\fP(1) -.SH AUTEURS +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -et les contributeurs. +and contributors. .SH BUGS .IP \(bu -Soumettre un bogue dans la +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -liste -de diffusion +mailing list .ME . -Utilise le sujet "\f(CR[remembering] BUG ou TASK: +Use the subject "\f(CR[remembering] BUG or TASK: <description>\fR". .IP \(bu -Parcourir les bogues +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html -en -ligne +online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/fr/ -Page d'accueil +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Commentaires et discussions +Comments and discussions .UE . diff --git a/doc/remembering.pt.1.in b/doc/remembering.pt.1.in index 88a432a..76b179d 100644 --- a/doc/remembering.pt.1.in +++ b/doc/remembering.pt.1.in @@ -6,17 +6,17 @@ .TH REMEMBERING 1 @DATE@ "remembering @VERSION@" -.SH NOME +.SH NAME remembering \- sort list from \fISTDIN\fP using past choices as weight. -.SH SINOPSE +.SH SYNOPSYS \fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP -.SH DESCRIÇÃO +.SH DESCRIPTION \fBremembering\fP takes a command that chooses an option as its behaviour, such as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as @@ -26,7 +26,7 @@ it is used, will put the most used choices at the beginning of the list. be sorted. -.SH OPÇÔES +.SH OPTIONS .TP \fB\-c\fP \fICOMMAND\fP @@ -42,10 +42,10 @@ Show short help text. .TP \fB\-V\fP, \fB\-\-version\fP -Imprime o número da versão. +Show version number. -.SH EXEMPLOS +.SH EXAMPLES List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: @@ -194,38 +194,38 @@ you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks line and writes to \fBSTDOUT\fP. -.SH "VEJA TAMBÉM" +.SH "SEE ALSO" \fBremembering\fP(5) -.SH AUTORES +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -e colaboradores. +and contributors. .SH BUGS .IP \(bu -Relate bugs na +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -lista de discussão +mailing list .ME . -Use o assunto "\f(CR[remembering] BUG ou TASK: -<descrição>\fR". +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". .IP \(bu -Veja os bugs +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/pt/ -Página inicial +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comentários e discussões +Comments and discussions .UE . diff --git a/doc/remembering.pt.5.in b/doc/remembering.pt.5.in index c37c893..3f78c56 100644 --- a/doc/remembering.pt.5.in +++ b/doc/remembering.pt.5.in @@ -6,7 +6,7 @@ .TH REMEMBERING 5 @DATE@ "remembering @VERSION@" -.SH NOME +.SH NAME remembering \- format of the \fIPROFILE\fP text file. @@ -69,38 +69,38 @@ The current raking algorithm increments entries as a simple counter. Every time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. -.SH "VEJA TAMBÉM" +.SH "SEE ALSO" \fBremembering\fP(1) -.SH AUTORES +.SH AUTHORS .MT eu@euandre.org EuAndreh .ME -e colaboradores. +and contributors. .SH BUGS .IP \(bu -Relate bugs na +Report bugs to the .MT ~euandreh/public\-inbox@lists.sr.ht -lista de discussão +mailing list .ME . -Use o assunto "\f(CR[remembering] BUG ou TASK: -<descrição>\fR". +Use the subject "\f(CR[remembering] BUG or TASK: +<description>\fR". .IP \(bu -Veja os bugs +Browse bugs .UR https://euandreh.xyz/remembering/TODOs.html online .UE . .IP \(bu -.UR https://euandreh.xyz/remembering/pt/ -Página inicial +.UR https://euandreh.xyz/remembering/en/ +Homepage .UE . .IP \(bu .UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comentários e discussões +Comments and discussions .UE . |