Merge commit '484a904fa7' as 'nginx'
This commit is contained in:
commit
2b63c55768
528 changed files with 294288 additions and 0 deletions
41
nginx/docs/GNUmakefile
Normal file
41
nginx/docs/GNUmakefile
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
VER= $(shell grep 'define NGINX_VERSION' src/core/nginx.h \
|
||||
| sed -e 's/^.*"\(.*\)".*/\1/')
|
||||
NGINX= nginx-$(VER)
|
||||
TEMP= tmp
|
||||
XSLS?= xslscript.pl
|
||||
|
||||
|
||||
all: changes
|
||||
|
||||
changes: $(TEMP)/$(NGINX)/CHANGES.ru \
|
||||
$(TEMP)/$(NGINX)/CHANGES
|
||||
|
||||
|
||||
$(TEMP)/$(NGINX)/CHANGES.ru: docs/dtd/changes.dtd \
|
||||
docs/xml/nginx/changes.xml \
|
||||
docs/xml/change_log_conf.xml \
|
||||
docs/xslt/changes.xslt
|
||||
|
||||
mkdir -p $(TEMP)/$(NGINX)
|
||||
|
||||
xmllint --noout --valid docs/xml/nginx/changes.xml
|
||||
xsltproc --stringparam lang ru \
|
||||
-o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml
|
||||
|
||||
|
||||
$(TEMP)/$(NGINX)/CHANGES: docs/dtd/changes.dtd \
|
||||
docs/xml/nginx/changes.xml \
|
||||
docs/xml/change_log_conf.xml \
|
||||
docs/xslt/changes.xslt
|
||||
|
||||
mkdir -p $(TEMP)/$(NGINX)
|
||||
|
||||
xmllint --noout --valid docs/xml/nginx/changes.xml
|
||||
xsltproc --stringparam lang en \
|
||||
-o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml
|
||||
|
||||
|
||||
docs/xslt/changes.xslt: docs/xsls/changes.xsls
|
||||
|
||||
$(XSLS) -o $@ $<
|
||||
22
nginx/docs/dtd/change_log_conf.dtd
Normal file
22
nginx/docs/dtd/change_log_conf.dtd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
<!ELEMENT configuration (length, start, indent, changes+) >
|
||||
|
||||
<!ELEMENT length (#PCDATA) >
|
||||
<!ELEMENT start (#PCDATA) >
|
||||
<!ELEMENT indent (#PCDATA) >
|
||||
|
||||
<!ELEMENT changes (title, length,
|
||||
bugfix, feature, change, workaround,
|
||||
(month, month, month, month, month, month,
|
||||
month, month, month, month, month, month)?) >
|
||||
|
||||
<!ATTLIST changes lang ( ru | en) #REQUIRED>
|
||||
|
||||
<!ELEMENT title (#PCDATA) >
|
||||
|
||||
<!ELEMENT bugfix (#PCDATA) >
|
||||
<!ELEMENT feature (#PCDATA) >
|
||||
<!ELEMENT change (#PCDATA) >
|
||||
<!ELEMENT workaround (#PCDATA) >
|
||||
|
||||
<!ELEMENT month (#PCDATA) >
|
||||
22
nginx/docs/dtd/changes.dtd
Normal file
22
nginx/docs/dtd/changes.dtd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
<!ENTITY nbsp " " >
|
||||
<!ENTITY mdash " - " >
|
||||
|
||||
|
||||
<!ELEMENT change_log (changes)* >
|
||||
<!ATTLIST change_log title CDATA #REQUIRED >
|
||||
|
||||
<!ELEMENT changes (change)* >
|
||||
<!ATTLIST changes ver CDATA #REQUIRED
|
||||
date CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT change (para)* >
|
||||
<!ATTLIST change type (bugfix | feature | change | security | workaround) #IMPLIED >
|
||||
|
||||
<!ELEMENT para (#PCDATA | at | br | nobr)* >
|
||||
<!ATTLIST para lang (ru | en) #REQUIRED >
|
||||
|
||||
<!ELEMENT at EMPTY >
|
||||
<!ELEMENT br EMPTY >
|
||||
<!ELEMENT nobr (#PCDATA) >
|
||||
19
nginx/docs/html/50x.html
Normal file
19
nginx/docs/html/50x.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Error</title>
|
||||
<style>
|
||||
html { color-scheme: light dark; }
|
||||
body { width: 35em; margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>An error occurred.</h1>
|
||||
<p>Sorry, the page you are looking for is currently unavailable.<br/>
|
||||
Please try again later.</p>
|
||||
<p>If you are the system administrator of this resource then you should check
|
||||
the error log for details.</p>
|
||||
<p><em>Faithfully yours, nginx.</em></p>
|
||||
</body>
|
||||
</html>
|
||||
27
nginx/docs/html/index.html
Normal file
27
nginx/docs/html/index.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to nginx!</title>
|
||||
<style>
|
||||
html { color-scheme: light dark; }
|
||||
body { width: 35em; margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to nginx!</h1>
|
||||
<p>If you see this page, nginx is successfully installed and working.
|
||||
Further configuration is required for the web server, reverse proxy,
|
||||
API gateway, load balancer, content cache, or other features.</p>
|
||||
|
||||
<p>For online documentation and support please refer to
|
||||
<a href="https://nginx.org/">nginx.org</a>.<br/>
|
||||
To engage with the community please visit
|
||||
<a href="https://community.nginx.org/">community.nginx.org</a>.<br/>
|
||||
For enterprise grade support, professional services, additional
|
||||
security features and capabilities please refer to
|
||||
<a href="https://f5.com/nginx">f5.com/nginx</a>.</p>
|
||||
|
||||
<p><em>Thank you for using nginx.</em></p>
|
||||
</body>
|
||||
</html>
|
||||
215
nginx/docs/man/nginx.8
Normal file
215
nginx/docs/man/nginx.8
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
.\"
|
||||
.\" Copyright (C) 2010, 2019 Sergey A. Osokin
|
||||
.\" Copyright (C) Nginx, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\"
|
||||
.Dd January 21, 2026
|
||||
.Dt NGINX 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm nginx
|
||||
.Nd "HTTP and reverse proxy server, mail proxy server"
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl ?hqTtVv
|
||||
.Op Fl c Ar file
|
||||
.Op Fl e Ar file
|
||||
.Op Fl g Ar directives
|
||||
.Op Fl p Ar prefix
|
||||
.Op Fl s Ar signal
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
(pronounced
|
||||
.Dq engine x )
|
||||
is an HTTP and reverse proxy server, a mail proxy server, and a generic
|
||||
TCP/UDP proxy server.
|
||||
It is known for its high performance, stability, rich feature set, simple
|
||||
configuration, and low resource consumption.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width ".Fl d Ar directives"
|
||||
.It Fl ?\& , h
|
||||
Print help.
|
||||
.It Fl c Ar file
|
||||
Use an alternative configuration
|
||||
.Ar file .
|
||||
.It Fl e Ar file
|
||||
Use an alternative error log
|
||||
.Ar file .
|
||||
Special value
|
||||
.Cm stderr
|
||||
indicates that the standard error output should be used.
|
||||
.It Fl g Ar directives
|
||||
Set global configuration directives.
|
||||
See
|
||||
.Sx EXAMPLES
|
||||
for details.
|
||||
.It Fl p Ar prefix
|
||||
Set the prefix path.
|
||||
The default value is
|
||||
.Pa %%PREFIX%% .
|
||||
.It Fl q
|
||||
Suppress non-error messages during configuration testing.
|
||||
.It Fl s Ar signal
|
||||
Send a signal to the master process.
|
||||
The argument
|
||||
.Ar signal
|
||||
can be one of:
|
||||
.Cm stop , quit , reopen , reload .
|
||||
The following table shows the corresponding system signals:
|
||||
.Pp
|
||||
.Bl -tag -width ".Cm reopen" -compact
|
||||
.It Cm stop
|
||||
.Dv SIGTERM
|
||||
.It Cm quit
|
||||
.Dv SIGQUIT
|
||||
.It Cm reopen
|
||||
.Dv SIGUSR1
|
||||
.It Cm reload
|
||||
.Dv SIGHUP
|
||||
.El
|
||||
.It Fl T
|
||||
Same as
|
||||
.Fl t ,
|
||||
but additionally dump configuration files to standard output.
|
||||
.It Fl t
|
||||
Do not run, just test the configuration file.
|
||||
.Nm
|
||||
checks the configuration file syntax and then tries to open files
|
||||
referenced in the configuration file, including binding to configured
|
||||
listen addresses.
|
||||
.It Fl V
|
||||
Print the
|
||||
.Nm
|
||||
version, compiler version, and
|
||||
.Pa configure
|
||||
script parameters.
|
||||
.It Fl v
|
||||
Print the
|
||||
.Nm
|
||||
version.
|
||||
.El
|
||||
.Sh SIGNALS
|
||||
The master process of
|
||||
.Nm
|
||||
can handle the following signals:
|
||||
.Pp
|
||||
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
|
||||
.It Dv SIGINT , SIGTERM
|
||||
Shut down quickly.
|
||||
.It Dv SIGHUP
|
||||
Reload configuration, start the new worker process with a new
|
||||
configuration, and gracefully shut down old worker processes.
|
||||
.It Dv SIGQUIT
|
||||
Shut down gracefully.
|
||||
.It Dv SIGUSR1
|
||||
Reopen log files.
|
||||
.It Dv SIGUSR2
|
||||
Upgrade the
|
||||
.Nm
|
||||
executable on the fly.
|
||||
.It Dv SIGWINCH
|
||||
Shut down worker processes gracefully.
|
||||
.El
|
||||
.Pp
|
||||
While there is no need to explicitly control worker processes normally,
|
||||
they support some signals too:
|
||||
.Pp
|
||||
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
|
||||
.It Dv SIGTERM
|
||||
Shut down quickly.
|
||||
.It Dv SIGQUIT
|
||||
Shut down gracefully.
|
||||
.It Dv SIGUSR1
|
||||
Reopen log files.
|
||||
.El
|
||||
.Sh DEBUGGING LOG
|
||||
To enable a debugging log, reconfigure
|
||||
.Nm
|
||||
to build with debugging:
|
||||
.Pp
|
||||
.Dl "./configure --with-debug ..."
|
||||
.Pp
|
||||
and then set the
|
||||
.Cm debug
|
||||
level of the
|
||||
.Va error_log :
|
||||
.Pp
|
||||
.Dl "error_log /path/to/log debug;"
|
||||
.Pp
|
||||
It is also possible to enable the debugging for a particular IP address:
|
||||
.Bd -literal -offset indent
|
||||
events {
|
||||
debug_connection 127.0.0.1;
|
||||
}
|
||||
.Ed
|
||||
.Sh ENVIRONMENT
|
||||
The
|
||||
.Ev NGINX
|
||||
environment variable is used internally by
|
||||
.Nm
|
||||
and should not be set directly by the user.
|
||||
.Sh FILES
|
||||
.Bl -tag -width indent
|
||||
.It Pa %%PID_PATH%%
|
||||
Contains the process ID of
|
||||
.Nm .
|
||||
The contents of this file are not sensitive, so it can be world-readable.
|
||||
.It Pa %%CONF_PATH%%
|
||||
The main configuration file.
|
||||
.It Pa %%ERROR_LOG_PATH%%
|
||||
Error log file.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
Exit status is 0 on success, or 1 if the command fails.
|
||||
.Sh EXAMPLES
|
||||
Test configuration file
|
||||
.Pa ~/mynginx.conf
|
||||
with global directives for PID and quantity of worker processes:
|
||||
.Bd -literal -offset indent
|
||||
nginx -t -c ~/mynginx.conf \e
|
||||
-g "pid /var/run/mynginx.pid; worker_processes 2;"
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.\"Xr nginx.conf 5
|
||||
.\"Pp
|
||||
Documentation at
|
||||
.Pa http://nginx.org/en/docs/ .
|
||||
.Pp
|
||||
For questions and technical support, please refer to
|
||||
.Pa http://nginx.org/en/support.html .
|
||||
.Sh HISTORY
|
||||
Development of
|
||||
.Nm
|
||||
started in 2002, with the first public release on October 4, 2004.
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
.An Igor Sysoev Aq Mt igor@sysoev.ru .
|
||||
.Pp
|
||||
This manual page was originally written by
|
||||
.An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru
|
||||
as a result of compiling many
|
||||
.Nm
|
||||
documents from all over the world.
|
||||
47
nginx/docs/xml/change_log_conf.xml
Normal file
47
nginx/docs/xml/change_log_conf.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE configuration SYSTEM "../dtd/change_log_conf.dtd" >
|
||||
|
||||
<configuration>
|
||||
|
||||
<length>76</length>
|
||||
|
||||
<start> *) </start>
|
||||
<indent> </indent>
|
||||
|
||||
<changes lang="ru">
|
||||
<title>Изменения в </title>
|
||||
<length>66</length>
|
||||
|
||||
<bugfix>Исправление</bugfix>
|
||||
<feature>Добавление</feature>
|
||||
<change>Изменение</change>
|
||||
<security>Безопасность</security>
|
||||
<workaround>Изменение</workaround>
|
||||
</changes>
|
||||
|
||||
<changes lang="en">
|
||||
<title>Changes with </title>
|
||||
<length>65</length>
|
||||
|
||||
<bugfix>Bugfix</bugfix>
|
||||
<feature>Feature</feature>
|
||||
<change>Change</change>
|
||||
<security>Security</security>
|
||||
<workaround>Workaround</workaround>
|
||||
|
||||
<month> Jan </month>
|
||||
<month> Feb </month>
|
||||
<month> Mar </month>
|
||||
<month> Apr </month>
|
||||
<month> May </month>
|
||||
<month> Jun </month>
|
||||
<month> Jul </month>
|
||||
<month> Aug </month>
|
||||
<month> Sep </month>
|
||||
<month> Oct </month>
|
||||
<month> Nov </month>
|
||||
<month> Dec </month>
|
||||
|
||||
</changes>
|
||||
|
||||
</configuration>
|
||||
31487
nginx/docs/xml/nginx/changes.xml
Normal file
31487
nginx/docs/xml/nginx/changes.xml
Normal file
File diff suppressed because it is too large
Load diff
134
nginx/docs/xsls/changes.xsls
Normal file
134
nginx/docs/xsls/changes.xsls
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
X:stylesheet {
|
||||
|
||||
X:output method="text";
|
||||
|
||||
X:param lang="'en'";
|
||||
X:param configuration="'../xml/change_log_conf.xml'";
|
||||
|
||||
X:var conf = "document($configuration)/configuration";
|
||||
X:var start = "$conf/start";
|
||||
X:var indent = "$conf/indent";
|
||||
X:var max = "$conf/length";
|
||||
X:var br = {<br>}
|
||||
|
||||
|
||||
X:template = "/" { !! "change_log"; }
|
||||
X:template = "change_log" { !! "changes"; }
|
||||
|
||||
|
||||
X:template = "changes" {
|
||||
X:text { }
|
||||
|
||||
!{substring(concat($conf/changes[@lang=$lang]/title,
|
||||
//change_log/@title,
|
||||
' ', @ver,
|
||||
' '),
|
||||
1, $conf/changes[@lang=$lang]/length)}
|
||||
|
||||
X:if "$lang='ru'" {
|
||||
!{substring(@date, 9, 2)}
|
||||
X:text {.}
|
||||
!{substring(@date, 6, 2)}
|
||||
X:text {.}
|
||||
!{substring(@date, 1, 4)}
|
||||
}
|
||||
|
||||
X:if "$lang='en'" {
|
||||
!{substring(@date, 9, 2)}
|
||||
!{$conf/changes[@lang=$lang]/month[number(substring(current()/@date,
|
||||
6, 2))]}
|
||||
!{substring(@date, 1, 4)}
|
||||
}
|
||||
|
||||
X:text { }
|
||||
|
||||
!! "change";
|
||||
|
||||
X:text { }
|
||||
}
|
||||
|
||||
|
||||
X:template = "change" {
|
||||
X:var prefix = "$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]"
|
||||
|
||||
X:var postfix = { X:if "$prefix" { X:text {: } } }
|
||||
|
||||
!! "para[@lang=$lang]" (prefix = "concat($start, $prefix, $postfix)");
|
||||
}
|
||||
|
||||
|
||||
X:template para(prefix) = "para" {
|
||||
X:var text = { !!; }
|
||||
|
||||
X:text { }
|
||||
|
||||
!wrap(text = "normalize-space($text)",
|
||||
prefix = { X:if "position() = 1" { !{$prefix} } else { !{$indent} } })
|
||||
}
|
||||
|
||||
|
||||
X:template wrap(text, prefix) {
|
||||
X:if "$text" {
|
||||
X:var offset = {
|
||||
X:choose {
|
||||
X:when "starts-with($text, concat($br, ' '))" {
|
||||
!{string-length($br) + 2}
|
||||
}
|
||||
X:when "starts-with($text, $br)" {
|
||||
!{string-length($br) + 1}
|
||||
}
|
||||
X:otherwise {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X:var length = {
|
||||
!length(text = "substring($text, $offset)",
|
||||
prefix = "string-length($prefix)",
|
||||
length = "$max")
|
||||
}
|
||||
|
||||
!{$prefix}
|
||||
|
||||
!{normalize-space(translate(substring($text, $offset, $length),
|
||||
' ', ' '))}
|
||||
|
||||
X:text { }
|
||||
|
||||
!wrap(text = "substring($text, $length + $offset)", prefix = "$indent")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template length(text, prefix, length) {
|
||||
X:var break = "substring-before(substring($text, 1,
|
||||
$length - $prefix + string-length($br)),
|
||||
$br)"
|
||||
|
||||
X:choose {
|
||||
X:when "$break" { !{string-length($break)} }
|
||||
|
||||
X:when "$length = 0" { !{$max - $prefix} }
|
||||
|
||||
X:when "string-length($text) + $prefix <= $length" {
|
||||
!{$length - $prefix}
|
||||
}
|
||||
|
||||
X:when "substring($text, $length - $prefix + 1, 1) = ' '" {
|
||||
!{$length - $prefix + 1}
|
||||
}
|
||||
|
||||
X:otherwise {
|
||||
!length(text = "$text", prefix = "$prefix", length = "$length - 1")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
X:template = "at" {@}
|
||||
X:template = "br" { !{$br} }
|
||||
X:template = "nobr" { !{translate(., ' ', ' ')} }
|
||||
|
||||
|
||||
}
|
||||
128
nginx/docs/xslt/changes.xslt
Normal file
128
nginx/docs/xslt/changes.xslt
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<xsl:param select="'en'" name="lang"/>
|
||||
<xsl:param select="'../xml/change_log_conf.xml'" name="configuration"/>
|
||||
|
||||
<xsl:variable select="document($configuration)/configuration" name="conf"/>
|
||||
<xsl:variable select="$conf/start" name="start"/>
|
||||
<xsl:variable select="$conf/indent" name="indent"/>
|
||||
<xsl:variable select="$conf/length" name="max"/>
|
||||
<xsl:variable name="br"><br></xsl:variable>
|
||||
|
||||
|
||||
<xsl:template match="/"> <xsl:apply-templates select="change_log"/> </xsl:template>
|
||||
<xsl:template match="change_log"> <xsl:apply-templates select="changes"/> </xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="changes">
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:value-of select="substring(concat($conf/changes[@lang=$lang]/title,
|
||||
//change_log/@title,
|
||||
' ', @ver,
|
||||
' '),
|
||||
1, $conf/changes[@lang=$lang]/length)"/>
|
||||
|
||||
<xsl:if test="$lang='ru'">
|
||||
<xsl:value-of select="substring(@date, 9, 2)"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="substring(@date, 6, 2)"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="substring(@date, 1, 4)"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$lang='en'">
|
||||
<xsl:value-of select="substring(@date, 9, 2)"/>
|
||||
<xsl:value-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date,
|
||||
6, 2))]"/>
|
||||
<xsl:value-of select="substring(@date, 1, 4)"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:apply-templates select="change"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="change">
|
||||
<xsl:variable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/>
|
||||
|
||||
<xsl:variable name="postfix"> <xsl:if test="$prefix"> <xsl:text>: </xsl:text> </xsl:if> </xsl:variable>
|
||||
|
||||
<xsl:apply-templates select="para[@lang=$lang]"><xsl:with-param select="concat($start, $prefix, $postfix)" name="prefix"/></xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="para" match="para"><xsl:param name="prefix"/>
|
||||
<xsl:variable name="text"> <xsl:apply-templates/> </xsl:variable>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:call-template name="wrap"><xsl:with-param select="normalize-space($text)" name="text"/><xsl:with-param name="prefix"> <xsl:choose><xsl:when test="position() = 1"> <xsl:value-of select="$prefix"/> </xsl:when><xsl:otherwise> <xsl:value-of select="$indent"/> </xsl:otherwise></xsl:choose> </xsl:with-param></xsl:call-template></xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="wrap"><xsl:param name="text"/><xsl:param name="prefix"/>
|
||||
<xsl:if test="$text">
|
||||
<xsl:variable name="offset">
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($text, concat($br, ' '))">
|
||||
<xsl:value-of select="string-length($br) + 2"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($text, $br)">
|
||||
<xsl:value-of select="string-length($br) + 1"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
1
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="length">
|
||||
<xsl:call-template name="length"><xsl:with-param select="substring($text, $offset)" name="text"/><xsl:with-param select="string-length($prefix)" name="prefix"/><xsl:with-param select="$max" name="length"/></xsl:call-template></xsl:variable>
|
||||
|
||||
<xsl:value-of select="$prefix"/>
|
||||
|
||||
<xsl:value-of select="normalize-space(translate(substring($text, $offset, $length),
|
||||
' ', ' '))"/>
|
||||
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<xsl:call-template name="wrap"><xsl:with-param select="substring($text, $length + $offset)" name="text"/><xsl:with-param select="$indent" name="prefix"/></xsl:call-template></xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="length"><xsl:param name="text"/><xsl:param name="prefix"/><xsl:param name="length"/>
|
||||
<xsl:variable select="substring-before(substring($text, 1,
|
||||
$length - $prefix + string-length($br)),
|
||||
$br)" name="break"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$break"> <xsl:value-of select="string-length($break)"/> </xsl:when>
|
||||
|
||||
<xsl:when test="$length = 0"> <xsl:value-of select="$max - $prefix"/> </xsl:when>
|
||||
|
||||
<xsl:when test="string-length($text) + $prefix <= $length">
|
||||
<xsl:value-of select="$length - $prefix"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '">
|
||||
<xsl:value-of select="$length - $prefix + 1"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="length"><xsl:with-param select="$text" name="text"/><xsl:with-param select="$prefix" name="prefix"/><xsl:with-param select="$length - 1" name="length"/></xsl:call-template></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="at">@</xsl:template>
|
||||
<xsl:template match="br"> <xsl:value-of select="$br"/> </xsl:template>
|
||||
<xsl:template match="nobr"> <xsl:value-of select="translate(., ' ', ' ')"/> </xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Add table
Add a link
Reference in a new issue