Pretty printer for the Nginx config?

Lord Nynex lordnynex at gmail.com
Mon May 19 23:37:24 UTC 2014


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 4:17 PM, Dustin Oprea <myselfasunder at gmail.com>wrote:

> On Mon, May 19, 2014 at 7:12 PM, Lyle <webmaster at 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
>
>
>
>>
>> Lyle
>>
>>
>> On 19/05/2014 19:59, Kurt Cancemi wrote:
>>
>> Hello,
>>
>> Would this<https://github.com/lovette/nginx-tools/tree/master/nginx-minify-conf>suit your needs? And the nginx configuration files are written in there own
>> language/syntax.
>>
>>
>> On Mon, May 19, 2014 at 2:49 PM, Lyle <webmaster at cosmicperl.com> wrote:
>>
>>>  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
>>>
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx at nginx.org
>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>
>>
>>
>>
>> _______________________________________________
>> nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx
>>
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140519/220970d0/attachment-0001.html>


More information about the nginx mailing list