yatex

view docs/yahtmlj.tex @ 118:e1693ffc64cc

kanji-code: 4=UTF-8
author yuuji@gentei.org
date Fri, 20 Nov 2009 07:22:01 +0900
parents 7e361fb5401d
children 2638644ff9a0
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 Fri Nov 20 07:20:46 2009 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 @end menu
234 @node 対タグの変更, 文字参照への変更, Changing and Deleting, Changing and Deleting
235 @comment node-name, next, previous, up
236 @section 対タグの変更
237 文書中のいろいろな場所で
239 @table @kbd
240 @item [prefix] c
241 @dots{} 対応するタグ等を変更
242 @end table
244 @noindent
245 を押すことにより、カーソル位置のHTML構文に応じた
246 記述内容の変更を行います。カーソル位置と変更する内容の
247 対応は以下の通りです。
249 @itemize @bullet
250 @item @code{<TAG>}〜@code{</TAG>}
251 @dots{} @code{TAG} の変更
252 @item @code{<img src="画像ファイル" alt="photo">} などの属性値
253 @dots{} 属性値の変更
254 @end itemize
256 @node 文字参照への変更, リジョン内文字のURLencode, 対タグの変更, Changing and Deleting
257 @comment node-name, next, previous, up
258 @section 文字参照への変更
259 文字としての < や > を表現するときは、文字参照を用いて
260 &lt; や &gt; と表記する必要がありますが、
261 HTML以外のファイルからこれらの文字を含むテキストを張り込んだ場合
262 などに、これらの文字を一括して文字参照形式に変換できます。
264 @table @kbd
265 @item [prefix] ;
266 @dots{} 指定した領域の文字参照に置き換えるべき文字の置換
267 @item [prefix] :
268 @dots{} 指定した領域の文字参照を参照文字そのものに置換
269 ([prefix] ; の逆変換)
270 @end table
273 @node リジョン内文字のURLencode, , 文字参照への変更, Changing and Deleting
274 @comment node-name, next, previous, up
275 @section リジョン内文字のURLencode
276 @table
277 @item [prefix] #
278 @dots{} 指定した領域内に URLencode すべき文字があればそれらを
279 エンコード表記に置換。
280 @end table
282 @node CSS Support, Customizations, Changing and Deleting, Top
283 @comment node-name, next, previous, up
284 @chapter CSS(スタイルシート)サポート
286 @menu
287 * CSS-class completion::
288 * Reread CSS file::
289 @end menu
291 @node CSS-class completion, Reread CSS file, CSS Support, CSS Support
292 @comment node-name, next, previous, up
293 @section CSSクラス名補完
294 HTML屋はCSS(Cascading Style Sheets)のクラス名を補完入力することができます。
295 スタイル定義として
297 @display
298 h1.foo, h2.foo @{ background-color: 0xffffff; @}
299 h1.bar, h2.bar @{ font-size: 120%; @}
300 @end display
302 のようなものがあった場合に、h1またはh2タグを [prefix] b や [prefix] l で補
303 完入力した場合に、それらに有効な class 名である foo, bar を候補として補完
304 入力することが可能です。また
306 @display
307 .caution @{ font-size: 120%; background-color: 0xc00000;@}
308 @end display
310 のような全てのエレメントに働くclassが定義されていた場合は、全てのタグの補
311 完入力時にclass参照入力を求められます。これが煩わしい場合はエレメント名入
312 力確定のときにリターンキー(またはC-m)ではなく、C-jを押せばclass補完入力を
313 キャンセルできます。たとえば
315 @display
316 @kbd{[prefix] l} 行内タグ補完を起動
317 (または@kbd{[prefix] l SPC})
318 tt <tt></tt>をいれたいのでttと入力
319 @kbd{C-m}
320 @end display
322 とした場合は続いて class= と補完プロンプトが出ますが、
324 @display
325 @kbd{[prefix] l} 行内タグ補完を起動
326 (または@kbd{[prefix] l SPC})
327 tt <tt></tt>をいれたいのでttと入力
328 @kbd{C-j}
329 @end display
331 と最後を @kbd{C-j} で入力した場合は class 補完プロンプトは出ません。
333 @node Reread CSS file, , CSS-class completion, CSS Support
334 @comment node-name, next, previous, up
335 @section CSS定義ファイルの読み直し
336 htmlファイルを編集中にCSS定義ファイルを修正し、追加した
337 classを補完候補として直ちに読み込ませたい場合は、
338 @kbd{M-x yahtml-mode} として再起動を行ってください。
340 @node Customizations, Copying, CSS Support, Top
341 @comment node-name, next, previous, up
342 @chapter カスタマイズ
343 @cindex カスタマイズ[かすたまいす]
344 @cindex キーアサイン[きいあさいん]
346 yahtmlの動作を制御する変数について説明します。
348 @menu
349 * All customizable variables:: カスタマイズ変数一覧
350 * Hook variables:: hook変数
351 @end menu
353 @node All customizable variables, Hook variables, Customizations, Customizations
354 @comment node-name, next, previous, up
355 @section カスタマイズ変数一覧
357 @defvar yahtml-prefix
358 yahtml-mode 中のプリフィクスキー (@kbd{\C-c})
359 @end defvar
361 @defvar yahtml-image-viewer
362 imgで参照している画像ファイルを表示するときに起動するコマンド (xv)
363 @end defvar
365 @defvar yahtml-www-browser
366 @kbd{[prefix]g} で外部ページを表示するときに起動するブラウザ (netscape)
367 @end defvar
369 @defvar yahtml-kanji-code
370 デフォルトの漢字コード。1=sjis, 2=jis, 3=euc, 4=utf-8 (2)
371 .htaccess ファイルに
372 @quotation
373 AddType "text/html; charset=xxx" .html
374 @end quotation
375 の記述があった場合はそれに従う
376 @end defvar
378 @defvar yahtml-fill-column
379 auto-fillするときのカラム数 (72)
380 @end defvar
382 @defvar yahtml-fill-prefix
383 yahtml-mode 固有のfill-prefix (@code{nil})
384 @end defvar
386 @defvar yahtml-path-url-alist
387 OSのファイルシステム上でのフルパス名と、その外部公開時のURLの対応表。
388 @end defvar
390 @defvar yahtml-directory-index
391 サーバアクセス時ファイル名を省略したときにデフォルトで開かれる
392 インデックスファイルの名前。多くの場合 index.html。(@code{"index.html"})
393 @end defvar
395 @defvar yahtml-lint-program
396 HTML構文チェックプログラム。(@code{"jweblint"})
397 @end defvar
399 @defvar yahtml-hate-too-deep-indentation
400 ネストした列挙系環境でのインデントが深すぎるときにtにする。(@code{nil})
401 @end defvar
403 @defvar yahtml-always-/p
404 @code{<p>} をいれたら必ず @code{</p>} したい人向け。@code{nil}
405 @end defvar
407 @defvar yahtml-p-prefered-env-regexp
408 自動的に @code{<p>} を入れて欲しい環境。
409 (@code{"^\\(body\\|dl\\|blockquote\\)"})
410 @end defvar
412 @defvar yahtml-template-file
413 新規HTMLファイル作成時に自動的に挿入して欲しいファイル名。
414 @file{"~/http/template.html"}
415 @end defvar
417 @defvar yahtml-prefer-upcases
418 タグに大文字を使いたい。@code{nil}
419 @end defvar
421 @defvar yahtml-prefer-upcase-attributes
422 属性指定子に大文字を使いたい。@code{nil}
423 @end defvar
425 @defvar yahtml-server-type
426 Apache系のサーバを利用している場合は 'apache をセットする。
427 ./.htaccess を参照するかどうかを決定する。@code{'apache}
428 @end defvar
430 @defvar yahtml-apache-access-file
431 @code{yahtml-server-type} が @code{'apache} のときに
432 アクセス制限ファイル名を指定。@file{".htaccess"}
433 @end defvar
435 @defvar yahtml-shell-command-option
436 シェルで別コマンドを起動するときのオプション。
437 @end defvar
439 @defvar yahtml-translate-hyphens-when-comment-region
440 領域コメントアウトをするときに既に存在するハイフンを @code{&#45;} に
441 変更するかどうか。(@code{t})
442 @end defvar
444 @defvar yahtml-entity-reference-chars-alist
445 エンティティ参照(Entity Reference)で記述すべき文字群を
446 @code{'(?文字 . "エンティティ表記")} という形式を列挙した
447 alistで並べる。デフォルトで @code{<}, @code{>}, @code{&}, @code{'},
448 @code{"} に対するalistが設定されているので、追加したい分だけを記述すれば良
449 い。cdr部 @code{"エンティティ表記"} は、先頭の @code{&} と 末尾の@code{;}
450 は含めずに書く。
451 @end defvar
453 @defvar yahtml-faithful-to-htmllint
454 構文チェッカとして htmllint を利用する場合ちょっとした余計な空白などに
455 対しても警告を示すので、これを回避するときにはこの変数を@code{t}に
456 する。
457 @end defvar
459 @defvar yahtml-use-css
460 CSSの補完機能を使うかどうか (@code{t})
461 @end defvar
463 @defvar yahtml-image-inspection-bytes
464 画像ファイルのサイズを調べるときに読み込むバイト数 (@code{10000})
465 @end defvar
467 @defvar yahtml:img-default-alt-format
468 <img src...>のALT属性のデフォルト文字列の書式。%xは画像の幅、
469 %yは画像の高さ、%sはファイルサイズに置換される (@code{"%xx%y(%sbytes)"})
470 @end defvar
472 @defvar yahtml-escape-chars
473 href補完などのときに予約文字をURLエンコードするか;
474 'askのときは確認してから置換する (@code{'ask})
475 @end defvar
477 @defvar yahtml-use-font-lock
478 ソースの色づけパッケージとして font-lock を利用するか
479 (@code{(featurep 'font-lock)})
480 @end defvar
482 @defvar yahtml-use-hilit19
483 ソースの色づけパッケージとして hilit19 を利用するか
484 (@code{(featurep 'hilit19)})
485 @end defvar
487 @defvar yahtml-indentation-boundary
488 インデント計算を打ち切ってよい境界となる正規表現
489 (@code{"^\\s *<h[1-3]>"})
490 @end defvar
492 @node Hook variables, , All customizable variables, Customizations
493 @comment node-name, next, previous, up
494 @section hook変数
497 @node Copying, Concept Index, Customizations, Top
498 @comment node-name, next, previous, up
499 @chapter 取り扱い
501 本プログラムはフリーソフトウェアです。本プログラムを使用して生じたいかな
502 る結果に対しても作者は責任を負わないこととします。転載等に関しては制限いた
503 しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい
504 ただくと、作者は喜んでサポートに励むことでしょう。
506 苦情、希望、バグ報告、感想等は歓迎いたします。
507 連絡は yuuji@@yatex.org まで(2000年12月現在)。
508 継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
509 是非加入してください。加入方法については本パッケージの @file{docs/htmlqa}
510 ファイルの「その他」の章を御覧ください。
512 仕様は、予告なく確実に(気分次第で)変更されます:-p。
514 @flushright
515 広瀬雄二
516 @end flushright
519 @node Concept Index, , Copying, Top
520 @comment node-name, next, previous, up
521 @unnumbered 索引
522 @printindex cp
525 @contents
527 @bye
529 @c Local Variables:
530 @c fill-column: 74
531 @c fill-prefix: nil
532 @c buffer-file-coding-system: sjis-dos
533 @c End:
534 
535 Tag table:
536 
537 End tag table