-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.ja.html
225 lines (166 loc) · 9.44 KB
/
readme.ja.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html><html lang="ja"><head><title data-lang-content="title" lang="ja">春雨 — 多言語 Web 頁管理ツール</title>
<link href="#author" rel="author">
<link href="#license" rel="license">
<link href="https://suika.suikawiki.org/www/style/html/xhtml" rel="stylesheet">
</head><body><h1 data-lang-container="" id="title"><span lang="ja">春雨 — 多言語 Web 頁管理ツール</span></h1>
<div class="section" id="introduction">
<h2 data-lang-container=""><span lang="ja">これは何?</span></h2>
<p data-lang-container=""><span lang="ja"><b>春雨</b>は、複数の自然言語の文章をまとめた元となる
HTML 文書から、指定した自然言語の版の HTML 文書を取り出すツールです。</span></p><p data-lang-container=""><span lang="ja">多言語 Web サイトで (実際には同じ内容の)
文書の版を管理するのは大変です。 HTML 文書の著者が一部でも変更しようと思うと、
他の言語の翻訳も同時に更新しておかないと、言語間で文書の版が違ってしまいます。
</span></p><p data-lang-container=""><span lang="ja"><b>春雨</b>を使えば複数言語の HTML 文書を1つの元となる
HTML 文書から生成できます。
段落毎に各言語の翻訳文を並べた元文書を用意すればよいので、
著者は別々のファイルで別々の言語の別々の版を管理する煩わしさから開放されます。
</span></p></div>
<div class="section" id="news">
<h2 data-lang-container=""><span lang="ja">最新情報</span></h2>
<p data-lang-container=""><span lang="ja"><a href="harusame-commit" rel="feed" type="application/atom+xml">変更履歴差分の Atom
フィード</a>はじめました。</span></p><ul>
<li><time>2010-05-22</time>:
<span lang="ja"><a href="config/rpm/">RPM の spec
ファイル</a>を用意しました。</span>
</li><li><time>2008-10-21</time>:
<span lang="ja">最初の版を公開しました。</span>
</li></ul>
</div>
<div class="section" id="usage">
<h2 data-lang-container=""><span lang="ja">使い方</span></h2>
<ol>
<li>
<p data-lang-container=""><span lang="en">First, prepare a source HTML document
<var>html-document.src</var>. The document can be marked up in HTML
as usual, except for <a href="#markup-reference">the special markup
for <i lang="ja">harusame</i></a> to identify alternative blocks written
in various languages.</span></p><p data-lang-container=""><span lang="en">An input document might look like:</span></p><pre class="example" lang="mul">
<code><!DOCTYPE HTML>
<html lang=mul>
<title>Example Document</title>
<h1 <mark>data-lang-container</mark>>
<span <mark>lang=en</mark>>Example document</span>
<span <mark>lang=ja</mark>>文書の例</span>
</h1>
<p <mark>data-lang-container</mark>>
<span <mark>lang=en</mark>>This is an example of document with multiple languages.</span>
<span <mark>lang=ja</mark>>これは複数の言語で記述された文書の例です。</span>
</code></pre>
</li><li>
<p>Then, invoke the <code>harusame</code> command for each language to
generate, as:
</p><pre lang="en">
$ <kbd>harusame --lang en < <var>html-document.src</var> > <var>html-document.en</var></kbd>
$ <kbd>harusame --lang ja < <var>html-document.src</var> > <var>html-document.ja</var></kbd></pre>
<p>For more information on the <code>harusame</code>'s command-line
options, see <a href="bin/harusame.html">its documentation</a>.
</p></li></ol>
</div>
<div class="section" id="markup-reference">
<h2><i lang="ja">Harusame</i> Markup Reference</h2>
<p>Special markup for <i lang="ja">harusame</i> processing is
represented as <code>data-lang-<var>*</var></code> attributes on HTML
elements, as follows:
</p><dl>
<dt lang="en"><dfn id="attr-data-lang-container"><code>data-lang-container</code></dfn>
</dt><dd>
<p>If this attribute is specified to an HTML element, then it is
treated as a container element that contains versions of the content
in various languages.
</p><p>An element with this attribute must contain one or more HTML
elements. One of them, whose language (<code>lang</code> attribute
value) matches with the language specified as <code>--lang</code>
command-line option, is <i>selected</i>. If there are more than one
such elements, then the first one is <i>selected</i>. If there is no
element whose language matches to the <code>--lang</code> option, then
the first element (of whatever language) is <i>selected</i>.
</p><p>If the attribute value is <code>replace</code>, then the element
itself is replaced by the <i>selected</i> element. Otherwise, the
<em>content</em> of the element is replaced by the <i>selected</i>
element.
</p></dd><dt lang="en"><dfn id="attr-data-lang-content"><code>data-lang-content</code></dfn>
<p>If this attribute is specified to an HTML element, then its content
is replaced by the content of another element.
</p><p>If this attribute is specified, its value must be an ID of another
HTML element in the document.
</p><p>A child element of the element addressed by the ID is
<i>selected</i> in the similar way to the
<code>data-lang-container</code> attribute. Then, the content of the
element with the <code>data-lang-content</code> attribute is replaced
by the text content (the value of the <code>textContent</code> IDL
attribute) of the <i>selected</i> element.
</p><p>If the element addressed by the ID has
<code>data-lang-declaration</code> attribute, then the element will be
removed from the document at the end of the whole processing.
</p><p>This attribute is useful when an HTML element does not allow
elements to be inserted within it . For example, the content model of
the <code>title</code> element does not allow child elements. In such
a case, instead of inserting elements with <code>lang</code>
attribute, this attribute can be used to point to translations of the
<code>title</code> element content, as follows:
</p><pre class="example" lang="mul">
<code><title <mark>data-lang-content="title-content"</mark>>Example</title>
<div <mark>id="title-content"</mark> data-lang-declaration hidden>
<span lang=en>Example</span>
<span lang=ja>例</span>
</div>
</code></pre>
<p>Note that the pointed element, i.e. the <code>div</code> element,
has the <a href="#attr-data-lang-declaration"><code>data-lang-declaration</code></a>
attribute specified. In many (though not all) cases, the pointed
translations do not form the actual content of the document and
therefore the attribute ask to <i lang="ja">harusame</i> to get rid of
them from the document at the end of the processing.
</p></dt><dt lang="en"><dfn id="attr-data-lang-declaration"><code>data-lang-declaration</code></dfn>
</dt><dd>
<p>This attribute indicates that the element declares a set of
alternatives in various languages.
</p><p>This attribute must not be used for an element that is not pointed
by a <code>data-lang-content</code> attribute in the same document.
</p></dd></dl>
</div>
<div class="section" id="examples">
<h2 data-lang-container=""><span lang="ja">利用例</span></h2>
<p data-lang-container=""><span lang="ja">この文書自体も春雨を使って生成しています。<a href="readme.html.src">春雨の使い方の例として、
原始文書をご覧ください</a>。</span></p></div>
<div class="section" id="dependency">
<h2 data-lang-container=""><span lang="ja">依存性</span></h2>
<p data-lang-container=""><span lang="ja">春雨の動作には Perl 5.8 以降が必要です。</span></p><p data-lang-container=""><span lang="ja">春雨は<a href="https://suika.suikawiki.org/www/manakai-core/doc/web/">manakai-core</a>
と <a href="https://suika.suikawiki.org/www/charclass/readme">CharClass</a>
も使っています (Git リポジトリーのサブモジュールです)。</span></p></div>
<div class="section" id="download">
<h2>Download</h2>
<p data-lang-container=""><span lang="ja">春雨は Git を使って開発しています。 Git リポジトリ(<!--<a
href="http://suika.fam.cx/gate/git/wi/harusame.git/">Suika</a> / --><a href="https://github.com/wakaba/harusame">GitHub</a>) は次のようにして
clone できます。</span></p><pre id="setup">
$ <kbd>git clone https://github.com/wakaba/harusame.git</kbd><!--
$ <kbd>git clone http://suika.fam.cx/gate/git/bare/harusame.git/</kbd>-->
$ <kbd>cd harusame</kbd>
$ <kbd>make deps</kbd>
$ <kbd>./harusame</kbd>
</pre>
<!--
<p>This software is available from <a
href="http://suika.fam.cx/gate/cvs/webroot/www/harusame/">the CVS
repository</a>.
<p><a
href="http://suika.fam.cx/gate/cvs/webroot/www/harusame/harusame.tar.gz?tarball=1">The
tarball for the latest version</a> is also available.
-->
</div>
<div class="section" id="author">
<h2 data-lang-container=""><span lang="ja">著者</span></h2>
<p><a href="https://suika.suikawiki.org/~wakaba/who?" rel="author">Wakaba</a>.</p>
</div>
<div class="section" id="license">
<h2 data-lang-container=""><span lang="ja">ライセンス</span></h2>
<p>Copyright
2008-2015 <a href="http://suika.suikawiki.org/~wakaba/who?">Wakaba</a>
<code class="mail"><<a href="mailto:wakaba@suikawiki.org" rel="author">wakaba@suikawiki.org</a>></code>.</p>
<p>This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.</p>
</div>
<footer>
[<a href="readme.en" hreflang="en" lang="en" rel="alternate">English</a>]
[<a href="readme.ja" hreflang="ja" lang="ja" rel="alternate">日本語</a>]
</footer>
</body></html>