Back to poking at dictfmt, since I started building my own personal dictionary I can access through dict, and I don't particularly like any of the formats dictfmt expects.
I had a go at using refer + groff to pipe to dictfmt.
Formatting refer's output is trivial, since you can
just override the .][
macro to access the
various [K
, [T
, [X
string registers, but it just inserts the
annotation text - collected as is from the %X
lines - straight after that, which troff takes to be a single
paragraph.
Fixing that is just matter of setting a
trap with .it
so that it breaks and inserts an
empty line after each input line, but troff
behaves in a frustrating way where it comes to multiple runs
of spaces, which it inserts as-is.
Fixing that is doable by shoving the output
into fmt -u
, made even easier by the fact that
those lines will be indented and can thus be targeted via
the -p
option, but...
There isn't an easy way I can think of to differentiate between paragraphs (which should be followed by an empty line) and simple line breaks - e.g. in example blocks - and since I already got up to three "but"s, I am probably better off just editing the dictionary source by hand.