changeset 108:72524ae53106

Explicitly marked directives with the block syntax. Such directives will have curly braces around their syntax and defaults appear automatically. Other directives will have a semicolon after their syntax and defaults.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 20 Oct 2011 07:47:21 +0000
parents ee725af08951
children 6d801bb6e5ed
files dtd/module.dtd xml/en/docs/http/ngx_http_core_module.xml xml/ru/docs/http/ngx_http_charset_module.xml xml/ru/docs/http/ngx_http_core_module.xml xml/ru/docs/http/ngx_http_geo_module.xml xml/ru/docs/http/ngx_http_map_module.xml xml/ru/docs/http/ngx_http_rewrite_module.xml xml/ru/docs/http/ngx_http_split_clients_module.xml xml/ru/docs/http/ngx_http_upstream.xml xsls/directive.xsls
diffstat 10 files changed, 33 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/dtd/module.dtd	Wed Oct 19 12:39:11 2011 +0000
+++ b/dtd/module.dtd	Thu Oct 20 07:47:21 2011 +0000
@@ -19,6 +19,9 @@
 >
 
 <!ELEMENT   syntax      (#PCDATA | argument | code | parameter | value)* >
+<!ATTLIST   syntax
+            block       (yes | no) "no"
+>
 
 <!ELEMENT   default     (#PCDATA)* >
 
--- a/xml/en/docs/http/ngx_http_core_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/en/docs/http/ngx_http_core_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -658,7 +658,7 @@
 
 
 <directive name="limit_except">
-<syntax><argument>method</argument> ... { ... }</syntax>
+<syntax block="yes"><argument>method</argument> ...</syntax>
 <default/>
 <context>location</context>
 
@@ -986,14 +986,14 @@
 
 
 <directive name="location">
-<syntax>[
+<syntax block="yes">[
         <value>=</value> |
         <value>~</value> |
         <value>~*</value> |
         <value>^~</value>
         ] <argument>uri</argument>
-{ ... }</syntax>
-<syntax><value>@</value><argument>name</argument> { ... }</syntax>
+</syntax>
+<syntax block="yes"><value>@</value><argument>name</argument></syntax>
 <default/>
 <context>server</context>
 <context>location</context>
@@ -1621,7 +1621,7 @@
 
 
 <directive name="server">
-<syntax>{ ... }</syntax>
+<syntax block="yes"/>
 <default/>
 <context>http</context>
 
@@ -2016,13 +2016,11 @@
 
 
 <directive name="types">
-<syntax>{ ... }</syntax>
+<syntax block="yes"/>
 <default>
-{
     text/html  html;
     image/gif  gif;
     image/jpeg jpg;
-}
 </default>
 <context>http</context>
 <context>server</context>
--- a/xml/ru/docs/http/ngx_http_charset_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_charset_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -90,7 +90,7 @@
 
 
 <directive name="charset_map">
-<syntax><value>кодировка1 кодировка2 { ... }</value></syntax>
+<syntax block="yes"><value>кодировка1 кодировка2</value></syntax>
 <default/>
 <context>http</context>
 
--- a/xml/ru/docs/http/ngx_http_core_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_core_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -528,7 +528,7 @@
 
 
 <directive name="limit_except">
-<syntax><value>методы</value> { ... }</syntax>
+<syntax block="yes"><value>методы</value></syntax>
 <default/>
 <context>location</context>
 
@@ -733,8 +733,8 @@
 
 
 <directive name="location">
-<syntax>[<value>=|~|~*|^~|@</value>] <value>/uri/</value>
-{ ... }</syntax>
+<syntax block="yes">[<value>=|~|~*|^~|@</value>] <value>/uri/</value>
+</syntax>
 <default/>
 <context>server</context>
 
@@ -1235,7 +1235,7 @@
 
 
 <directive name="server">
-<syntax>{ ... }</syntax>
+<syntax block="yes"/>
 <default/>
 <context>http</context>
 
@@ -1602,13 +1602,11 @@
 
 
 <directive name="types">
-<syntax><value>{ ... }</value></syntax>
+<syntax block="yes"/>
 <default>
-{
     text/html  html;
     image/gif  gif;
     image/jpeg jpg;
-}
 </default>
 <context>http, server, location</context>
 
--- a/xml/ru/docs/http/ngx_http_geo_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_geo_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -35,7 +35,7 @@
 <section name="Директивы" id="directives">
 
 <directive name="geo">
-<syntax><value>[$адрес] $переменная { ... }</value>
+<syntax block="yes"><value>[$адрес] $переменная</value>
 </syntax>
 <default/>
 <context>http</context>
--- a/xml/ru/docs/http/ngx_http_map_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_map_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -41,7 +41,7 @@
 <section name="Директивы" id="directives">
 
 <directive name="map">
-<syntax><value>$переменная1 $переменная2 { ... }</value></syntax>
+<syntax block="yes"><value>$переменная1 $переменная2</value></syntax>
 <default/>
 <context>http</context>
 
--- a/xml/ru/docs/http/ngx_http_rewrite_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_rewrite_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -50,7 +50,7 @@
 
 
 <directive name="if">
-<syntax>(<value>условие</value>) { ... }</syntax>
+<syntax block="yes">(<value>условие</value>)</syntax>
 <default/>
 <context>server, location</context>
 
--- a/xml/ru/docs/http/ngx_http_split_clients_module.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_split_clients_module.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -38,7 +38,7 @@
 <section name="Директивы" id="directives">
 
 <directive name="split_clients">
-<syntax><value>$переменная1 $переменная2 { ... }</value></syntax>
+<syntax block="yes"><value>$переменная1 $переменная2</value></syntax>
 <default/>
 <context>http</context>
 
--- a/xml/ru/docs/http/ngx_http_upstream.xml	Wed Oct 19 12:39:11 2011 +0000
+++ b/xml/ru/docs/http/ngx_http_upstream.xml	Thu Oct 20 07:47:21 2011 +0000
@@ -159,7 +159,7 @@
 
 
 <directive name="upstream">
-<syntax><value>название</value> { ... }</syntax>
+<syntax block="yes"><value>название</value></syntax>
 <default/>
 <context>http</context>
 
--- a/xsls/directive.xsls	Wed Oct 19 12:39:11 2011 +0000
+++ b/xsls/directive.xsls	Thu Oct 20 07:47:21 2011 +0000
@@ -37,6 +37,11 @@
         X:if "count(node()) != 0" {
             X:text{ } !!;
         }
+        X:if "@block = 'yes'" {
+            X:text{ \{ ... \}}
+        } else {
+            X:text{;}
+        }
         </code>
         <br/>
         X:if "position() = last()" {
@@ -69,7 +74,14 @@
             </strong>
         } else {
             <strong>&#8203;</strong>
-            <code> !{../@name} X:text{ } !!; </code>
+            <code>
+            !{../@name}
+            X:if "count(../syntax[@block='yes'])" {
+                X:text{ \{} !!; X:text{\}}
+            } else {
+                X:text{ } !!; X:text{;}
+            }
+            </code>
         }
         <br/>
         X:if "position() = last()" {