yatex

view docs/yahtmle.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{eng} % -*- texinfo -*- for Texinfo V.3.1
2 \input texinfo
3 @setfilename yahtmle
4 @settitle Yet Another html-mode for Emacs
5 @direntry
6 * yahtml-e: (yahtmle). Yet Another html-mode for Emacs (English).
7 @end direntry
9 @iftex
10 @c @syncodeindex fn cp
11 @c Last modified Fri May 11 15:42:22 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 // yahtml //
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:: 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
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
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.
53 (This Info is still incomplete)
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
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
69 Add the following to @file{~/.emacs}
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
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},
81 @lisp
82 (setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path))
83 @end lisp
85 @noindent
86 is what you add.
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
90 occurred.
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
96 Check the variables for invoking external commands and modify as needed.
97 Defaults are in parenthesis.
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
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
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
121 CERN types.
122 @end table
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
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
134 Any number of additions can be made to this list.
136 @node Command Invocation, Completion, Installation, Top
137 @comment node-name, next, previous, up
138 @chapter Invoking external commands
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
150 @node Completion, Jump, Command Invocation, Top
151 @comment node-name, next, previous, up
152 @chapter Completion Input
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.
162 @table @kbd
163 @item [prefix] b (YaTeX begin-type completion)
164 @dots{}
165 @example
166 <ul>
167 </ul>
168 @end example
170 @noindent
171 Completion for elements that the start tag and the end tag span multiple
172 lines. Mostly block-level elements.
174 @item [prefix] s (YateX section-type completion)
175 @dots{}
176 @example
177 <img src="foo.gif" alt="photo">
178 @end example
180 @noindent
181 Completion for elements that do not have end tags and require only
182 attributes. Possible completions are, <img>, <input>.
184 @item [prefix] l (YaTeX large-type completion)
185 @dots{}
187 @example
188 <big> $B!A(B </big>
189 @end example
191 @noindent
192 Similar to begin-type completion but used for elements that start and end
193 on a single line.
196 @item [prefix] m (YaTeX maketitle-type completion)
197 @dots{} Completion for elements without attributes or contents. Possible
198 completion is <br>
200 @item [prefix] a (YaTeX accent completion)
201 @dots{} Used to enter special or symbol entities. By default completion
202 for < (&lt;), > (&gt;), & (&amp;), " (&quot;), ' (&apos;), blank (&nbsp;)
203 is possible.
204 @end table
206 @node Jump, Changing and Deleting, Completion, Top
207 @comment node-name, next, previous, up
208 @chapter Cursor Movement
209 By using
211 @table @kbd
212 @item [prefix] g
213 @dots{} move to corresponding object
214 @end table
216 @noindent
217 the cursor will go to the corresponding object according to the context.
218 Recognized contexts are
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
225 @c @item @code{\include(\input)} $B"*(B $BBP1~$9$k%U%!%$%k(B
226 @end itemize
228 @node Changing and Deleting, CSS Support, Jump, Top
229 @comment node-name, next, previous, up
230 @chapter Changing and Deleting
232 @menu
233 * Changing tags in pairs::
234 * Changing entities::
235 * URLencoding of strings within region::
236 * td-enclosure/tr-enclosure::
237 @end menu
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
244 @table @kbd
245 @item [prefix] c
246 @dots{} change tags in matching pairs
247 @end table
249 @noindent
250 the content can be changed according to the context of the HTML document
251 where the cursor is located.
253 @itemize @bullet
254 @item @code{<TAG>}$B!A(B@code{</TAG>}
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
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 &lt; and &gt;. Easy
264 conversion of these characters can be done when importing text from non
265 HTML files.
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
277 @node URLencoding of strings within region, td-enclosure/tr-enclosure, Changing entities, Changing and Deleting
278 @comment node-name, next, previous, up
279 @section URLencoding of strings within region
281 @table @kbd
282 @item [prefix] #
283 @dots{} encode chars that needs to be URLencoded within region
284 @end table
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.
292 @table @kbd
293 @item [prefix] @}
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.
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.
309 @node CSS Support, Customizations, Changing and Deleting, Top
310 @comment node-name, next, previous, up
311 @chapter CSS(Style Sheets) Support
313 @menu
314 * CSS-class completion::
315 * Reread CSS definition::
316 @end menu
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;
324 @display
325 h1.foo, h2.foo @{ background-color: 0xffffff; @}
326 h1.bar, h2.bar @{ font-size: 120%; @}
327 @end display
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
331 the words which are effective to h1 or h2. And if you defined
332 global class like this;
334 @display
335 .caution @{ font-size: 120%; background-color: 0xc00000;@}
336 @end display
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.
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.
348 @node Customizations, Copying, CSS Support, Top
349 @comment node-name, next, previous, up
350 @chapter Customizations
351 @cindex Customize
352 @cindex Key Assign
354 Variables that modify yahtml's behavior.
356 @menu
357 * All customizable variables:: List of customizable variables
358 * Hook variables:: hook variables
359 @end menu
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
365 @defvar yahtml-prefix
366 Prefix key for yahtml-mode. (@kbd{\C-c})
367 @end defvar
369 @defvar yahtml-image-viewer
370 Command to view image files refered by img. (xv)
371 @end defvar
373 @defvar yahtml-www-browser
374 Browser to view external pages with @kbd{[prefix]g}. (netscape)
375 @end defvar
377 @defvar yahtml-kanji-code
378 Default kanji code. 1=sjis, 2=jis, 3=euc, 4=utf-8 (2)
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
386 @defvar yahtml-fill-column
387 Columns to auto-fill (72)
388 @end defvar
390 @defvar yahtml-fill-prefix
391 fill-prefix specific to yahtml-mode. (@code{nil})
392 @end defvar
394 @defvar yahtml-path-url-alist
395 Matching list of URL and full path name on OS's file system.
396 @end defvar
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
403 @defvar yahtml-lint-program
404 HTML syntax check program. (@code{"jweblint"})
405 @end defvar
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
412 @defvar yahtml-always-/p
413 setq to t if you always want @code{</p>} after @code{</p>}. @code{nil}
414 @end defvar
416 @defvar yahtml-p-prefered-env-regexp
417 Elements that @code{<p>} will be automatically inserted.
418 (@code{"^\\(body\\|dl\\|blockquote\\)"})
419 @end defvar
421 @defvar yahtml-template-file
422 File to automatically insert when editing a new HTML file.
423 @file{"~/http/template.html"}
424 @end defvar
426 @defvar yahtml-prefer-upcases
427 Use uppercase for tags. @code{nil}
428 @end defvar
430 @defvar yahtml-prefer-upcase-attributes
431 Use uppercase for attributes. @code{nil}
432 @end defvar
434 @defvar yahtml-server-type
435 setq to 'apache if using a Apache server, and will refer ./.htaccess.
436 @code{'apache}
437 @end defvar
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
444 @defvar yahtml-shell-command-option
445 Options needed to invoke shell commands.
446 @end defvar
448 @defvar yahtml-translate-hyphens-when-comment-region
449 Whether to change hyphens to @code{&#45;} when commenting out region.
450 (@code{t})
451 @end defvar
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
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
465 @defvar yahtml-use-css
466 Use style-sheet support or not (@code{t})
467 @end defvar
469 @defvar yahtml-image-inspection-bytes
470 Number of bytes to inspect the image for geometry information (@code{10000})
471 @end defvar
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
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
485 @defvar yahtml-use-font-lock
486 Use font-lock to fontify buffer or not
487 (@code{(featurep 'font-lock)})
488 @end defvar
490 @defvar yahtml-use-hilit19
491 Use hilit19 to highlight buffer or not
492 (@code{(featurep 'hilit19)})
493 @end defvar
495 @defvar yahtml-indentation-boundary
496 Boundary regexp for indentation calculation.
497 (@code{"^\\s *<h[1-3]>"})
498 @end defvar
500 @node Hook variables, , All customizable variables, Customizations
501 @comment node-name, next, previous, up
502 @section hook variables
505 @node Copying, Concept Index, Customizations, Top
506 @comment node-name, next, previous, up
507 @chapter Copying
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.
515 Complaints, requests, bug reports and comments are welcome. Make contacts
516 to yuuji@@yatex.org$B!!(B(as of December 2000)
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"
520 section of @file{docs/htmlqa.eng} in this package.
523 @flushright
524 HIROSE, Yuuji
525 @end flushright
528 @node Concept Index, , Copying, Top
529 @comment node-name, next, previous, up
530 @unnumbered Index
531 @printindex cp
534 @contents
536 @bye
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