Pretty printer for the Nginx config?

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

Hello,

Would
thishttps://github.com/lovette/nginx-tools/tree/master/nginx-minify-confsuit
your needs? And the nginx configuration files are written in there own
language/syntax.

It’s kind of along the right lines, but I need to keep comments, etc.
Just have consistent whitespace more than anything else.

Lyle

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.

On Mon, May 19, 2014 at 7:12 PM, Lyle [email protected] 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

On Mon, May 19, 2014 at 7:37 PM, Lord N. [email protected] 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.