Mercurial > hg > nginx
changeset 3996:fc808f006ff4
skeleton for documentation processing
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 05 Aug 2011 09:25:34 +0000 |
parents | 3ce6b8cedcb9 |
children | cb90f030acfd |
files | docs/GNUmakefile docs/dtd/module.dtd docs/html/http/ngx_http_core_module.html docs/xml/http/ngx_http_core_module.xml docs/xsls/content.xsls docs/xsls/directive.xsls docs/xsls/module.xsls docs/xslt/content.xslt docs/xslt/directive.xslt docs/xslt/module.xslt |
diffstat | 10 files changed, 271 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/GNUmakefile +++ b/docs/GNUmakefile @@ -52,3 +52,19 @@ docs/xslt/changes.xslt: docs/xsls/chang $(call XSLScript, docs/xsls/changes.xsls, $@) +html: \ + docs/html/http/ngx_http_core_module.html + +docs/html/http/ngx_http_core_module.html: \ + docs/xml/http/ngx_http_core_module.xml \ + docs/xslt/module.xslt \ + docs/dtd/module.dtd + $(call XSLT, docs/xslt/module.xslt, $<, $@) + +docs/xslt/module.xslt: docs/xsls/module.xsls \ + docs/xslt/directive.xslt \ + docs/xslt/content.xslt + $(call XSLScript, $<, $@) + +docs/xslt/%.xslt: docs/xsls/%.xsls + $(call XSLScript, $<, $@)
new file mode 100644 --- /dev/null +++ b/docs/dtd/module.dtd @@ -0,0 +1,24 @@ + +<!ELEMENT module (section+) > +<!ATTLIST module title CDATA #REQUIRED + link CDATA #REQUIRED + lang (en) #REQUIRED +> + +<!ELEMENT section (directive+ | para+) > +<!ATTLIST section title CDATA #REQUIRED + name CDATA #IMPLIED +> + +<!ELEMENT directive (syntax, default, context, para+) > +<!ATTLIST directive name CDATA #REQUIRED > + +<!ELEMENT syntax (#PCDATA | value)* > +<!ELEMENT default (#PCDATA)* > +<!ELEMENT context (#PCDATA)* > + +<!ELEMENT para (#PCDATA | value)* > +<!ELEMENT value (#PCDATA)* > + +<!ENTITY nbsp " " > +<!ENTITY mdash " - " >
new file mode 100644 --- /dev/null +++ b/docs/html/http/ngx_http_core_module.html @@ -0,0 +1,10 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>ngx_http_core_module</title></head><body><center><h4>Directives</h4></center><a name="client_body_buffer_size"></a><center><h4>client_body_buffer_size</h4></center>syntax: client_body_buffer_size <i>size</i><br>default: client_body_buffer_size 8k/16k<br>context: http, server, location<br><p> +Directive sets client request body buffer size. +If the request body is larger than the buffer, +then the whole body or some its part is written to temporary file. +By default buffer size is equal to 2 memory page sizes. +This is 8K on x86, other 32-bit platforms, and x86-64. +It is usually 16K on other 64-bit platforms. +</p><a name="sendfile"></a><center><h4>sendfile</h4></center>syntax: sendfile <i>[on|off]</i><br>default: sendfile off<br>context: http, server, location<br><p> +Directive enables or disables sendfile() usage. +</p></body></html>
new file mode 100644 --- /dev/null +++ b/docs/xml/http/ngx_http_core_module.xml @@ -0,0 +1,41 @@ +<!DOCTYPE module SYSTEM "../../dtd/module.dtd"> + +<module title="ngx_http_core_module" + link="/en/docs/http/ngx_http_core_module.html" + lang="en"> + +<section title="Directives"> + +<directive name="client_body_buffer_size"> + +<syntax>client_body_buffer_size <value>size</value></syntax> +<default>client_body_buffer_size 8k/16k</default> +<context>http, server, location</context> + +<para> +Directive sets client request body buffer size. +If the request body is larger than the buffer, +then the whole body or some its part is written to temporary file. +By default buffer size is equal to 2 memory page sizes. +This is 8K on x86, other 32-bit platforms, and x86-64. +It is usually 16K on other 64-bit platforms. +</para> + +</directive> + + +<directive name="sendfile"> + +<syntax>sendfile <value>[on|off]</value></syntax> +<default>sendfile off</default> +<context>http, server, location</context> + +<para> +Directive enables or disables sendfile() usage. +</para> + +</directive> + +</section> + +</module>
new file mode 100644 --- /dev/null +++ b/docs/xsls/content.xsls @@ -0,0 +1,19 @@ +X:stylesheet { + +X:template = "section[@name and @title]" { + <a name="{@name}" /> <center><h4> !{@title} </h4></center> + !!; +} + +X:template = "section[not(@name) and @title]" { + <center><h4> !{@title} </h4></center> + !!; +} + +X:template = "section[not(@name) and not(@title)]" { !!; } + +X:template = "para" { <p> !!; </p> } + +X:template = "value" { <i> !!; </i> } + +}
new file mode 100644 --- /dev/null +++ b/docs/xsls/directive.xsls @@ -0,0 +1,15 @@ +X:stylesheet { + +X:template = "directive" { + <a name="{@name}" /> <center><h4> !{@name} </h4></center> + !! "syntax"; + !! "default"; + !! "context"; + !! "para"; +} + +X:template = "syntax" { X:text {syntax: } !!; <br/> } +X:template = "default" { X:text {default: } !!; <br/> } +X:template = "context" { X:text {context: } !!; <br/> } + +}
new file mode 100644 --- /dev/null +++ b/docs/xsls/module.xsls @@ -0,0 +1,33 @@ +X:stylesheet { + +X:output method="html" indent="no" encoding="utf-8"; + +X:strip-space elements = "*"; + +<!-- + -- a current directory of a XSLT script is where the script is stored, + -- but not where XSLT processor has been started to run the script + --> +X:param XML = "'../xml'"; + +X:var LINK = "/module/@link"; + +X:include href = "directive.xslt"; +X:include href = "content.xslt"; + + +X:template = "/module" { + <html><head> + + <title> !{@title} </title> + + </head> + <body> + + !!; + + </body> + </html> +} + +}
new file mode 100644 --- /dev/null +++ b/docs/xslt/content.xslt @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + + <xsl:template match="section[@name and @title]"> + + <a name="{@name}"/> + <center> + <h4> + <xsl:value-of select="@title"/> + </h4> + </center> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="section[not(@name) and @title]"> + + <center> + <h4> + <xsl:value-of select="@title"/> + </h4> + </center> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="section[not(@name) and not(@title)]"> + <xsl:apply-templates/> + </xsl:template> + + + <xsl:template match="para"> + <p> + <xsl:apply-templates/> + </p> + </xsl:template> + + + <xsl:template match="value"> + <i> + <xsl:apply-templates/> + </i> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file
new file mode 100644 --- /dev/null +++ b/docs/xslt/directive.xslt @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + + <xsl:template match="directive"> + + <a name="{@name}"/> + <center> + <h4> + <xsl:value-of select="@name"/> + </h4> + </center> + <xsl:apply-templates select="syntax"/> + <xsl:apply-templates select="default"/> + <xsl:apply-templates select="context"/> + <xsl:apply-templates select="para"/> + </xsl:template> + + <xsl:template match="syntax"> + <xsl:text>syntax: </xsl:text> + <xsl:apply-templates/> + <br/> + </xsl:template> + + <xsl:template match="default"> + <xsl:text>default: </xsl:text> + <xsl:apply-templates/> + <br/> + </xsl:template> + + <xsl:template match="context"> + <xsl:text>context: </xsl:text> + <xsl:apply-templates/> + <br/> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file
new file mode 100644 --- /dev/null +++ b/docs/xslt/module.xslt @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:output indent="no" encoding="utf-8" method="html"/> + + <xsl:strip-space elements="*"/> + + <xsl:param select="'../xml'" name="XML"/> + + <xsl:variable select="/module/@link" name="LINK"/> + + <xsl:include href="directive.xslt"/> + <xsl:include href="content.xslt"/> + + <xsl:template match="/module"> + + <html> + <head> + + <title> + <xsl:value-of select="@title"/> + </title> + + </head> + + <body> + + <xsl:apply-templates/> + + </body> + + </html> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file