yatex

view docs/yahtmlj.tex @ 265:0b10d1fea265

Fix many misuse of braces and so on. Suggested by lurdan@.
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 29 Feb 2012 10:43:24 +0900
parents 265da12ff3b6
children d467c0fb6083
line source
1 \def\lang{jp} % -*- texinfo -*- for Texinfo V.3.1
2 \input texinfo
3 @setfilename yahtmlj
4 @settitle Yet Another html-mode for Emacs
6 @iftex
7 @c @syncodeindex fn cp
8 @c Last modified Wed Feb 29 09:18:14 2012 on firestorm
9 @syncodeindex vr cp
10 @end iftex
12 @titlepage
13 @sp 10
14 @center
15 @subtitle Yet Another html-mode for emacs
16 @title 『HTML屋』
17 @subtitle // yahtml //
18 @author @copyright{} 1994-1997 by HIROSE, Yuuji [yuuji@@yatex.org]
19 @end titlepage
21 @node Top, Intro, (dir), (dir)
22 @comment node-name, next, previous, up
24 @menu
25 * Intro:: はじめに
26 * Installation:: インストール
27 * Command Invocation:: 外部コマンド起動
28 * Completion:: 補完入力
29 * Jump:: カーソルジャンプ
30 * Changing and Deleting:: 変更と削除
31 * CSS Support:: スタイルシート補完
32 * Customizations:: カスタマイズ変数一覧
33 * Copying:: とりあつかい
34 * Concept Index:: 索引
36 @end menu
38 @node Intro, Installation, Top, Top
39 @comment node-name, next, previous, up
40 @chapter はじめに
41 @cindex Demacs
42 @cindex Mule
43 @cindex LaTeX
44 @cindex HTML屋[HTMLや]
46 yahtmlは GNU Emacs 上で HTML文書を作成する時に、繁雑なHTMLタグの入力を補
47 完機能によってスムーズに行えるようにするだけでなく、weblintなどの構文チェッ
48 クプログラム、カーソル位置のURLやファイル名に依存したブラウザ/イメージヴュー
49 アの起動などを Emacs 編集画面中から
50 行えるようにするパッケージです。
52 (このInfoは未完成です(__)…)
54 @node Installation, Command Invocation, Intro, Top
55 @comment node-name, next, previous, up
56 @chapter インストール
57 @menu
58 * yahtml起動のための設定::
59 * lintプログラム/ブラウザ/イメージヴューア環境等の設定::
60 * WWWページ環境用変数の設定::
61 @end menu
63 @node yahtml起動のための設定, lintプログラム/ブラウザ/イメージヴューア環境等の設定, Installation, Installation
64 @section yahtml起動のための設定
67 @file{~/.emacs}に下の2項目を加えます。
69 @lisp
70 (setq auto-mode-alist
71 (cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist))
72 (autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t)
73 @end lisp
75 次にyahtmlに必要なファイル(@file{yahtml.el}, @file{yatexlib.el},
76 @file{yatexprc.el}) を置くディレクトリを load-path に加えます。たとえば、
77 @file{~/src/emacs/yahtml}に置くのであれば、
79 @lisp
80 (setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path))
81 @end lisp
83 @noindent
84 などとします。
86 以上の設定により、拡張子が .html であるファイルを編集すると自動的に
87 yahtml がロードされます。yahtmlが正常に起動できたときはモードラインの表示が
88 「yahtml」に変わります。
90 @node lintプログラム/ブラウザ/イメージヴューア環境等の設定, WWWページ環境用変数の設定, yahtml起動のための設定, Installation
91 @section lintプログラム/ブラウザ/イメージヴューア環境等の設定
93 利用する外部プログラムなどに関する以下の変数を確認し、必要なら正しい値に変
94 更します(括弧内はデフォルト値)。
95 @table @code
96 @item yahtml-www-browser
97 @dots{} 起動するブラウザのコマンド名(netscape)
98 @item yahtml-image-viewer
99 @dots{} 起動する画像ビューアのコマンド名(xv)
100 @item yahtml-lint-program
101 @dots{} 構文チェックプログラムのコマンド名(jweblint)
102 @item yahtml-kanji-code
103 @dots{} htmlファイルの漢字コード
104 @end table
106 @node WWWページ環境用変数の設定, , lintプログラム/ブラウザ/イメージヴューア環境等の設定, Installation
107 @section WWWページ環境用変数の設定
109 ホームページとなるファイルが存在するPATH名に関する変数を設定します。
110 @table @code
111 @item yahtml-path-url-alist
112 @dots{} ファイルシステム上のPATH名と、URLの対応表
113 @item yahtml-directory-index
114 @dots{} URL指定でファイル名を省略したときに表示されるインデックス
115 ファイル名(NCSA系httpdなら @file{index.html}, CERN系なら
116 @file{Welcome.html}が一般的)
117 @end table
119 変数 @code{yahtml-path-url-alist} の設定例を示します。例えば、自宅では、
120 @file{/home/yuuji/http/} が @code{http://localhost/~yuuji} で参照でき、職
121 場では @file{/usr/home/yuuji/www/} が@code{http://www.keio.ac.jp/~yuuji/}
122 で参照できるようになっている場合は以下のように設定します。
124 @lisp
125 (setq yahtml-path-url-alist
126 '(("/home/yuuj/http" . "http://localhost/~yuuji")
127 ("/usr/home/yuuj/www" . "http://www.keio.ac.jp/~yuuji")))
128 @end lisp
130 この対応組はいくらでも設定することができます。
132 @node Command Invocation, Completion, Installation, Top
133 @comment node-name, next, previous, up
134 @chapter 外部コマンド起動
136 HTMLファイル編集にかかわるいくつかのコマンドを即座に呼ぶことができます。
137 @table @kbd
138 @item [prefix] t j
139 @dots{} HTML構文チェッカ(jweblint)起動
140 @item [prefix] t p
141 @dots{} 現在のページを対象としたブラウザ起動
142 @item [prefix] t r
143 @dots{} 現在のページがブラウザに表示されているときのreload指定
144 @end table
146 @node Completion, Jump, Command Invocation, Top
147 @comment node-name, next, previous, up
148 @chapter 補完入力
150 「野鳥」で利用できる、「begin型補完」、「section型補完」、
151 「large型補完」、「maketitle型補完」、「アクセント補完」
152 と全く同じキー操作で対応する
153 HTMLタグの補完入力ができます。それぞれの型の補完は順に、
154 「複数行に渡るタグ入力」、「空要素タグ(imgなど)の補完」、
155 「一行内での開始/終了タグの入力」、「空要素空属性タグの入力」、
156 「文字参照入力」
157
158 対応しています。具体的には
160 @table @kbd
161 @item [prefix] b (野鳥のbegin補完に対応)
162 @dots{}
163 @example
164 <ul>
165 </ul>
166 @end example
168 @noindent
169 のように開始タグと終了タグを二行に渡って書きたい場合の補完を指します。
170 おもにブロック型タグが補完候補に含まれます。
172 @item [prefix] s (野鳥のsection型補完に対応)
173 @dots{}
174 @example
175 <img src="foo.gif" alt="photo">
176 @end example
178 @noindent
179 のように終了タグを持たず、かつ属性値のみで機能を指定するタグを補完します。
180 補完候補としては、img, input が存在します。
182 @item [prefix] l (野鳥のlarge型補完に対応)
183 @dots{} begin型補完とほぼ同じですが、
185 @example
186 <big> 〜 </big>
187 @end example
189 @noindent
190 のように一行内に開始/終了タグを入れたいときに利用します。
192 @item [prefix] m (野鳥のmaketitle型補完に対応)
193 @dots{} 要素も属性値も持たないタグを補完入力します。<br>
194 などが補完候補に相当します。
196 @item [prefix] a (野鳥のアクセント補完に対応)
197 @dots{} エンティティ参照による文字表記を入力するときに用います。
198 デフォルトでは < (&lt;), > (&gt;), & (&amp;), " (&quot;), ' (&apos;),
199 ブランク (&nbsp;) の補完入力が行えます。
200 @end table
202 @node Jump, Changing and Deleting, Completion, Top
203 @comment node-name, next, previous, up
204 @chapter カーソルジャンプ
205 文書中のいろいろな場所で
207 @table @kbd
208 @item [prefix] g
209 @dots{} 対応するオブジェクトにジャンプ
210 @end table
212 @noindent
213 を押すことにより、カーソル位置のHTML構文に対応する場所にジャンプ
214 します。対応関係が存在すると解釈されるコマンドには以下のものがあります。
216 @itemize @bullet
217 @item @code{<TAG>} ←→ @code{</TAG>}
218 @item @code{<img src="画像ファイル">} → 対応するviewer起動
219 @item @code{<a href="リンク先">} → リンク先へのポイント移動
220 @item @code{<applet code="プログラム">} → Javaソースプログラムへの移動
221 @c @item @code{\include(\input)} → 対応するファイル
222 @end itemize
224 @node Changing and Deleting, CSS Support, Jump, Top
225 @comment node-name, next, previous, up
226 @chapter 変更/削除
228 @menu
229 * 対タグの変更::
230 * 文字参照への変更::
231 * リジョン内文字のURLencode::
232 * td括り/tr括り::
233 @end menu
235 @node 対タグの変更, 文字参照への変更, Changing and Deleting, Changing and Deleting
236 @comment node-name, next, previous, up
237 @section 対タグの変更
238 文書中のいろいろな場所で
240 @table @kbd
241 @item [prefix] c
242 @dots{} 対応するタグ等を変更
243 @end table
245 @noindent
246 を押すことにより、カーソル位置のHTML構文に応じた
247 記述内容の変更を行います。カーソル位置と変更する内容の
248 対応は以下の通りです。
250 @itemize @bullet
251 @item @code{<TAG>}〜@code{</TAG>}
252 @dots{} @code{TAG} の変更
253 @item @code{<img src="画像ファイル" alt="photo">} などの属性値
254 @dots{} 属性値の変更
255 @end itemize
257 @node 文字参照への変更, リジョン内文字のURLencode, 対タグの変更, Changing and Deleting
258 @comment node-name, next, previous, up
259 @section 文字参照への変更
260 文字としての < や > を表現するときは、文字参照を用いて
261 &lt; や &gt; と表記する必要がありますが、
262 HTML以外のファイルからこれらの文字を含むテキストを張り込んだ場合
263 などに、これらの文字を一括して文字参照形式に変換できます。
265 @table @kbd
266 @item [prefix] ;
267 @dots{} 指定した領域の文字参照に置き換えるべき文字の置換
268 @item [prefix] :
269 @dots{} 指定した領域の文字参照を参照文字そのものに置換
270 ([prefix] ; の逆変換)
271 @end table
274 @node リジョン内文字のURLencode, td括り/tr括り, 文字参照への変更, Changing and Deleting
275 @comment node-name, next, previous, up
276 @section リジョン内文字のURLencode
277 @table @kbd
278 @item [prefix] #
279 @dots{} 指定した領域内に URLencode すべき文字があればそれらを
280 エンコード表記に置換。
281 @end table
283 @node td括り/tr括り, , リジョン内文字のURLencode, Changing and Deleting
284 @comment node-name, next, previous, up
285 @section td括り/tr括り
286 空白区切りで書いた表形式の行レコードを <td> 括りの並び,
287 あるいはそれらをさらに <tr> で括った行並びに変換できます。
288 @table @kbd
289 @item [prefix] @}
290 @dots{} 現在のリジョンにあるデータを空白区切りごとに
291 <td>...</td> で括る
292 @item [prefix] ]
293 @dots{} 現在のリジョンにある行を
294 上記td括りをほどこしてからさらに行ごとに <tr>...</tr> で括る
295 @end table
296 デフォルトでは空白区切りですが,これを変えるときは
297 Delimiter: の問い合わせに区切り文字を指定します。たとえばカンマ(,)
298 を指定するとCSVから表を作ることができます。
300 td以外の要素,具体的には th で括りたい場合は universal-argument
301 (@kbd{C-u}) をつけて上記2つのコマンドを呼びます。どの要素で括るかの
302 質問が増えるのでそれに th と入れれば,各フィールドを <th>...</th>
303 で括ります。もし,第1フィールドのみ th で,残りを全部 td 括りにしたいとき
304 は thd と入力して下さい。
306 @node CSS Support, Customizations, Changing and Deleting, Top
307 @comment node-name, next, previous, up
308 @chapter CSS(スタイルシート)サポート
310 @menu
311 * CSS-class completion::
312 * Reread CSS file::
313 @end menu
315 @node CSS-class completion, Reread CSS file, CSS Support, CSS Support
316 @comment node-name, next, previous, up
317 @section CSSクラス名補完
318 HTML屋はCSS(Cascading Style Sheets)のクラス名を補完入力することができます。
319 スタイル定義として
321 @display
322 h1.foo, h2.foo @{ background-color: 0xffffff; @}
323 h1.bar, h2.bar @{ font-size: 120%; @}
324 @end display
326 のようなものがあった場合に、h1またはh2タグを [prefix] b や [prefix] l で補
327 完入力した場合に、それらに有効な class 名である foo, bar を候補として補完
328 入力することが可能です。また
330 @display
331 .caution @{ font-size: 120%; background-color: 0xc00000;@}
332 @end display
334 のような全てのエレメントに働くclassが定義されていた場合は、全てのタグの補
335 完入力時にclass参照入力を求められます。これが煩わしい場合はエレメント名入
336 力確定のときにリターンキー(またはC-m)ではなく、C-jを押せばclass補完入力を
337 キャンセルできます。たとえば
339 @display
340 @kbd{[prefix] l} 行内タグ補完を起動
341 (または@kbd{[prefix] l SPC})
342 tt <tt></tt>をいれたいのでttと入力
343 @kbd{C-m}
344 @end display
346 とした場合は続いて class= と補完プロンプトが出ますが、
348 @display
349 @kbd{[prefix] l} 行内タグ補完を起動
350 (または@kbd{[prefix] l SPC})
351 tt <tt></tt>をいれたいのでttと入力
352 @kbd{C-j}
353 @end display
355 と最後を @kbd{C-j} で入力した場合は class 補完プロンプトは出ません。
357 @node Reread CSS file, , CSS-class completion, CSS Support
358 @comment node-name, next, previous, up
359 @section CSS定義ファイルの読み直し
360 htmlファイルを編集中にCSS定義ファイルを修正し、追加した
361 classを補完候補として直ちに読み込ませたい場合は、
362 @kbd{M-x yahtml-mode} として再起動を行ってください。
364 @node Customizations, Copying, CSS Support, Top
365 @comment node-name, next, previous, up
366 @chapter カスタマイズ
367 @cindex カスタマイズ[かすたまいす]
368 @cindex キーアサイン[きいあさいん]
370 yahtmlの動作を制御する変数について説明します。
372 @menu
373 * All customizable variables:: カスタマイズ変数一覧
374 * Hook variables:: hook変数
375 @end menu
377 @node All customizable variables, Hook variables, Customizations, Customizations
378 @comment node-name, next, previous, up
379 @section カスタマイズ変数一覧
381 @defvar yahtml-prefix
382 yahtml-mode 中のプリフィクスキー (@kbd{\C-c})
383 @end defvar
385 @defvar yahtml-image-viewer
386 imgで参照している画像ファイルを表示するときに起動するコマンド (xv)
387 @end defvar
389 @defvar yahtml-www-browser
390 @kbd{[prefix]g} で外部ページを表示するときに起動するブラウザ (netscape)
391 @end defvar
393 @defvar yahtml-kanji-code
394 デフォルトの漢字コード。1=sjis, 2=jis, 3=euc, 4=utf-8 (2)
395 .htaccess ファイルに
396 @quotation
397 AddType "text/html; charset=xxx" .html
398 @end quotation
399 の記述があった場合はそれに従う
400 @end defvar
402 @defvar yahtml-fill-column
403 auto-fillするときのカラム数 (72)
404 @end defvar
406 @defvar yahtml-fill-prefix
407 yahtml-mode 固有のfill-prefix (@code{nil})
408 @end defvar
410 @defvar yahtml-path-url-alist
411 OSのファイルシステム上でのフルパス名と、その外部公開時のURLの対応表。
412 @end defvar
414 @defvar yahtml-directory-index
415 サーバアクセス時ファイル名を省略したときにデフォルトで開かれる
416 インデックスファイルの名前。多くの場合 index.html。(@code{"index.html"})
417 @end defvar
419 @defvar yahtml-lint-program
420 HTML構文チェックプログラム。(@code{"jweblint"})
421 @end defvar
423 @defvar yahtml-hate-too-deep-indentation
424 ネストした列挙系環境でのインデントが深すぎるときにtにする。(@code{nil})
425 @end defvar
427 @defvar yahtml-always-/p
428 @code{<p>} をいれたら必ず @code{</p>} したい人向け。@code{nil}
429 @end defvar
431 @defvar yahtml-p-prefered-env-regexp
432 自動的に @code{<p>} を入れて欲しい環境。
433 (@code{"^\\(body\\|dl\\|blockquote\\)"})
434 @end defvar
436 @defvar yahtml-template-file
437 新規HTMLファイル作成時に自動的に挿入して欲しいファイル名。
438 @file{"~/http/template.html"}
439 @end defvar
441 @defvar yahtml-prefer-upcases
442 タグに大文字を使いたい。@code{nil}
443 @end defvar
445 @defvar yahtml-prefer-upcase-attributes
446 属性指定子に大文字を使いたい。@code{nil}
447 @end defvar
449 @defvar yahtml-server-type
450 Apache系のサーバを利用している場合は 'apache をセットする。
451 ./.htaccess を参照するかどうかを決定する。@code{'apache}
452 @end defvar
454 @defvar yahtml-apache-access-file
455 @code{yahtml-server-type} が @code{'apache} のときに
456 アクセス制限ファイル名を指定。@file{".htaccess"}
457 @end defvar
459 @defvar yahtml-shell-command-option
460 シェルで別コマンドを起動するときのオプション。
461 @end defvar
463 @defvar yahtml-translate-hyphens-when-comment-region
464 領域コメントアウトをするときに既に存在するハイフンを @code{&#45;} に
465 変更するかどうか。(@code{t})
466 @end defvar
468 @defvar yahtml-entity-reference-chars-alist
469 エンティティ参照(Entity Reference)で記述すべき文字群を
470 @code{'(?文字 . "エンティティ表記")} という形式を列挙した
471 alistで並べる。デフォルトで @code{<}, @code{>}, @code{&}, @code{'},
472 @code{"} に対するalistが設定されているので、追加したい分だけを記述すれば良
473 い。cdr部 @code{"エンティティ表記"} は、先頭の @code{&} と 末尾の@code{;}
474 は含めずに書く。
475 @end defvar
477 @defvar yahtml-faithful-to-htmllint
478 構文チェッカとして htmllint を利用する場合ちょっとした余計な空白などに
479 対しても警告を示すので、これを回避するときにはこの変数を@code{t}に
480 する。
481 @end defvar
483 @defvar yahtml-use-css
484 CSSの補完機能を使うかどうか (@code{t})
485 @end defvar
487 @defvar yahtml-image-inspection-bytes
488 画像ファイルのサイズを調べるときに読み込むバイト数 (@code{10000})
489 @end defvar
491 @defvar yahtml:img-default-alt-format
492 <img src...>のALT属性のデフォルト文字列の書式。%xは画像の幅、
493 %yは画像の高さ、%sはファイルサイズに置換される (@code{"%xx%y(%sbytes)"})
494 @end defvar
496 @defvar yahtml-escape-chars
497 href補完などのときに予約文字をURLエンコードするか;
498 'askのときは確認してから置換する (@code{'ask})
499 @end defvar
501 @defvar yahtml-use-font-lock
502 ソースの色づけパッケージとして font-lock を利用するか
503 (@code{(featurep 'font-lock)})
504 @end defvar
506 @defvar yahtml-use-hilit19
507 ソースの色づけパッケージとして hilit19 を利用するか
508 (@code{(featurep 'hilit19)})
509 @end defvar
511 @defvar yahtml-indentation-boundary
512 インデント計算を打ち切ってよい境界となる正規表現
513 (@code{"^\\s *<h[1-3]>"})
514 @end defvar
516 @node Hook variables, , All customizable variables, Customizations
517 @comment node-name, next, previous, up
518 @section hook変数
521 @node Copying, Concept Index, Customizations, Top
522 @comment node-name, next, previous, up
523 @chapter 取り扱い
525 本プログラムはフリーソフトウェアです。本プログラムを使用して生じたいかな
526 る結果に対しても作者は責任を負わないこととします。転載等に関しては制限いた
527 しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい
528 ただくと、作者は喜んでサポートに励むことでしょう。
530 苦情、希望、バグ報告、感想等は歓迎いたします。
531 連絡は yuuji@@yatex.org まで(2000年12月現在)。
532 継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
533 是非加入してください。加入方法については本パッケージの @file{docs/htmlqa}
534 ファイルの「その他」の章を御覧ください。
536 仕様は、予告なく確実に(気分次第で)変更されます:-p。
538 @flushright
539 広瀬雄二
540 @end flushright
543 @node Concept Index, , Copying, Top
544 @comment node-name, next, previous, up
545 @unnumbered 索引
546 @printindex cp
549 @contents
551 @bye
553 @c Local Variables:
554 @c fill-column: 74
555 @c fill-prefix: nil
556 @c buffer-file-coding-system: sjis-dos
557 @c End:
558 
559 Tag table:
560 
561 End tag table