Mercurial > hgrepos > hgweb.cgi > yatex
annotate docs/yahtmle.tex @ 272:78d0fdc0459c dev
Add `@directory' entries to info sources.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 11 May 2012 15:43:40 +0900 |
parents | d467c0fb6083 |
children |
rev | line source |
---|---|
70 | 1 \def\lang{eng} % -*- texinfo -*- for Texinfo V.3.1 |
2 \input texinfo | |
3 @setfilename yahtmle | |
4 @settitle Yet Another html-mode for Emacs | |
272
78d0fdc0459c
Add `@directory' entries to info sources.
HIROSE Yuuji <yuuji@gentei.org>
parents:
271
diff
changeset
|
5 @direntry |
78d0fdc0459c
Add `@directory' entries to info sources.
HIROSE Yuuji <yuuji@gentei.org>
parents:
271
diff
changeset
|
6 * yahtml-e: (yahtmle). Yet Another html-mode for Emacs (English). |
78d0fdc0459c
Add `@directory' entries to info sources.
HIROSE Yuuji <yuuji@gentei.org>
parents:
271
diff
changeset
|
7 @end direntry |
70 | 8 |
9 @iftex | |
10 @c @syncodeindex fn cp | |
272
78d0fdc0459c
Add `@directory' entries to info sources.
HIROSE Yuuji <yuuji@gentei.org>
parents:
271
diff
changeset
|
11 @c Last modified Fri May 11 15:42:22 2012 on firestorm |
70 | 12 @syncodeindex vr cp |
13 @end iftex | |
14 | |
15 @titlepage | |
16 @sp 10 | |
17 @center | |
18 @subtitle Yet Another html-mode for emacs | |
19 @title // yahtml // | |
20 %@subtitle // yahtml // | |
271 | 21 @author @copyright{} 1994-2012 by HIROSE, Yuuji [yuuji@@yatex.org] |
70 | 22 @end titlepage |
23 | |
24 @node Top, Intro, (dir), (dir) | |
25 @comment node-name, next, previous, up | |
26 | |
27 @menu | |
28 * Intro:: Introduction | |
29 * Installation:: Installing yahtml | |
30 * Command Invocation:: Using External Commands | |
31 * Completion:: Input with Completion | |
32 * Jump:: Moving the Cursor | |
33 * Changing and Deleting:: Changing and Deleting | |
34 * CSS Support:: Style Sheet Support | |
35 * Customizations:: List of Customize Variables | |
36 * Copying:: Copyright | |
37 * Concept Index:: Index | |
38 @end menu | |
39 | |
40 @node Intro, Installation, Top, Top | |
41 @comment node-name, next, previous, up | |
42 @chapter Introduction | |
43 @cindex Demacs | |
44 @cindex Mule | |
45 @cindex LaTeX | |
46 @cindex yahtml | |
47 | |
48 yahtml is a package to support creating HTML documents on Emacsens. Easy | |
49 input of elements (tags) by completion, syntax checking with programs like | |
50 weblint, and invoking the appropriate browser or image viewer depending on | |
51 the cursor position is its main features. | |
52 | |
53 (This Info is still incomplete) | |
54 | |
55 @node Installation, Command Invocation, Intro, Top | |
56 @comment node-name, next, previous, up | |
57 @chapter Installing yahtml | |
58 @menu | |
59 * Setting up yahtml:: | |
60 * Setting environments for weblint browsers and image viewers:: | |
61 * Setting environment variables for WWW pages:: | |
62 @end menu | |
63 | |
64 @node Setting up yahtml, Setting environments for weblint browsers and image viewers, Installation, Installation | |
65 @comment node-name, next, previous, up | |
66 @section Setting up yahtml | |
67 | |
68 | |
69 Add the following to @file{~/.emacs} | |
70 | |
71 @lisp | |
72 (setq auto-mode-alist | |
73 (cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist)) | |
74 (autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t) | |
75 @end lisp | |
76 | |
77 Next, add to load-path the directory with the yahtml files | |
78 (@file{yahtml.el}, @file{yatexlib.el}, @file{yatexprc.el}). For example, | |
79 if you put them in @file{~/src/emacs/yahtml}, | |
80 | |
81 @lisp | |
82 (setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path)) | |
83 @end lisp | |
84 | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
85 @noindent |
70 | 86 is what you add. |
87 | |
88 By this, yahtml will be automatically loaded when editing files with .html | |
89 extensions. "yahtml" will be displayed on the mode line if no errors | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
90 occurred. |
70 | 91 |
92 @node Setting environments for weblint browsers and image viewers, Setting environment variables for WWW pages, Setting up yahtml, Installation | |
93 @comment node-name, next, previous, up | |
94 @section Setting environments for weblint, browsers, and image viewers | |
95 | |
96 Check the variables for invoking external commands and modify as needed. | |
97 Defaults are in parenthesis. | |
98 | |
99 @table @code | |
100 @item yahtml-www-browser | |
101 @dots{} browser command name (netscape) | |
102 @item yahtml-image-viewer | |
103 @dots{} image viewer command name (xv) | |
104 @item yahtml-lint-program | |
105 @dots{} syntax check programs command name (jweblint) | |
106 @item yahtml-kanji-code | |
107 @dots{} kanji code for HTML files | |
108 @end table | |
109 | |
110 @node Setting environment variables for WWW pages, , Setting environments for weblint browsers and image viewers, Installation | |
111 @comment node-name, next, previous, up | |
112 @section Setting environment variables for WWW pages | |
113 | |
114 Variables regarding path names for files that will be your home page. | |
115 @table @code | |
116 @item yahtml-path-url-alist | |
117 @dots{} list of matching path name on file system and URLs | |
118 @item yahtml-directory-index | |
119 @dots{} index file displayed when none is given in URL. Usually | |
120 @file{index.html} on NCSA type httpd and @file{Welcome.html} on | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
121 CERN types. |
70 | 122 @end table |
123 | |
124 Examples for @code{yahtml-path-url-alist}. If @file{/home/yuuji/http/} | |
125 is @code{http://localhost/~yuuji} at home and @file{/usr/home/yuuji/www/} | |
126 is @code{http://www.keio.ac.jp/~yuuji/} at work, then | |
127 | |
128 @lisp | |
129 (setq yahtml-path-url-alist | |
130 '(("/home/yuuji/http" . "http://localhost/~yuuji") | |
131 ("/usr/home/yuuji/www" . "http://www.keio.ac.jp/~yuuji"))) | |
132 @end lisp | |
133 | |
134 Any number of additions can be made to this list. | |
135 | |
136 @node Command Invocation, Completion, Installation, Top | |
137 @comment node-name, next, previous, up | |
138 @chapter Invoking external commands | |
139 | |
140 For easy use of commands that are handy when editing HTML files. | |
141 @table @kbd | |
142 @item [prefix] t j | |
143 @dots{} Invoke HTML syntax checker (jweblint) | |
144 @item [prefix] t p | |
145 @dots{} Display current page in browser | |
146 @item [prefix] t r | |
147 @dots{} Reload current page if browser is already running | |
148 @end table | |
149 | |
150 @node Completion, Jump, Command Invocation, Top | |
151 @comment node-name, next, previous, up | |
152 @chapter Completion Input | |
153 | |
154 Completion input of HTML elements is done through the same key strokes as | |
155 YaTeX's begin-type completion, section-type completion, large-type | |
156 completion, maketitle-type completion, and accent completion. | |
157 Corresponding elements in this order is; elements that span multiple | |
158 lines, empty elements such as img, tags that start and end in a | |
159 single line, elements with no attributes or contents, and special or | |
160 symbol entities. | |
161 | |
162 @table @kbd | |
163 @item [prefix] b (YaTeX begin-type completion) | |
164 @dots{} | |
165 @example | |
166 <ul> | |
167 </ul> | |
168 @end example | |
169 | |
170 @noindent | |
171 Completion for elements that the start tag and the end tag span multiple | |
172 lines. Mostly block-level elements. | |
173 | |
174 @item [prefix] s (YateX section-type completion) | |
175 @dots{} | |
176 @example | |
177 <img src="foo.gif" alt="photo"> | |
178 @end example | |
179 | |
180 @noindent | |
181 Completion for elements that do not have end tags and require only | |
182 attributes. Possible completions are, <img>, <input>. | |
183 | |
184 @item [prefix] l (YaTeX large-type completion) | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
185 @dots{} |
70 | 186 |
187 @example | |
72 | 188 <big> $B!A(B </big> |
70 | 189 @end example |
190 | |
191 @noindent | |
192 Similar to begin-type completion but used for elements that start and end | |
193 on a single line. | |
194 | |
195 | |
196 @item [prefix] m (YaTeX maketitle-type completion) | |
197 @dots{} Completion for elements without attributes or contents. Possible | |
198 completion is <br> | |
199 | |
200 @item [prefix] a (YaTeX accent completion) | |
201 @dots{} Used to enter special or symbol entities. By default completion | |
202 for < (<), > (>), & (&), " ("), ' ('), blank ( ) | |
203 is possible. | |
204 @end table | |
205 | |
206 @node Jump, Changing and Deleting, Completion, Top | |
207 @comment node-name, next, previous, up | |
208 @chapter Cursor Movement | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
209 By using |
70 | 210 |
211 @table @kbd | |
212 @item [prefix] g | |
213 @dots{} move to corresponding object | |
214 @end table | |
215 | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
216 @noindent |
70 | 217 the cursor will go to the corresponding object according to the context. |
218 Recognized contexts are | |
219 | |
220 @itemize @bullet | |
221 @item @code{<TAG>} <--> @code{</TAG>} | |
222 @item @code{<img src="image.file">} -> invoke viewer | |
223 @item @code{<a href="link.to.somewhere">} -> move cursor to linked target | |
224 @item @code{<applet code="program">} -> open Java source | |
72 | 225 @c @item @code{\include(\input)} $B"*(B $BBP1~$9$k%U%!%$%k(B |
70 | 226 @end itemize |
227 | |
228 @node Changing and Deleting, CSS Support, Jump, Top | |
229 @comment node-name, next, previous, up | |
230 @chapter Changing and Deleting | |
231 | |
232 @menu | |
233 * Changing tags in pairs:: | |
234 * Changing entities:: | |
235 * URLencoding of strings within region:: | |
269
032d4c4bf7ac
Fix escape chars. Thanks to hiroohongo.
HIROSE Yuuji <yuuji@gentei.org>
parents:
265
diff
changeset
|
236 * td-enclosure/tr-enclosure:: |
70 | 237 @end menu |
238 | |
239 @node Changing tags in pairs, Changing entities, Changing and Deleting, Changing and Deleting | |
240 @comment node-name, next, previous, up | |
241 @section Changing tags in pairs | |
242 By using | |
243 | |
244 @table @kbd | |
245 @item [prefix] c | |
246 @dots{} change tags in matching pairs | |
247 @end table | |
248 | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
249 @noindent |
70 | 250 the content can be changed according to the context of the HTML document |
251 where the cursor is located. | |
252 | |
253 @itemize @bullet | |
72 | 254 @item @code{<TAG>}$B!A(B@code{</TAG>} |
70 | 255 @dots{} change @code{TAG} element name |
256 @item attributes such as @code{<img src="image.file" alt="photo">} | |
257 @dots{} change attributes | |
258 @end itemize | |
259 | |
260 @node Changing entities, URLencoding of strings within region, Changing tags in pairs, Changing and Deleting | |
261 @comment node-name, next, previous, up | |
262 @section Changing entities | |
263 Special characters such as < or > must be written as < and >. Easy | |
264 conversion of these characters can be done when importing text from non | |
265 HTML files. | |
266 | |
267 | |
268 @table @kbd | |
269 @item [prefix] ; | |
270 @dots{} convert char to special entity in marked region | |
271 @item [prefix] : | |
272 @dots{} convert special entity to original char in marked region | |
273 (reverse of [prefix] ;) | |
274 @end table | |
275 | |
276 | |
158 | 277 @node URLencoding of strings within region, td-enclosure/tr-enclosure, Changing entities, Changing and Deleting |
70 | 278 @comment node-name, next, previous, up |
279 @section URLencoding of strings within region | |
280 | |
281 @table @kbd | |
282 @item [prefix] # | |
283 @dots{} encode chars that needs to be URLencoded within region | |
284 @end table | |
285 | |
158 | 286 @node td-enclosure/tr-enclosure, , URLencoding of strings within region, Changing and Deleting |
287 @comment node-name, next, previous, up | |
288 @section td-enclosure/tr-enclosure | |
289 If you wan to convert series of field into <td>...</td> repetitions for | |
290 table element, td-enclosure or tr-enclosure is convenient. | |
291 | |
292 @table @kbd | |
223 | 293 @item [prefix] @} |
158 | 294 @dots{} Enclose each field in a region into <td>...</td>'s. |
295 @item [prefix] ] | |
296 @dots{} Enclose each line in a region into <tr>...</tr>'s, with | |
297 every line converted to <td>...</td> repetition. | |
298 @end table | |
299 They presume white space as field separator by default. | |
300 To change this, enter other delimiting character for a query. | |
301 You can convert CSV, for example, into table by specifying | |
302 comma(,) as a delimiter. | |
303 | |
304 If you want to enclose fields with th, call with | |
305 universal-argument (@kbd{C-u}). Enter `th' to enclose fields | |
306 with <th>...</th>. The special answer `thd' means that | |
307 enclose the only first column with th, and the rest with td. | |
308 | |
70 | 309 @node CSS Support, Customizations, Changing and Deleting, Top |
310 @comment node-name, next, previous, up | |
311 @chapter CSS(Style Sheets) Support | |
312 | |
313 @menu | |
314 * CSS-class completion:: | |
315 * Reread CSS definition:: | |
316 @end menu | |
317 | |
318 @node CSS-class completion, Reread CSS definition, CSS Support, CSS Support | |
319 @comment node-name, next, previous, up | |
320 @section CSS class-name completion | |
321 You can input a class name in your CSS definition with completion. | |
322 If you have CSS defined as below; | |
323 | |
324 @display | |
325 h1.foo, h2.foo @{ background-color: 0xffffff; @} | |
326 h1.bar, h2.bar @{ font-size: 120%; @} | |
327 @end display | |
328 | |
329 when you input h1(or h2) tag with completing-read by [prefix] b or | |
330 [prefix] l, yahtml prompts you to input class name with completion from | |
265
0b10d1fea265
Fix many misuse of braces and so on.
HIROSE Yuuji <yuuji@gentei.org>
parents:
223
diff
changeset
|
331 the words which are effective to h1 or h2. And if you defined |
70 | 332 global class like this; |
333 | |
334 @display | |
335 .caution @{ font-size: 120%; background-color: 0xc00000;@} | |
336 @end display | |
337 | |
338 when you input any tags via completing-read, yahtml prompts you to input | |
339 class name. If this is bothering, typing @kbd{C-j} instead of | |
340 @kbd{RET} (or @kbd{C-m}) cancels the next prompt to class name completion. | |
341 | |
342 @node Reread CSS definition, , CSS-class completion, CSS Support | |
343 @comment node-name, next, previous, up | |
344 @section Re-reading CSS definition | |
345 If you add some class to your CSS file and you want yahtml to load | |
346 new definitions, type @kbd{M-x yahtml-mode RET} to make yahtml do. | |
347 | |
348 @node Customizations, Copying, CSS Support, Top | |
349 @comment node-name, next, previous, up | |
350 @chapter Customizations | |
351 @cindex Customize | |
352 @cindex Key Assign | |
353 | |
354 Variables that modify yahtml's behavior. | |
355 | |
356 @menu | |
357 * All customizable variables:: List of customizable variables | |
358 * Hook variables:: hook variables | |
359 @end menu | |
360 | |
361 @node All customizable variables, Hook variables, Customizations, Customizations | |
362 @comment node-name, next, previous, up | |
363 @section List of customizable variables. Defaults in parenthesis | |
364 | |
365 @defvar yahtml-prefix | |
366 Prefix key for yahtml-mode. (@kbd{\C-c}) | |
367 @end defvar | |
368 | |
369 @defvar yahtml-image-viewer | |
370 Command to view image files refered by img. (xv) | |
371 @end defvar | |
372 | |
373 @defvar yahtml-www-browser | |
374 Browser to view external pages with @kbd{[prefix]g}. (netscape) | |
375 @end defvar | |
376 | |
377 @defvar yahtml-kanji-code | |
118 | 378 Default kanji code. 1=sjis, 2=jis, 3=euc, 4=utf-8 (2) |
70 | 379 If |
380 @quotation | |
381 AddType "text/html; charset=xxx" .html | |
382 @end quotation | |
383 is written in .htaccess, this will override yahtml-kanji-code. | |
384 @end defvar | |
385 | |
386 @defvar yahtml-fill-column | |
387 Columns to auto-fill (72) | |
388 @end defvar | |
389 | |
390 @defvar yahtml-fill-prefix | |
391 fill-prefix specific to yahtml-mode. (@code{nil}) | |
392 @end defvar | |
393 | |
394 @defvar yahtml-path-url-alist | |
395 Matching list of URL and full path name on OS's file system. | |
396 @end defvar | |
397 | |
398 @defvar yahtml-directory-index | |
399 Default index filed opened when accessing a server without a filename, | |
400 usually index.html. (@code{"index.html"}) | |
401 @end defvar | |
402 | |
403 @defvar yahtml-lint-program | |
404 HTML syntax check program. (@code{"jweblint"}) | |
405 @end defvar | |
406 | |
407 @defvar yahtml-hate-too-deep-indentation | |
408 setq to t when indentations for nested enumerate elements are too deep. | |
409 (@code{nil}) | |
410 @end defvar | |
411 | |
412 @defvar yahtml-always-/p | |
413 setq to t if you always want @code{</p>} after @code{</p>}. @code{nil} | |
414 @end defvar | |
415 | |
416 @defvar yahtml-p-prefered-env-regexp | |
75 | 417 Elements that @code{<p>} will be automatically inserted. |
418 (@code{"^\\(body\\|dl\\|blockquote\\)"}) | |
70 | 419 @end defvar |
420 | |
421 @defvar yahtml-template-file | |
422 File to automatically insert when editing a new HTML file. | |
423 @file{"~/http/template.html"} | |
424 @end defvar | |
425 | |
426 @defvar yahtml-prefer-upcases | |
427 Use uppercase for tags. @code{nil} | |
428 @end defvar | |
429 | |
430 @defvar yahtml-prefer-upcase-attributes | |
431 Use uppercase for attributes. @code{nil} | |
432 @end defvar | |
433 | |
434 @defvar yahtml-server-type | |
435 setq to 'apache if using a Apache server, and will refer ./.htaccess. | |
436 @code{'apache} | |
437 @end defvar | |
438 | |
439 @defvar yahtml-apache-access-file | |
440 When @code{yahtml-server-type} is @code{'apache}, define name of access | |
441 restriction file. @file{".htaccess"} | |
442 @end defvar | |
443 | |
444 @defvar yahtml-shell-command-option | |
445 Options needed to invoke shell commands. | |
446 @end defvar | |
447 | |
448 @defvar yahtml-translate-hyphens-when-comment-region | |
449 Whether to change hyphens to @code{-} when commenting out region. | |
450 (@code{t}) | |
451 @end defvar | |
452 | |
453 @defvar yahtml-entity-reference-chars-alist | |
454 alist of characters that needs to be written by Entity Reference. Enter | |
455 as @code{'(?char . "EntityReference")}. By default, @code{<}, @code{>}, | |
456 @code{&}, @code{'}, is set. Add as needed. Do not include @code{&} at | |
457 beginning and @code{;} at end of cdr portion of @code{"EntityReference"}. | |
458 @end defvar | |
459 | |
460 @defvar yahtml-faithful-to-htmllint | |
461 When using htmllint to check syntax, it will complain about excess spaces. | |
462 setq to @code{t} to avoid this. | |
463 @end defvar | |
464 | |
72 | 465 @defvar yahtml-use-css |
466 Use style-sheet support or not (@code{t}) | |
467 @end defvar | |
468 | |
469 @defvar yahtml-image-inspection-bytes | |
470 Number of bytes to inspect the image for geometry information (@code{10000}) | |
471 @end defvar | |
472 | |
473 @defvar yahtml:img-default-alt-format | |
474 format of img entity's ALT attributes. | |
475 %x: width, %y: height, %s: size in bytes, %c: first comment string, | |
476 %f: filename (@code{"%xx%y(%sbytes)"}) | |
477 @end defvar | |
478 | |
479 @defvar yahtml-escape-chars | |
480 When, completing href-s, Escape reserved characters to URL-encoding or not. | |
481 Nil for never, t for everytime, and 'ask for inquiring | |
482 at each reserved chars. (@code{'ask}) | |
483 @end defvar | |
484 | |
485 @defvar yahtml-use-font-lock | |
486 Use font-lock to fontify buffer or not | |
487 (@code{(featurep 'font-lock)}) | |
488 @end defvar | |
489 | |
75 | 490 @defvar yahtml-use-hilit19 |
72 | 491 Use hilit19 to highlight buffer or not |
492 (@code{(featurep 'hilit19)}) | |
493 @end defvar | |
494 | |
75 | 495 @defvar yahtml-indentation-boundary |
496 Boundary regexp for indentation calculation. | |
497 (@code{"^\\s *<h[1-3]>"}) | |
498 @end defvar | |
70 | 499 |
500 @node Hook variables, , All customizable variables, Customizations | |
501 @comment node-name, next, previous, up | |
502 @section hook variables | |
503 | |
504 | |
505 @node Copying, Concept Index, Customizations, Top | |
506 @comment node-name, next, previous, up | |
507 @chapter Copying | |
508 | |
509 This program is distributed as freesoftware. The author will take no | |
510 responsibility to any damages due to the usage of this software | |
511 whatsoever. There are no restrictions to its redistribution, just use | |
512 common sense. Mail me your thoughts on this program and I will be more | |
513 than willing to help. | |
514 | |
515 Complaints, requests, bug reports and comments are welcome. Make contacts | |
72 | 516 to yuuji@@yatex.org$B!!(B(as of December 2000) |
70 | 517 |
518 If you like this program and use it on a regular basis, please join the | |
519 mailing list "fj Wild Bird Society". Procedures can be found in the "etc" | |
72 | 520 section of @file{docs/htmlqa.eng} in this package. |
70 | 521 |
522 | |
523 @flushright | |
524 HIROSE, Yuuji | |
525 @end flushright | |
526 | |
527 | |
528 @node Concept Index, , Copying, Top | |
529 @comment node-name, next, previous, up | |
530 @unnumbered Index | |
531 @printindex cp | |
532 | |
533 | |
534 @contents | |
535 | |
536 @bye | |
537 | |
538 @c Local Variables: | |
539 @c fill-column: 74 | |
540 @c fill-prefix: nil | |
541 @c End: | |
542 | |
543 Tag table: | |
544 | |
545 End tag table |