yatex

view docs/yahtmle.tex @ 271:d467c0fb6083

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