yatex

view docs/yahtmlj.tex @ 611:e87c3271b8fd

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