Neat!

You might also want to look at _options/optdefs.py in the uwsgi-docs repo :) 
Might be easier to generate stuff from it. I should only figure out a way to 
make sure it's in sync with the various option definitions in the actual 
plugins, etc (not to mention finish up with the few unported docs pages)...

-Aarni

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of C Anthony Risinger
Sent: Thursday, January 31, 2013 11:27 PM
To: uWSGI developers and users list
Subject: [uWSGI] command to generate a PDF of all options

hello,

this is a little random, but i thought there might be a few out there
to whom this is useful; i wrote an obtuse and completely unrefined
"one-liner" to transform the uWSGI --help into a nice-ish PDF of
options for reference:

    HILITE=( 0 0.3 0.1 )
    FONTS=( Raleway-Medium@12 Raleway-Bold@16 Raleway-Heavy@20 )
    NAMES=( "${FONTS[@]%@*}" )
    ./uwsgi --help |
        grep -v Usage |
        tr -d "'" |
        sed -r 's,^\s+([-_a-zA-Z0-9|]+)\s+(.+)$,\1\t\2,g' |
        sort -u -t$'\t' -k2 |
        sort -t$'\t' -k1 |
        sed -r 's,\t,\n,g;s,$,\n,g' |
        sed -r 
's,^(-.*)$,~color{'"${HILITE[*]}"'}~font{'${FONTS[1]}'}\1~font{default}~color{0.25
0.25 0.25},g' |
        enscript "${NAMES[@]/#/--download-font=}" --escape=~
--media=Letter --columns=2 --font=${FONTS[0]}
--header-font=${FONTS[2]} --landscape --title=uWSGI --header='$n
OPTIONS (1.4.5)||$% of $=' --indent=2 --margins=16:16:16:16 --output=-
|
        ps2pdf - uwsgi-options.pdf

...there are obvious issues (like the hard splitting of
words/option-definition-groups) but it serves the intended purpose.

document *might* be attached, if not scrubbed by list software, but if
not it'll be here for some unspecified time:

https://github.com/xtfxme/uwsgi/raw/files-pdf/uwsgi-options.pdf

ENCLOSED: uwsgi-options.pdf

-- 

C Anthony
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to