Mercurial > hgbook
changeset 362:df4ac9043db0
a bit more template.tex
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 23 Sep 2008 02:21:24 +0900 |
parents | 96437101a088 |
children | bc92b28fc970 |
files | ja/template.tex |
diffstat | 1 files changed, 95 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/ja/template.tex Mon Sep 22 22:48:57 2008 +0900 +++ b/ja/template.tex Tue Sep 23 02:21:24 2008 +0900 @@ -456,39 +456,67 @@ $B$k!%$3$l$O2hLL$r%9%/%l%$%T%s%0$9$k4VH4$1$J%9(B $B%Q%`%\%C%H$rHr$1$kF/$-$,$"$k!%(B -\item[\tplkwfilt{author}{person}] Any text, but most useful for the - \tplkword{author} keyword. Yield the text before an email address. - For example, ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' - becomes ``\Verb+Bryan O'Sullivan+''. +%\item[\tplkwfilt{author}{person}] Any text, but most useful for the +% \tplkword{author} keyword. Yield the text before an email address. +% For example, ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' +% becomes ``\Verb+Bryan O'Sullivan+''. + +\item[\tplkwfilt{author}{person}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<(B + $B%o!<%I$H9g$o$;$F;H$&>l9g$b$C$H$bM-MQ!%(Bemail$B%"%I%l%9$NA0$N%F(B + $B%-%9%H$rCj=P$9$k!%Nc$($P(B``\Verb+Bryan O'Sullivan + <bos@serpentine.com>+''$B$O(B``\Verb+Bryan O'Sullivan+''$B$H$J$k!%(B + +%\item[\tplkwfilt{date}{rfc822date}] \tplkword{date} keyword. Render a +% date using the same format used in email headers. Yields a string +% like ``\Verb+Mon, 04 Sep 2006 15:13:13 -0700+''. -\item[\tplkwfilt{date}{rfc822date}] \tplkword{date} keyword. Render a - date using the same format used in email headers. Yields a string - like ``\Verb+Mon, 04 Sep 2006 15:13:13 -0700+''. +\item[\tplkwfilt{date}{rfc822date}] \tplkword{date}$B%-!<%o!<%I!%F|;~$r(B + email$B%X%C%@$HF1$87A<0$G@07A$9$k!%(B``\Verb+Mon, 04 Sep 2006 + 15:13:13 -0700+''$B$N$h$&$JJ8;zNs$r@8@.$9$k!%(B + +%\item[\tplkwfilt{node}{short}] Changeset hash. Yield the short form +% of a changeset hash, i.e.~a 12-byte hexadecimal string. -\item[\tplkwfilt{node}{short}] Changeset hash. Yield the short form - of a changeset hash, i.e.~a 12-byte hexadecimal string. +\item[\tplkwfilt{node}{short}] $B%A%'%s%8%;%C%H%O%C%7%e!%C;7A<0$N%A%'%s%8(B + $B%;%C%H%O%C%7%e!$$9$J$o$A(B12$B%P%$%H$N(B16$B?J?tJ8;zNs$r@8@.$9$k!%(B -\item[\tplkwfilt{date}{shortdate}] \tplkword{date} keyword. Render - the year, month, and day of the date. Yields a string like - ``\Verb+2006-09-04+''. +%\item[\tplkwfilt{date}{shortdate}] \tplkword{date} keyword. Render +% the year, month, and day of the date. Yields a string like +% ``\Verb+2006-09-04+''. + +\item[\tplkwfilt{date}{shortdate}] \tplkword{date}$B%-!<%o!<%I!%G/7nF|$r@0(B + $B7A$9$k!%(B``\Verb+2006-09-04+''$B$N$h$&$JJ8;zNs$r@8@.$9$k!%(B -\item[\tplfilter{strip}] Any text. Strip all leading and trailing - whitespace from the string. +%\item[\tplfilter{strip}] Any text. Strip all leading and trailing +% whitespace from the string. + +\item[\tplfilter{strip}] $BG$0U$N%F%-%9%H!%J8;zNs$NA08e$N6uGrItJ,$r=|5n$9(B + $B$k!%(B -\item[\tplfilter{tabindent}] Any text. Yield the text, with every line - except the first starting with a tab character. +%\item[\tplfilter{tabindent}] Any text. Yield the text, with every line +% except the first starting with a tab character. + +\item[\tplfilter{tabindent}] $BG$0U$N%F%-%9%H!%%?%VJ8;z$G;O$^$i$J$$9T$9$Y(B + $B$F$r=PNO$9$k!%(B -\item[\tplfilter{urlescape}] Any text. Escape all characters that are - considered ``special'' by URL parsers. For example, \Verb+foo bar+ - becomes \Verb+foo%20bar+. +%\item[\tplfilter{urlescape}] Any text. Escape all characters that are +% considered ``special'' by URL parsers. For example, \Verb+foo bar+ +% becomes \Verb+foo%20bar+. + +\item[\tplfilter{urlescape}] $BG$0U$N%F%-%9%H!%(BURL$B%Q!<%5$+$i8+$F(B``$BFCJL(B''$B$J(B + $BJ8;z$N%(%9%1!<%W$r9T$&!%Nc$($P(B \Verb+foo bar+ $B$O(B + \Verb+foo\%20bar+ $B$H$J$k!%(B -\item[\tplkwfilt{author}{user}] Any text, but most useful for the - \tplkword{author} keyword. Return the ``user'' portion of an email - address. For example, - ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' becomes - ``\Verb+bos+''. +%\item[\tplkwfilt{author}{user}] Any text, but most useful for the +% \tplkword{author} keyword. Return the ``user'' portion of an email +% address. For example, +% ``\Verb+Bryan O'Sullivan <bos@serpentine.com>+'' becomes +% ``\Verb+bos+''. - +\item[\tplkwfilt{author}{user}] $BG$0U$N%F%-%9%H!%(B\tplkword{author}$B%-!<%o!<(B + $B%I$H6&$K;H$C$?>l9g$K:G$bM-MQ!%(Bemail$B%"%I%l%9$+$i%f!<%6L>$NIt(B + $BJ,$rH4$-=P$9!%Nc$($P(B``\Verb+Bryan O'Sullivan + <bos@serpentine.com>+''$B$O(B``\Verb+bos+''$B$H$J$k!%(B \end{itemize} \begin{figure} @@ -512,36 +540,58 @@ %\subsection{Combining filters} \subsection{$BAH$_9g$o$;%U%#%k%?(B} -It is easy to combine filters to yield output in the form you would -like. The following chain of filters tidies up a description, then -makes sure that it fits cleanly into 68 columns, then indents it by a -further 8~characters (at least on Unix-like systems, where a tab is -conventionally 8~characters wide). +%It is easy to combine filters to yield output in the form you would +%like. The following chain of filters tidies up a description, then +%makes sure that it fits cleanly into 68 columns, then indents it by a +%further 8~characters (at least on Unix-like systems, where a tab is +%conventionally 8~characters wide). + +$BK>$_$N=PNO$r$($k$?$a$KJ#?t$N%U%#%k%?$rAH$_9g$o$;$k$N$O$?$d$9$$!%0J2<$N0l(B +$BO"$N%U%#%k%?$O@bL@J8$r@0M}$7!$$-$l$$$K(B68$B7e$K<}$^$k$h$&$K@07A$7!$(B8$BJ8;z$N(B +$B%$%s%G%s%H$r9T$&!%!J(BUNIX$B%7%9%F%`$G$O%?%V$O=,47E*$K(B8$B7eJ,$NI}$r;}$D!%!K(B \interaction{template.simple.combine} -Note the use of ``\Verb+\t+'' (a tab character) in the template to -force the first line to be indented; this is necessary since -\tplkword{tabindent} indents all lines \emph{except} the first. +%Note the use of ``\Verb+\t+'' (a tab character) in the template to +%force the first line to be indented; this is necessary since +%\tplkword{tabindent} indents all lines \emph{except} the first. + +$B%F%s%W%l!<%H$G:G=i$N9T$r%$%s%G%s%H$9$k$?$a$K$O(B``\Verb+\t+''$B!J%?%VJ8;z!K$r(B +$B;H$&I,MW$,$"$k!%$J$<$J$i(B\tplkword{tabindent}$B$O:G=i$N9T(B\emph{$B0J30(B}$B$N%$%s(B +$B%G%s%H$r9T$&$+$i$G$"$k!%(B -Keep in mind that the order of filters in a chain is significant. The -first filter is applied to the result of the keyword; the second to -the result of the first filter; and so on. For example, using -\Verb+fill68|tabindent+ gives very different results from -\Verb+tabindent|fill68+. +%Keep in mind that the order of filters in a chain is significant. The +%first filter is applied to the result of the keyword; the second to +%the result of the first filter; and so on. For example, using +%\Verb+fill68|tabindent+ gives very different results from +%\Verb+tabindent|fill68+. +$B%U%#%k%?$rAH$_9g$o$;$k;~%U%#%k%?$N=g=x$,=EMW$G$"$k$3$H$rF,$KCV$$$F$*$/I,(B +$BMW$,$"$k!%:G=i$N%U%#%k%?$O%-!<%o!<%I$N7k2L$KBP$7$FE,MQ$5$l!$(B2$BHVL\$N%U%#%k(B +$B%?$O:G=i$N%U%#%k%?$N7k2L$KBP$7$FE,MQ$5$l$k!%Nc$r5s$2$k(B +$B$H!$(B\Verb+fill68|tabindent+ $B$H(B \Verb+tabindent|fill68+ $B$N7k2L$OA4$/0c$&(B +$B$b$N$G$"$k!%(B %\section{From templates to styles} \section{$B%F%s%W%l!<%H$+$i%9%?%$%k$X(B} -A command line template provides a quick and simple way to format some -output. Templates can become verbose, though, and it's useful to be -able to give a template a name. A style file is a template with a -name, stored in a file. +%A command line template provides a quick and simple way to format some +%output. Templates can become verbose, though, and it's useful to be +%able to give a template a name. A style file is a template with a +%name, stored in a file. -More than that, using a style file unlocks the power of Mercurial's -templating engine in ways that are not possible using the command line -\hgopt{log}{--template} option. +$B%3%^%s%I%i%$%s%F%s%W%l!<%H$O=PNO$r%U%)!<%^%C%H$9$k$?$a$NAGAa$/C1=c$JJ}K!(B +$B$rDs6!$9$k!%%F%s%W%l!<%H$O%a%C%;!<%8$rB?$/=PNO$9$k$h$&$K$b$G$-$k$,!$%F%s(B +$B%W%l!<%H$KL>A0$rIU$1$k$N$OM-1W$G$"$k!%%9%?%$%k%U%!%$%k$O!$%U%!%$%k$KJ]B8(B +$B$5$l$?L>A0$rIU$1$i$l$?%F%s%W%l!<%H$G$"$k!%(B + +%More than that, using a style file unlocks the power of Mercurial's +%templating engine in ways that are not possible using the command line +%\hgopt{log}{--template} option. + +$B$5$i$K!$%9%?%$%k%U%!%$%k$r;H$&$3$H$G!$(BMercurial$B$N%F%s%W%l!<%H%(%s%8%s$N%3(B +$B%^%s%I%i%$%s(B\hgopt{log}{--template}$B%*%W%7%g%s$+$i$G$OMxMQ$G$-$J$$NO$r:GBg(B +$B8B$K0z$-=P$9$3$H$,$G$-$k!%(B %\subsection{The simplest of style files} \subsection{$B:G$bC1=c$J%9%?%$%k%U%!%$%k(B}