yatex

view docs/yahtmle.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{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 Fri Nov 20 07:20:56 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 // yahtml //
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:: 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 @end menu
235 @node Changing tags in pairs, Changing entities, Changing and Deleting, Changing and Deleting
236 @comment node-name, next, previous, up
237 @section Changing tags in pairs
238 By using
240 @table @kbd
241 @item [prefix] c
242 @dots{} change tags in matching pairs
243 @end table
245 @noindent
246 the content can be changed according to the context of the HTML document
247 where the cursor is located.
249 @itemize @bullet
250 @item @code{<TAG>}$B!A(B@code{</TAG>}
251 @dots{} change @code{TAG} element name
252 @item attributes such as @code{<img src="image.file" alt="photo">}
253 @dots{} change attributes
254 @end itemize
256 @node Changing entities, URLencoding of strings within region, Changing tags in pairs, Changing and Deleting
257 @comment node-name, next, previous, up
258 @section Changing entities
259 Special characters such as < or > must be written as &lt; and &gt;. Easy
260 conversion of these characters can be done when importing text from non
261 HTML files.
264 @table @kbd
265 @item [prefix] ;
266 @dots{} convert char to special entity in marked region
267 @item [prefix] :
268 @dots{} convert special entity to original char in marked region
269 (reverse of [prefix] ;)
270 @end table
273 @node URLencoding of strings within region, , Changing entities, Changing and Deleting
274 @comment node-name, next, previous, up
275 @section URLencoding of strings within region
277 @table @kbd
278 @item [prefix] #
279 @dots{} encode chars that needs to be URLencoded within region
280 @end table
282 @node CSS Support, Customizations, Changing and Deleting, Top
283 @comment node-name, next, previous, up
284 @chapter CSS(Style Sheets) Support
286 @menu
287 * CSS-class completion::
288 * Reread CSS definition::
289 @end menu
291 @node CSS-class completion, Reread CSS definition, CSS Support, CSS Support
292 @comment node-name, next, previous, up
293 @section CSS class-name completion
294 You can input a class name in your CSS definition with completion.
295 If you have CSS defined as below;
297 @display
298 h1.foo, h2.foo @{ background-color: 0xffffff; @}
299 h1.bar, h2.bar @{ font-size: 120%; @}
300 @end display
302 when you input h1(or h2) tag with completing-read by [prefix] b or
303 [prefix] l, yahtml prompts you to input class name with completion from
304 the words which are effective to h1 or h2. And if you defined
305 global class like this;
307 @display
308 .caution @{ font-size: 120%; background-color: 0xc00000;@}
309 @end display
311 when you input any tags via completing-read, yahtml prompts you to input
312 class name. If this is bothering, typing @kbd{C-j} instead of
313 @kbd{RET} (or @kbd{C-m}) cancels the next prompt to class name completion.
315 @node Reread CSS definition, , CSS-class completion, CSS Support
316 @comment node-name, next, previous, up
317 @section Re-reading CSS definition
318 If you add some class to your CSS file and you want yahtml to load
319 new definitions, type @kbd{M-x yahtml-mode RET} to make yahtml do.
321 @node Customizations, Copying, CSS Support, Top
322 @comment node-name, next, previous, up
323 @chapter Customizations
324 @cindex Customize
325 @cindex Key Assign
327 Variables that modify yahtml's behavior.
329 @menu
330 * All customizable variables:: List of customizable variables
331 * Hook variables:: hook variables
332 @end menu
334 @node All customizable variables, Hook variables, Customizations, Customizations
335 @comment node-name, next, previous, up
336 @section List of customizable variables. Defaults in parenthesis
338 @defvar yahtml-prefix
339 Prefix key for yahtml-mode. (@kbd{\C-c})
340 @end defvar
342 @defvar yahtml-image-viewer
343 Command to view image files refered by img. (xv)
344 @end defvar
346 @defvar yahtml-www-browser
347 Browser to view external pages with @kbd{[prefix]g}. (netscape)
348 @end defvar
350 @defvar yahtml-kanji-code
351 Default kanji code. 1=sjis, 2=jis, 3=euc, 4=utf-8 (2)
352 If
353 @quotation
354 AddType "text/html; charset=xxx" .html
355 @end quotation
356 is written in .htaccess, this will override yahtml-kanji-code.
357 @end defvar
359 @defvar yahtml-fill-column
360 Columns to auto-fill (72)
361 @end defvar
363 @defvar yahtml-fill-prefix
364 fill-prefix specific to yahtml-mode. (@code{nil})
365 @end defvar
367 @defvar yahtml-path-url-alist
368 Matching list of URL and full path name on OS's file system.
369 @end defvar
371 @defvar yahtml-directory-index
372 Default index filed opened when accessing a server without a filename,
373 usually index.html. (@code{"index.html"})
374 @end defvar
376 @defvar yahtml-lint-program
377 HTML syntax check program. (@code{"jweblint"})
378 @end defvar
380 @defvar yahtml-hate-too-deep-indentation
381 setq to t when indentations for nested enumerate elements are too deep.
382 (@code{nil})
383 @end defvar
385 @defvar yahtml-always-/p
386 setq to t if you always want @code{</p>} after @code{</p>}. @code{nil}
387 @end defvar
389 @defvar yahtml-p-prefered-env-regexp
390 Elements that @code{<p>} will be automatically inserted.
391 (@code{"^\\(body\\|dl\\|blockquote\\)"})
392 @end defvar
394 @defvar yahtml-template-file
395 File to automatically insert when editing a new HTML file.
396 @file{"~/http/template.html"}
397 @end defvar
399 @defvar yahtml-prefer-upcases
400 Use uppercase for tags. @code{nil}
401 @end defvar
403 @defvar yahtml-prefer-upcase-attributes
404 Use uppercase for attributes. @code{nil}
405 @end defvar
407 @defvar yahtml-server-type
408 setq to 'apache if using a Apache server, and will refer ./.htaccess.
409 @code{'apache}
410 @end defvar
412 @defvar yahtml-apache-access-file
413 When @code{yahtml-server-type} is @code{'apache}, define name of access
414 restriction file. @file{".htaccess"}
415 @end defvar
417 @defvar yahtml-shell-command-option
418 Options needed to invoke shell commands.
419 @end defvar
421 @defvar yahtml-translate-hyphens-when-comment-region
422 Whether to change hyphens to @code{&#45;} when commenting out region.
423 (@code{t})
424 @end defvar
426 @defvar yahtml-entity-reference-chars-alist
427 alist of characters that needs to be written by Entity Reference. Enter
428 as @code{'(?char . "EntityReference")}. By default, @code{<}, @code{>},
429 @code{&}, @code{'}, is set. Add as needed. Do not include @code{&} at
430 beginning and @code{;} at end of cdr portion of @code{"EntityReference"}.
431 @end defvar
433 @defvar yahtml-faithful-to-htmllint
434 When using htmllint to check syntax, it will complain about excess spaces.
435 setq to @code{t} to avoid this.
436 @end defvar
438 @defvar yahtml-use-css
439 Use style-sheet support or not (@code{t})
440 @end defvar
442 @defvar yahtml-image-inspection-bytes
443 Number of bytes to inspect the image for geometry information (@code{10000})
444 @end defvar
446 @defvar yahtml:img-default-alt-format
447 format of img entity's ALT attributes.
448 %x: width, %y: height, %s: size in bytes, %c: first comment string,
449 %f: filename (@code{"%xx%y(%sbytes)"})
450 @end defvar
452 @defvar yahtml-escape-chars
453 When, completing href-s, Escape reserved characters to URL-encoding or not.
454 Nil for never, t for everytime, and 'ask for inquiring
455 at each reserved chars. (@code{'ask})
456 @end defvar
458 @defvar yahtml-use-font-lock
459 Use font-lock to fontify buffer or not
460 (@code{(featurep 'font-lock)})
461 @end defvar
463 @defvar yahtml-use-hilit19
464 Use hilit19 to highlight buffer or not
465 (@code{(featurep 'hilit19)})
466 @end defvar
468 @defvar yahtml-indentation-boundary
469 Boundary regexp for indentation calculation.
470 (@code{"^\\s *<h[1-3]>"})
471 @end defvar
473 @node Hook variables, , All customizable variables, Customizations
474 @comment node-name, next, previous, up
475 @section hook variables
478 @node Copying, Concept Index, Customizations, Top
479 @comment node-name, next, previous, up
480 @chapter Copying
482 This program is distributed as freesoftware. The author will take no
483 responsibility to any damages due to the usage of this software
484 whatsoever. There are no restrictions to its redistribution, just use
485 common sense. Mail me your thoughts on this program and I will be more
486 than willing to help.
488 Complaints, requests, bug reports and comments are welcome. Make contacts
489 to yuuji@@yatex.org$B!!(B(as of December 2000)
491 If you like this program and use it on a regular basis, please join the
492 mailing list "fj Wild Bird Society". Procedures can be found in the "etc"
493 section of @file{docs/htmlqa.eng} in this package.
496 @flushright
497 HIROSE, Yuuji
498 @end flushright
501 @node Concept Index, , Copying, Top
502 @comment node-name, next, previous, up
503 @unnumbered Index
504 @printindex cp
507 @contents
509 @bye
511 @c Local Variables:
512 @c fill-column: 74
513 @c fill-prefix: nil
514 @c End:
515 
516 Tag table:
517 
518 End tag table