Closed kojq closed 5 months ago
- author text is right-justified
- choose justification of the quote and author
What exactly do you mean by this? Could you please give an example? If that is just "simple normal" text justification as in any GUI, then i think it's impossible, because program operates in "cli mode" and therefore (i think) can't even know terminal's size.
- newline between quote and author
- option to remove author
- option to remove quotation marks from quotes
- option to wrap after, for example, a certain number of characters
Yes, i agree, this is very good QOL feature, and i'm planning to implement it in the nearest future. All of the above should be easily achievable with proper formatting option, maybe something like this:
"%q"\n-- %c(, "%s")
, here %q
- quote, %c
- character, (, "%s")
- optional source (would be nothing if no source available)"%q"\n\n-- %c(, "%s")
- same as default, but with additional \n
"%q"\n-- ("%s")
%q\n-- %c(, "%s")
***
): ***"%q"\n-- %c(, "%s")***
If you look at fortune, the author text is right-justified (it seems a certain number of spaces are simply added to give that look).
This is the same thing, but applied to all text.
6) Wrap meaning after "x" number of words, a put the remaining text on the next line for each line.
Example for 1
Ninety percent of the time things turn out worse than you thought they would.
The other ten percent of the time you had no right to expect that much.
-- Augustine
Example for 2
Ninety percent of the time things turn out worse than you thought they would.
The other ten percent of the time you had no right to expect that much.
-- Augustine
Example for 6
Ninety percent of the time things turn
out worse than you thought they would.
The other ten percent of the time you
had no right to expect that much.
-- Augustine
Also, unlike fortune, could we have em dash (—) for quote attribution instead?
Also, unlike fortune, could we have em dash (—) for quote attribution instead?
Yeah, sure, i think this could be an option. Or as a more general solution it would be possible to change it using formatting option.
I see what you mean by justifying and wrapping. Probably will do after formatting option.
- newline between quote and author
- option to remove author
- option to remove quotation marks from quotes
Done via feat: format option (26eb35c)
- option to wrap after, for example, a certain number of characters
As it turns out there is just right command from GNU coreutils that does exactly that: fmt
.
So you can do gensoquote | fmt -s -w 40
, and it will be wrapped after 40 characters.
author text is right-justified
choose justification of the quote and author
As for these, it can be achieved by
gensoquote -f '"%q"\n -- %c( to %t)( about %a), "%s"'
fmt
awk
, sed
, python
or any other utility, for example to shift by 10 spaces:gensoquote | awk '{ printf "%20s%s\n", "", $0 }'
gensoquote | sed 's/^/ /'
gensoquote | python3 -c "import sys; [print(' '*10 + line, end='') for line in sys.stdin]"
For the ultimate result, combine them to whatever your liking is ;)
These could be flags/configs or just general changes: