add a pango section to the documentation, fix some mistakes in the

markdown syntax
This commit is contained in:
speedie 2023-04-02 01:37:37 +02:00
parent 55c2995acb
commit f290d0fc3b
3 changed files with 367 additions and 253 deletions

View file

@ -104,7 +104,7 @@ You may use long, descriptive arguments or the shorter arguments.
: Offset spmenu y position by y offset
`-n, --preselect line`
: Preselect line in the list of items
: Preselect line line in the list of items
`-z, --width width`
: Width of the spmenu window
@ -512,6 +512,56 @@ spmenu supports most color sequences, although not true color by default
There are a few arguments, you can override SGR colors on-the-fly
using the `-sgrX` arguments. See 'Arguments' for more information.
Just as a tip, you can pipe your colored spmenu output
to `sed -e 's/\x1b\[[0-9;]*m//g'`. This will clear the SGR sequences from the output.
This is useful when you want to check what the output actually is.
Pango markup
============
If spmenu was compiled with Pango enabled (default), you should be able to
utilize Pango markup in every part of spmenu. That is, the mode indicator,
items, input, prompt, etc.
Pango markup allows you to style text similar to an HTML document. It also
provides the `<span>` tag, which can be used to do surprisingly complex things.
There are many convenient tags as well which can be used to
avoid using a `<span>` tag, such as:
`<b>`
: **Bold** text (`<b>Bold</b>`)
`<i>`
: *Italic* text (`<i>Italic</i>`)
`<s>`
: Strikethrough text (`<s>Strikethrough</s>`)
`<u>`
: Underline text (`<u>Underline</u>`)
`<sub>`
: Subscript (`<sub>Subscript</sub>`)
`<sup>`
: Superscript (`<sup>Supscript</sup>`)
`<tt>`
: Monospace font (`<tt>Monospaced font is used here</tt>`)
`<small>`
: Small text (`<small>text is so small here</small>`)
`<big>`
: Big text (`<big>text is so big here</big>`)
Note that Pango markup is NOT escaped, and is piped to stdout. Therefore you
need to parse it manually. Doing so with `sed` is very easy. For example:
`... | spmenu ... | sed 's/<big>//g; s/</big>//g'`
See [this page](https://docs.gtk.org/Pango/pango_markup.html) for more information.
Configuration
=============
@ -618,3 +668,9 @@ License
spmenu is licensed under the MIT license because that's the original suckless
license. See the included LICENSE file for more information.
Reporting issues
================
Please report issues on the
[Codeberg repository](https://codeberg.org/speedie/speediegq) or alternatively email me.

View file

@ -118,7 +118,7 @@ spmenu.hideimage: 0
spmenu.prompt:
spmenu.normtext: Normal
spmenu.instext: Insert
spmenu.password: .
spmenu.password: *
!! Pango markup toggles
spmenu.pango_item: 1

View file

@ -120,7 +120,7 @@ Offset spmenu x position by x offset
Offset spmenu y position by y offset
.TP
\f[V]-n, --preselect line\f[R]
Preselect line in the list of items
Preselect line line in the list of items
.TP
\f[V]-z, --width width\f[R]
Width of the spmenu window
@ -535,6 +535,59 @@ spmenu supports most color sequences, although not true color by default
There are a few arguments, you can override SGR colors on-the-fly using
the \f[V]-sgrX\f[R] arguments.
See `Arguments' for more information.
.PP
Just as a tip, you can pipe your colored spmenu output to
\f[V]sed -e \[aq]s/\[rs]x1b\[rs][[0-9;]*m//g\[aq]\f[R].
This will clear the SGR sequences from the output.
This is useful when you want to check what the output actually is.
.SH Pango markup
.PP
If spmenu was compiled with Pango enabled (default), you should be able
to utilize Pango markup in every part of spmenu.
That is, the mode indicator, items, input, prompt, etc.
.PP
Pango markup allows you to style text similar to an HTML document.
It also provides the \f[V]<span>\f[R] tag, which can be used to do
surprisingly complex things.
.PP
There are many convenient tags as well which can be used to avoid using
a \f[V]<span>\f[R] tag, such as:
.TP
\f[V]<b>\f[R]
\f[B]Bold\f[R] text (\f[V]<b>Bold</b>\f[R])
.TP
\f[V]<i>\f[R]
\f[I]Italic\f[R] text (\f[V]<i>Italic</i>\f[R])
.TP
\f[V]<s>\f[R]
Strikethrough text (\f[V]<s>Strikethrough</s>\f[R])
.TP
\f[V]<u>\f[R]
Underline text (\f[V]<u>Underline</u>\f[R])
.TP
\f[V]<sub>\f[R]
Subscript (\f[V]<sub>Subscript</sub>\f[R])
.TP
\f[V]<sup>\f[R]
Superscript (\f[V]<sup>Supscript</sup>\f[R])
.TP
\f[V]<tt>\f[R]
Monospace font (\f[V]<tt>Monospaced font is used here</tt>\f[R])
.TP
\f[V]<small>\f[R]
Small text (\f[V]<small>text is so small here</small>\f[R])
.TP
\f[V]<big>\f[R]
Big text (\f[V]<big>text is so big here</big>\f[R])
.PP
Note that Pango markup is NOT escaped, and is piped to stdout.
Therefore you need to parse it manually.
Doing so with \f[V]sed\f[R] is very easy.
For example:
\f[V]... | spmenu ... | sed \[aq]s/<big>//g; s/</big>//g\[aq]\f[R]
.PP
See this page (https://docs.gtk.org/Pango/pango_markup.html) for more
information.
.SH Configuration
.PP
spmenu has .Xresources (xrdb) support built in.
@ -654,3 +707,8 @@ Report any weird issues you may have.
spmenu is licensed under the MIT license because that\[cq]s the original
suckless license.
See the included LICENSE file for more information.
.SH Reporting issues
.PP
Please report issues on the Codeberg
repository (https://codeberg.org/speedie/speediegq) or alternatively
email me.