Forum: NGINX Pretty printer for the Nginx config?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fd3cf7443ec490fcaab7d899a699dd20?d=identicon&s=25 Lyle (Guest)
on 2014-05-19 20:50
(Received via mailing list)
Is there a pretty printer for this file? It doesn't seem to be in any
particular language. I tried a JS beautifier but that broke things.


Lyle
2fd0c3f17efded066208e74d8e7f307e?d=identicon&s=25 Kurt Cancemi (Guest)
on 2014-05-19 21:00
(Received via mailing list)
Hello,

Would
this<https://github.com/lovette/nginx-tools/tree/master...
your needs? And the nginx configuration files are written in there own
language/syntax.
Fd3cf7443ec490fcaab7d899a699dd20?d=identicon&s=25 Lyle (Guest)
on 2014-05-20 01:13
(Received via mailing list)
It's kind of along the right lines, but I need to keep comments, etc.
Just have consistent whitespace more than anything else.


Lyle
Bb7e85832e0110214043a8726ad70a76?d=identicon&s=25 Dustin Oprea (Guest)
on 2014-05-20 01:18
(Received via mailing list)
On Mon, May 19, 2014 at 7:12 PM, Lyle <webmaster@cosmicperl.com> wrote:

>  It's kind of along the right lines, but I need to keep comments, etc.
> Just have consistent whitespace more than anything else.
>
>
You might write your own and make it available.



Dustin
Ba5061f1803f9ab0cfc3d53366d49546?d=identicon&s=25 Lord Nynex (Guest)
on 2014-05-20 01:37
(Received via mailing list)
I do something similar to this in some backend config management code I
wrote awhile back. I've created a gist with some code snippets to help
understand how I'm reading/writing the config.

https://gist.github.com/lordnynex/1a568e54b5d1af38f549

Obviously this is not what you're looking for, and pretty printing feels
less pretty when your code is formatting it, but this sufficiently meets
your criteria with a bit of work.

Side note, I am not the original author of the grammar. I'd love to give
him credit, but it was so long ago I can't find the original.
Bb7e85832e0110214043a8726ad70a76?d=identicon&s=25 Dustin Oprea (Guest)
on 2014-05-20 01:43
(Received via mailing list)
On Mon, May 19, 2014 at 7:37 PM, Lord Nynex <lordnynex@gmail.com> wrote:

> Side note, I am not the original author of the grammar. I'd love to give
> him credit, but it was so long ago I can't find the original.
>
>
That's great, @LordNynex (I'm not the OP)... Though I have to admit that
memories of my days at a PERL-based transaction-processor came
screeching
back when I saw the code.
This topic is locked and can not be replied to.