aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Dasmohapatra2013-01-04 01:38:18 -0800
committerGlenn Morris2013-01-04 01:38:18 -0800
commit7fca93e239d479eb24bfbf043c8aa76d34d8879c (patch)
treea451d3700c8d7b81f39969f6d2407399e55d7585
parent4240dd3cef858e4431bb349925c755d793c560b3 (diff)
downloademacs-7fca93e239d479eb24bfbf043c8aa76d34d8879c.tar.gz
emacs-7fca93e239d479eb24bfbf043c8aa76d34d8879c.zip
Import the htmlfontify manual
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/htmlfontify.texi2004
2 files changed, 2008 insertions, 0 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index fb3bfc9a03f..fe1d81e77e2 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12013-01-04 Vivek Dasmohapatra <vivek@etla.org>
2
3 * htmlfontify.texi: New file.
4
12012-12-22 Glenn Morris <rgm@gnu.org> 52012-12-22 Glenn Morris <rgm@gnu.org>
2 6
3 * viper.texi (Rudimentary Changes, Key Bindings, Key Bindings): 7 * viper.texi (Rudimentary Changes, Key Bindings, Key Bindings):
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi
new file mode 100644
index 00000000000..03a849fab2c
--- /dev/null
+++ b/doc/misc/htmlfontify.texi
@@ -0,0 +1,2004 @@
1\input texinfo
2@c documentation for htmlfontify
3@c written by Vivek Dasmohapatra
4
5@comment %**start of header (This is for running Texinfo on a region.)
6
7@setfilename htmlfontify.info
8@settitle Htmlfontify User Manual
9
10@dircategory Emacs
11@direntry
12* Htmlfontify: (htmlfontify). A source code -> linked html + css transformer
13@end direntry
14
15@exampleindent 2
16@comment %**end of header (This is for running Texinfo on a region.)
17
18@ifinfo
19
20This file documents Htmlfontify, a source code -> crosslinked + formatted +
21syntax colourised html transformer.
22
23Copyright (c) 2002,2003 Vivek Dasmohapatra <vivek@@etla.org>
24
25Permission is granted to copy, distribute and/or modify this
26document under the terms of the GNU Free Documentation Licence,
27Version 1.1 or any later version published by the Free Software
28Foundation; with no Invariant Sections, no Front-Cover Texts and
29no Back-Cover Texts. A copy of the licence is included in the
30section entitled "GNU Free Documentation Licence".
31
32@end ifinfo
33
34@titlepage
35@title Htmlfontify User Manual
36@sp 4
37@subtitle Htmlfontify version 0.20
38@sp 1
39@subtitle Jun 2002
40@sp 5
41@author Vivek Dasmohapatra
42@page
43
44@vskip 0pt plus 1filll
45@noindent
46Copyright @copyright{} 2002 Vivek Dasmohapatra <vivek@@etla.org>
47
48Permission is granted to copy, distribute and/or modify this document
49under the terms of the GNU Free Documentation Licence, Version 1.1 or
50any later version published by the Free Software Foundation; with no
51Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A
52copy of the licence is included in the section entitled "GNU Free
53Documentation Licence".
54
55@end titlepage
56@page
57
58@node Top, Introduction, (dir), (dir)
59
60@menu
61* Introduction:: About Htmlfontify.
62* Usage & Examples:: How to use Htmlfontify.
63* Customisation:: Fine tuning Htmlfontify's behaviour.
64* Requirements:: External programs used by Htmlfontify.
65* Index:: Index of Contents.
66* COPYING:: The GNU Free Documentation Licence.
67@end menu
68
69@node Introduction, Usage & Examples, Top, Top
70@chapter Introduction
71@cindex Introduction
72
73Htmlfontify provides a means of converting individual emacs buffers,
74source files, or entire source trees to html, preserving formatting
75and emacs colourisation / syntax highlighting as much as possible
76through careful application of CSS stylesheets and html tags.
77
78It can also turn instances of functions, methods and ( for some
79languages ) variables and other constructs and items into links
80to their definitions, and create an index file ( or files ) of
81all such symbols, also linked to their points of definition.
82
83Htmlfontify also provides several customisation items, which should
84allow it to mesh more-or-less seamlessly with various templating or
85publishing systems ( in the event, for instance, that you don't want
86to produce the html pages directly ).
87
88@node Usage & Examples, Customisation, Introduction, Top
89@chapter Usage & Examples
90@cindex Usage & Examples
91
92Htmlfontify can be used both interactively and as part of another
93elisp function. If you're running it in emacs21 ( its native land,
94it were ), it will also run when attached to a terminal ( ie w/o X )
95or even when in batch mode.
96
97@menu
98* Interactive:: Using htmlfontify interactively.
99* Non-interactive:: Using htmlfontify from elisp.
100* Variables:: Variables (other than customisation entries).
101* Data Structures:: Important Data Structures.
102* Examples:: Example(s) of htmlfontify in use.
103@end menu
104
105@node Interactive, Non-interactive, , Usage & Examples
106@section Interactive
107@cindex Interactive
108@cindex functions (interactive)
109
110Htmlfontify provides the following interactive functions:
111
112@table @code
113@item htmlfontify-buffer
114@findex htmlfontify-buffer
115@anchor{htmlfontify-buffer}
116
117@lisp
118
119(htmlfontify-buffer &optional @var{srcdir} @var{file})
120@end lisp
121
122Create a new buffer, named for the current buffer + a .html extension,
123containing an inline css-stylesheet and formatted css-markup html that
124reproduces the look of the current emacs buffer as closely as possible.
125
126``Dangerous'' characters in the existing buffer are turned into html
127entities, so you should even be able to do html-within-html fontified
128display.
129
130You should, however, note that random control or eight-bit characters
131such as ^L (\x0c) or ¤ (\xa4) won't get mapped yet.
132
133If the @var{srcdir} and @var{file} arguments are set, lookup etags
134derived entries in the @ref{hfy-tags-cache} and add html anchors
135and hyperlinks as appropriate.
136
137@item htmlfontify-run-etags
138@findex htmlfontify-run-etags
139@anchor{htmlfontify-run-etags}
140
141@lisp
142
143(htmlfontify-run-etags @var{srcdir})
144@end lisp
145
146Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}.
147
148@item htmlfontify-copy-and-link-dir
149@findex htmlfontify-copy-and-link-dir
150@anchor{htmlfontify-copy-and-link-dir}
151
152@lisp
153
154(htmlfontify-copy-and-link-dir @var{srcdir} @var{dstdir} &optional @var{f-ext} @var{l-ext})
155@end lisp
156
157Trawl @var{srcdir} and write fontified-and-hyperlinked output in
158@var{dstdir} @var{f-ext} and @var{l-ext} specify values for
159@ref{hfy-extn} and @ref{hfy-link-extn}.
160
161You may also want to set @ref{hfy-page-header} and @ref{hfy-page-footer}.
162
163@item htmlfontify-load-rgb-file
164@findex htmlfontify-load-rgb-file
165@anchor{htmlfontify-load-rgb-file}
166
167@lisp
168
169(htmlfontify-load-rgb-file &optional @var{file})
170@end lisp
171
172Load an X11 style rgb.txt file (search @code{hfy-rgb-load-path} if
173@var{file} is not specified).
174
175Note that this is not necessary if all you want is the standard X11
176(XFree86 4.1.0) colour name -> rgb triplet mapping, htmlfontify has
177a copy built in, for use when it cannot contact an X server.
178
179Loads the variable @code{hfy-rgb-txt-colour-map}, which is used by
180@ref{hfy-fallback-colour-values}.
181
182@item htmlfontify-unload-rgb-file
183@findex htmlfontify-unload-rgb-file
184@anchor{htmlfontify-unload-rgb-file}
185
186@lisp
187
188(htmlfontify-unload-rgb-file)
189@end lisp
190
191Unload the currently loaded X11 style rgb.txt file ( if any ).
192@end table
193
194@node Non-interactive, Variables, Interactive, Usage & Examples
195@section Non-interactive
196@cindex Noninteractive
197@cindex functions (noninteractive)
198
199In addition to the aforementioned interactive methods, htmlfontify
200provides the following non-interactive ones:
201
202@table @code
203@comment AUTOGENERATED BLOCK
204
205@item hfy-face-to-style
206@findex hfy-face-to-style
207@anchor{hfy-face-to-style}
208
209@lisp
210
211(hfy-face-to-style @var{fn})
212@end lisp
213
214Take @var{fn}, a font or @code{defface} style font specification,
215(as returned by @code{face-attr-construct} or @ref{hfy-face-attr-for-class})
216and return a @ref{hfy-style-assoc}.
217
218See also: @ref{hfy-face-to-style-i}, @ref{hfy-flatten-style}.
219
220@item hfy-fallback-colour-values
221@findex hfy-fallback-colour-values
222@anchor{hfy-fallback-colour-values}
223
224@lisp
225
226(hfy-fallback-colour-values @var{colour-string})
227@end lisp
228
229Use a fallback method for obtaining the rgb values for a colour.
230If @ref{htmlfontify-load-rgb-file} has been called, it uses the
231colour map specified, otherwise it uses htmlfontify's built in map.
232
233@item hfy-combined-face-spec
234@findex hfy-combined-face-spec
235@anchor{hfy-combined-face-spec}
236
237@lisp
238
239(hfy-combined-face-spec @var{face})
240@end lisp
241
242Return a @code{defface} style alist of possible specifications for
243@var{face}, with any entries resulting from user customisation
244(@code{custom-set-faces}) taking precedence.
245
246See also: @ref{hfy-default-face-def}
247
248@item hfy-word-regex
249@findex hfy-word-regex
250@anchor{hfy-word-regex}
251
252@lisp
253
254(hfy-word-regex @var{string})
255@end lisp
256
257Return a regex that matches @var{string} as the first @code{match-string},
258with non word characters on either side (vaguely emulating the perl @code{\b}
259regex atom).
260
261@item hfy-force-fontification
262@findex hfy-force-fontification
263@anchor{hfy-force-fontification}
264
265@lisp
266
267(hfy-force-fontification)
268@end lisp
269
270Emacs' fontification is designed for interactive use. As such, it sometimes
271does things like deferring fontification until a section of the buffer is
272exposed and rendered, or until emacs is idle for a while. Sometimes, in
273non-interactive circumstances, or if it can't see X, it doesn't bother
274with some of the harder stuff. While this is all great from the perspective
275of a user waiting for emacs to load a 20000 line file and colourise it,
276it's a pain from the point of view from non-interactive code. This function
277lies, cheats, steals and generally bullies emacs into fontifying a buffer
278from start to finish, with all the extra frills, whether it thinks it nneds
279to or not. Oh yes: it operates on the current buffer.
280
281@item hfy-link-style-string
282@findex hfy-link-style-string
283@anchor{hfy-link-style-string}
284
285@lisp
286
287(hfy-link-style-string @var{style-string})
288@end lisp
289
290Replace the end of a css style declaration @var{style-string} with the contents
291of the variable @ref{hfy-src-doc-link-style}, removing text matching the
292regex @ref{hfy-src-doc-link-unstyle} first, if necessary.
293
294
295@item hfy-prepare-index-i
296@findex hfy-prepare-index-i
297@anchor{hfy-prepare-index-i}
298
299@lisp
300
301(hfy-prepare-index-i @var{srcdir} @var{dstdir} @var{filename} &optional @var{stub} @var{map})
302@end lisp
303
304Prepare a tags index buffer for @var{srcdir}.
305@ref{hfy-tags-cache} must already have an entry for @var{srcdir} for
306this to work. @ref{hfy-page-header}, @ref{hfy-page-footer},
307@ref{hfy-link-extn} and @ref{hfy-extn} all play a part here.
308
309If @var{stub} is set, prepare an (appropriately named) index buffer
310specifically for entries beginning with @var{stub}.
311
312If @var{map} is set, use that instead of @ref{hfy-tags-cache}.
313
314@item hfy-compile-stylesheet
315@findex hfy-compile-stylesheet
316@anchor{hfy-compile-stylesheet}
317
318@lisp
319
320(hfy-compile-stylesheet)
321@end lisp
322
323Trawl the current buffer, construct and return a @ref{hfy-sheet-assoc}.
324
325@item hfy-css-name
326@findex hfy-css-name
327@anchor{hfy-css-name}
328
329@lisp
330
331(hfy-css-name @var{fn})
332@end lisp
333
334Strip some of the boring bits from a font-name and return a css style
335name. If @var{fn} is a @code{defface} attribute list, either construct
336a name for it, store it in the cache, and return it, or just fetch it
337from the cache if it's already there.
338
339@item hfy-make-directory
340@findex hfy-make-directory
341@anchor{hfy-make-directory}
342
343@lisp
344
345(hfy-make-directory @var{dir})
346@end lisp
347
348Approx equivalent of mkdir -p @var{dir}
349
350@item hfy-triplet
351@findex hfy-triplet
352@anchor{hfy-triplet}
353
354@lisp
355
356(hfy-triplet @var{colour})
357@end lisp
358
359Takes a colour name (string) and return a CSS rgb(R, G, B) triplet string.
360Uses the definition of "white" to map the numbers to the 0-255 range, so
361if you've redefined white, (esp if you've redefined it to have a triplet
362member lower than that of the colour you are processing, strange things
363may happen).
364
365@item hfy-default-footer
366@findex hfy-default-footer
367@anchor{hfy-default-footer}
368
369@lisp
370
371(hfy-default-footer @var{file})
372@end lisp
373
374Default value for @ref{hfy-page-footer}
375
376@item hfy-list-files
377@findex hfy-list-files
378@anchor{hfy-list-files}
379
380@lisp
381
382(hfy-list-files @var{directory})
383@end lisp
384
385Return a list of files under @var{directory}.
386Strips any leading "./" from each filename.
387
388@item hfy-colour-vals
389@findex hfy-colour-vals
390@anchor{hfy-colour-vals}
391
392@lisp
393
394(hfy-colour-vals @var{colour})
395@end lisp
396
397Where @var{colour} is a colour name or #XXXXXX style triplet, return a list of
3983 (16 bit) rgb values for said colour. If a window system is unavailable,
399calls @ref{hfy-fallback-colour-values}.
400
401@item hfy-href-stub
402@findex hfy-href-stub
403@anchor{hfy-href-stub}
404
405@lisp
406
407(hfy-href-stub @var{this-file} @var{def-files} @var{tag})
408@end lisp
409
410Return an href stub for a tag href: if @var{def-files} (list of files
411containing definitions for the tag in question) contains only one entry,
412the href should link straight to that file. Otherwise, the link should
413be to the index file.
414
415We are not yet concerned with the file extensions/tag line number and
416so on at this point.
417
418If @ref{hfy-split-index} is set, and the href wil be to an index file
419rather than a source file, append a .X to @ref{hfy-index-file}, where
420X is the uppercased first character of @var{tag}.
421
422See also: @ref{hfy-relstub}, @ref{hfy-index-file}.
423
424@item hfy-line-number
425@findex hfy-line-number
426@anchor{hfy-line-number}
427
428@lisp
429
430(hfy-line-number)
431@end lisp
432
433Returns the line number of the point in the current buffer.
434
435@item hfy-merge-adjacent-spans
436@findex hfy-merge-adjacent-spans
437@anchor{hfy-merge-adjacent-spans}
438
439@lisp
440
441(hfy-merge-adjacent-spans @var{face-map})
442@end lisp
443
444Where @var{face-map} is a @ref{hfy-facemap-assoc} for the current buffer,
445this function merges adjacent style blocks which are of the same value
446and are separated by nothing more interesting than whitespace.
447
448@code{<span class="foo">narf</span> <span class="foo">brain</span>}
449
450(as interpreted from @var{face-map}) would become:
451
452@code{<span class="foo">narf brain</span>}
453
454Returns a modified copy of @var{face-map} (also a @ref{hfy-facemap-assoc}).
455
456@item hfy-mark-tag-names
457@findex hfy-mark-tag-names
458@anchor{hfy-mark-tag-names}
459
460@lisp
461
462(hfy-mark-tag-names @var{srcdir} @var{file})
463@end lisp
464
465Mark tags in @var{file} (lookup @var{srcdir} in @ref{hfy-tags-cache}) with the
466'hfy-anchor property, with a value of "tag.line-number".
467
468@item hfy-weight
469@findex hfy-weight
470@anchor{hfy-weight}
471
472@lisp
473
474(hfy-weight @var{weight})
475@end lisp
476
477Derive a font-weight css specifier from an emacs weight spec symbol.
478
479@item hfy-size
480@findex hfy-size
481@anchor{hfy-size}
482
483@lisp
484
485(hfy-size @var{height})
486@end lisp
487
488Derive a css font-size specifier from an emacs font :height attribute.
489Does not cope with the case where height is a function to be applied to
490the height of the underlying font.
491
492@item hfy-default-header
493@findex hfy-default-header
494@anchor{hfy-default-header}
495
496@lisp
497
498(hfy-default-header @var{file} @var{style})
499@end lisp
500
501Default value for @ref{hfy-page-header}
502
503@item hfy-family
504@findex hfy-family
505@anchor{hfy-family}
506
507@lisp
508
509(hfy-family @var{family})
510@end lisp
511
512Derives a css font-family specifier from an emacs :family attribute.
513
514@item hfy-mark-tag-hrefs
515@findex hfy-mark-tag-hrefs
516@anchor{hfy-mark-tag-hrefs}
517
518@lisp
519
520(hfy-mark-tag-hrefs @var{srcdir} @var{file})
521@end lisp
522
523Mark href start points with the 'hfy-link prop (value: href string)
524
525Mark href end points with the 'hfy-endl prop (value t)
526
527Avoid overlapping links, and mark links in descending length of
528tag name in order to prevent subtags from usurping supertags,
529(eg "term" for "terminal").
530
531@item hfy-box
532@findex hfy-box
533@anchor{hfy-box}
534
535@lisp
536
537(hfy-box @var{box})
538@end lisp
539
540Derive CSS border-* attributes from the emacs :box attribute.
541
542@item hfy-box-to-style
543@findex hfy-box-to-style
544@anchor{hfy-box-to-style}
545
546@lisp
547
548(hfy-box-to-style @var{spec})
549@end lisp
550
551Convert a complex :box emacs font attribute set to a list of CSS border-*
552attributes. Don't call this directly - it is called by @ref{hfy-box}
553when necessary.
554
555@item hfy-html-enkludge-buffer
556@findex hfy-html-enkludge-buffer
557@anchor{hfy-html-enkludge-buffer}
558
559@lisp
560
561(hfy-html-enkludge-buffer)
562@end lisp
563
564Mark dangerous ["<>] characters with the 'hfy-quoteme property.
565
566See also @ref{hfy-html-dekludge-buffer}.
567
568@item hfy-buffer
569@findex hfy-buffer
570@anchor{hfy-buffer}
571
572@lisp
573
574(hfy-buffer)
575@end lisp
576
577Generate and return an htmlfontify html output buffer for the current
578buffer. May trample an existing buffer.
579
580@item hfy-fontified-p
581@findex hfy-fontified-p
582@anchor{hfy-fontified-p}
583
584@lisp
585
586(hfy-fontified-p)
587@end lisp
588
589@code{font-lock} doesn't like to say a buffer's been fontified when in
590batch mode, but we want to know if we should fontify or raw copy, so in
591batch mode we check for non-default face properties. Otherwise we test
592@code{font-lock-mode} and @code{font-lock-fontified} for truth.
593
594@item hfy-lookup
595@findex hfy-lookup
596@anchor{hfy-lookup}
597
598@lisp
599
600(hfy-lookup @var{face} @var{style})
601@end lisp
602
603Where @var{style} is a @ref{hfy-sheet-assoc} and @var{face} is an emacs face,
604return the relevant @var{css} style name.
605
606@item hfy-fontify-buffer
607@findex hfy-fontify-buffer
608@anchor{hfy-fontify-buffer}
609
610@lisp
611
612(hfy-fontify-buffer &optional @var{srcdir} @var{file})
613@end lisp
614
615Implement the guts of @ref{htmlfontify-buffer}
616
617@item hfy-colour
618@findex hfy-colour
619@anchor{hfy-colour}
620
621@lisp
622
623(hfy-colour @var{colour})
624@end lisp
625
626Convert an emacs :foreground property to a CSS colour property.
627
628@item hfy-flatten-style
629@findex hfy-flatten-style
630@anchor{hfy-flatten-style}
631
632@lisp
633
634(hfy-flatten-style @var{style})
635@end lisp
636
637Take @var{style} (see @ref{hfy-face-to-style-i}, @ref{hfy-face-to-style})
638and merge any multiple attributes appropriately. Currently only font-size is
639merged down to a single occurrence - others may need special handling, but I
640haven't encountered them yet. Returns a @ref{hfy-style-assoc}.
641
642@item hfy-size-to-int
643@findex hfy-size-to-int
644@anchor{hfy-size-to-int}
645
646@lisp
647
648(hfy-size-to-int @var{spec})
649@end lisp
650
651Convert @var{spec}, a css font-size specifier, back to an emacs :height attribute
652value. Used while merging multiple font-size attributes.
653
654@item hfy-sprintf-stylesheet
655@findex hfy-sprintf-stylesheet
656@anchor{hfy-sprintf-stylesheet}
657
658@lisp
659
660(hfy-sprintf-stylesheet @var{css} @var{file})
661@end lisp
662
663Generates a header, via @ref{hfy-page-header}, for @var{file}, containing the
664stylesheet derived from @var{css}, which is a @ref{hfy-sheet-assoc}. Returns a
665string containing the same.
666
667@item hfy-relstub
668@findex hfy-relstub
669@anchor{hfy-relstub}
670
671@lisp
672
673(hfy-relstub @var{file} &optional @var{start})
674@end lisp
675
676Return a "../" stub of the appropriate length for the current source
677tree depth (as determined from @var{file}). iyswim.
678
679@item hfy-compile-face-map
680@findex hfy-compile-face-map
681@anchor{hfy-compile-face-map}
682
683@lisp
684
685(hfy-compile-face-map)
686@end lisp
687
688Compile and return a @ref{hfy-facemap-assoc} for the current buffer.
689
690@item hfy-prepare-index
691@findex hfy-prepare-index
692@anchor{hfy-prepare-index}
693
694@lisp
695
696(hfy-prepare-index @var{srcdir} @var{dstdir})
697@end lisp
698
699Return as list of index buffer(s), as determined by @ref{hfy-split-index}.
700Uses @ref{hfy-prepare-index-i} to do this.
701
702@item hfy-prepare-tag-map
703@findex hfy-prepare-tag-map
704@anchor{hfy-prepare-tag-map}
705
706@lisp
707
708(hfy-prepare-tag-map @var{srcdir} @var{dstdir})
709@end lisp
710
711Prepare the counterpart(s) to the index buffer(s) - a list of buffers with
712the same structure, but listing ( and linking to ) instances of tags ( as
713opposed to their definitions ).
714
715See also: @ref{hfy-prepare-index}, @ref{hfy-split-index}
716
717@item hfy-subtract-maps
718@findex hfy-subtract-maps
719@anchor{hfy-subtract-maps}
720
721@lisp
722
723(hfy-subtract-maps @var{srcdir})
724@end lisp
725
726Internal function - strips definitions of tags from the instance map.
727See: @ref{hfy-tags-cache} and @ref{hfy-tags-rmap}
728
729@item hfy-face-to-style-i
730@findex hfy-face-to-style-i
731@anchor{hfy-face-to-style-i}
732
733@lisp
734
735(hfy-face-to-style-i @var{fn})
736@end lisp
737
738The guts of @ref{hfy-face-to-style}: @var{fn} should be a @code{defface}
739font specification, as returned by @code{face-attr-construct} or
740@ref{hfy-face-attr-for-class}. Note that this function does not get
741font-sizes right if they are based on inherited modifiers (via the
742:inherit) attribute, and any other modifiers that are cumulative if they
743appear multiple times need to be merged by the user - @ref{hfy-flatten-style}
744should do this.
745
746@item hfy-face-to-css
747@findex hfy-face-to-css
748@anchor{hfy-face-to-css}
749
750@lisp
751
752(hfy-face-to-css @var{fn})
753@end lisp
754
755Take @var{fn}, a font or @code{defface} specification (cf.
756@code{face-attr-construct}) and return a CSS style specification.
757
758See also: @ref{hfy-face-to-style}
759
760@item hfy-html-quote
761@findex hfy-html-quote
762@anchor{hfy-html-quote}
763
764@lisp
765
766(hfy-html-quote @var{char-string})
767@end lisp
768
769Map a string (usu. 1 char long) to an html safe string (entity) if need be.
770
771@item hfy-link-style
772@findex hfy-link-style
773@anchor{hfy-link-style}
774
775@lisp
776
777(hfy-link-style @var{style-string})
778@end lisp
779
780Convert the CSS style spec @var{style-string} to it's equivalent
781hyperlink style.
782
783See: @ref{hfy-link-style-fun}.
784
785@item hfy-p-to-face
786@findex hfy-p-to-face
787@anchor{hfy-p-to-face}
788
789@lisp
790
791(hfy-p-to-face @var{props})
792@end lisp
793
794Given @var{props}, a list of text-properties, return the value of the
795face property, or nil.
796
797@item hfy-box-to-border-assoc
798@findex hfy-box-to-border-assoc
799@anchor{hfy-box-to-border-assoc}
800
801@lisp
802
803(hfy-box-to-border-assoc @var{spec})
804@end lisp
805
806Helper function for @ref{hfy-box-to-style}.
807
808@item hfy-face-attr-for-class
809@findex hfy-face-attr-for-class
810@anchor{hfy-face-attr-for-class}
811
812@lisp
813
814(hfy-face-attr-for-class @var{face} &optional @var{class})
815@end lisp
816
817Return the face attributes for @var{face}. If @var{class} is set, it
818must be a @code{defface} alist key [see below]. Prior to version 0.18,
819the first face specification returned by @ref{hfy-combined-face-spec}
820which @emph{didn't} clash with @var{class} was returned. In versions
821from 0.18 onwards, each font attribute list is scored, and the
822non-conflicting list with the highest score is returned. ( A specification
823with a class of @code{t} is considered to match any class you specify:
824This matches emacs' behaviour when deciding on which face attributes to
825use, to the best of my understanding ).
826
827If @var{class} is nil, then you just get get whatever
828@code{face-attr-construct} returns, ie the current specification in
829effect for @var{face}.
830
831See @ref{hfy-display-class} for details of valid values for @var{class}.
832
833@item hfy-face-at
834@findex hfy-face-at
835@anchor{hfy-face-at}
836
837@lisp
838
839(hfy-face-at P)
840@end lisp
841
842Find face in effect at point P. If overlays are to be considered
843(see @ref{hfy-optimisations}) then this may return a @code{defface} style
844list of face properties instead of a face symbol.
845
846@item hfy-bgcol
847@findex hfy-bgcol
848@anchor{hfy-bgcol}
849
850@lisp
851
852(hfy-bgcol @var{colour})
853@end lisp
854
855As per @ref{hfy-colour} but for background colours.
856
857@item hfy-kludge-cperl-mode
858@findex hfy-kludge-cperl-mode
859@anchor{hfy-kludge-cperl-mode}
860
861@lisp
862
863(hfy-kludge-cperl-mode)
864@end lisp
865
866cperl mode does its damndest not to do some of its fontification when not
867in a windowing system - we try to trick it...
868
869@item hfy-href
870@findex hfy-href
871@anchor{hfy-href}
872
873@lisp
874
875(hfy-href @var{this-file} @var{def-files} @var{tag} @var{tag-map})
876@end lisp
877
878Return a relative href to the tag in question, based on
879
880@var{this-file} @ref{hfy-link-extn} @ref{hfy-extn} @var{def-files} @var{tag} and @var{tag-map}
881
882@var{this-file} is the current source file
883@var{def-files} is a list of file containing possible link endpoints for @var{tag}
884@var{tag} is the @var{tag} in question
885@var{tag-map} is the entry in @ref{hfy-tags-cache}.
886
887@item hfy-shell
888@findex hfy-shell
889@anchor{hfy-shell}
890
891@lisp
892
893(hfy-shell)
894@end lisp
895
896Returns a best guess at a bourne compatible shell to use: If the current
897shell doesn't look promising, fall back to @ref{hfy-shell-file-name}.
898
899@item hfy-load-tags-cache
900@findex hfy-load-tags-cache
901@anchor{hfy-load-tags-cache}
902
903@lisp
904
905(hfy-load-tags-cache @var{srcdir})
906@end lisp
907
908Run @ref{hfy-etags-cmd} on @var{srcdir}: load @ref{hfy-tags-cache} and @ref{hfy-tags-sortl}.
909
910@item hfy-parse-tags-buffer
911@findex hfy-parse-tags-buffer
912@anchor{hfy-parse-tags-buffer}
913
914@lisp
915
916(hfy-parse-tags-buffer @var{srcdir} @var{buffer})
917@end lisp
918
919Parse a @var{buffer} containing etags formatted output, loading the
920@ref{hfy-tags-cache} and @ref{hfy-tags-sortl} entries for @var{srcdir}.
921
922@item hfy-interq
923@findex hfy-interq
924@anchor{hfy-interq}
925
926@lisp
927
928(hfy-interq @var{set-a} @var{set-b})
929@end lisp
930
931Return the intersection ( using @code{eq} ) of 2 lists.
932
933@item hfy-text-p
934@findex hfy-text-p
935@anchor{hfy-text-p}
936
937@lisp
938
939(hfy-text-p @var{srcdir} @var{file})
940@end lisp
941
942Is @var{srcdir}/@var{file} text? Uses @ref{hfy-istext-command} to determine this.
943
944@item hfy-opt
945@findex hfy-opt
946@anchor{hfy-opt}
947
948@lisp
949
950(hfy-opt @var{symbol})
951@end lisp
952
953Is @ref{hfy-optimisations} member @var{symbol} set or not?
954
955@item hfy-dirname
956@findex hfy-dirname
957@anchor{hfy-dirname}
958
959@lisp
960
961(hfy-dirname @var{file})
962@end lisp
963
964Return everything preceding the last "/" from a relative filename,
965on the assumption that this will produce a relative directory name. Hardly
966bombproof, but good enough in the context in which it is being used.
967
968@item hfy-html-dekludge-buffer
969@findex hfy-html-dekludge-buffer
970@anchor{hfy-html-dekludge-buffer}
971
972@lisp
973
974(hfy-html-dekludge-buffer)
975@end lisp
976
977Transform all dangerous characters marked with the 'hfy-quoteme property
978using @ref{hfy-html-quote}
979
980See also @ref{hfy-html-enkludge-buffer}.
981
982@item hfy-copy-and-fontify-file
983@findex hfy-copy-and-fontify-file
984@anchor{hfy-copy-and-fontify-file}
985
986@lisp
987
988(hfy-copy-and-fontify-file @var{srcdir} @var{dstdir} @var{file})
989@end lisp
990
991open @var{file} in @var{srcdir} - if fontified, write a fontified copy to @var{dstdir}
992adding an extension of @ref{hfy-extn}. Fontification is actually done by
993@ref{htmlfontify-buffer}. If the buffer is not fontified, just copy it.
994
995@item hfy-decor
996@findex hfy-decor
997@anchor{hfy-decor}
998
999@lisp
1000
1001(hfy-decor @var{tag} @var{val})
1002@end lisp
1003
1004Derive CSS text-decoration specifiers from various emacs font attributes.
1005
1006@item hfy-slant
1007@findex hfy-slant
1008@anchor{hfy-slant}
1009
1010@lisp
1011
1012(hfy-slant @var{slant})
1013@end lisp
1014
1015Derive a font-style css specifier from the emacs :slant attribute -
1016CSS does not define the reverse-* styles, so just maps those to the
1017regular specifiers.
1018
1019@item hfy-tags-for-file
1020@findex hfy-tags-for-file
1021@anchor{hfy-tags-for-file}
1022
1023@lisp
1024
1025(hfy-tags-for-file @var{srcdir} @var{file})
1026@end lisp
1027
1028List of etags tags that have definitions in this @var{file}. Looks up
1029the tags cache in @ref{hfy-tags-cache} using @var{srcdir} as the key.
1030
1031@item hfy-width
1032@findex hfy-width
1033@anchor{hfy-width}
1034
1035@lisp
1036
1037(hfy-width @var{width})
1038@end lisp
1039
1040Convert an emacs :width attribute to a CSS font-stretch attribute.
1041
1042@comment /AUTOGENERATED BLOCK
1043@end table
1044
1045@node Variables, Data Structures, Non-interactive, Usage & Examples
1046@section Variables
1047@cindex variables
1048
1049Important variables which are not customisation items:
1050
1051@table @code
1052
1053@item hfy-tags-cache
1054@vindex hfy-tags-cache
1055@anchor{hfy-tags-cache}
1056
1057This is an alist of the form:
1058
1059@example
1060(("/src/dir/0" . tag-hash0) ("/src/dir/1" tag-hash1) ...)
1061@end example
1062
1063Each tag hash entry then contains entries of the form:
1064
1065@example
1066"tag_string" => (("file/name.ext" line char) ... )
1067@end example
1068
1069ie an alist mapping (relative) file paths to line and character offsets.
1070
1071See @ref{hfy-load-tags-cache}.
1072
1073@item hfy-tags-rmap
1074@vindex hfy-tags-rmap
1075@anchor{hfy-tags-rmap}
1076
1077@code{hfy-tags-rmap} is an alist of the form:
1078
1079@lisp
1080(("/src/dir" . tag-rmap-hash))
1081@end lisp
1082
1083Where tag-rmap-hash has entries of the form:
1084
1085@example
1086"tag_string" => ( "file/name.ext" line char )
1087@end example
1088
1089Unlike @ref{hfy-tags-cache} these are the locations of occurrences of
1090tagged items, not the locations of their definitions.
1091
1092@item hfy-tags-sortl
1093@vindex hfy-tags-sortl
1094@anchor{hfy-tags-sortl}
1095
1096@code{hfy-tags-sortl} is an alist of the form:
1097
1098@example
1099(("/src/dir" . (tag0 tag1 tag2)) ... )
1100@end example
1101
1102Where the tags are stored in descending order of length.
1103
1104See: @ref{hfy-load-tags-cache}.
1105
1106@end table
1107
1108@node Data Structures, Examples, Variables, Usage & Examples
1109@section Data Structures
1110@cindex Data Structures
1111
1112Some of the (informal) data structures used in Htmlfontify are detailed here:
1113
1114@table @code
1115
1116@item hfy-style-assoc
1117@cindex hfy-style-assoc
1118@anchor{hfy-style-assoc}
1119
1120An assoc representing/describing an emacs face. Properties may be repeated,
1121In which case later properties should be treated as if they were inherited
1122from a 'parent' font. (For some properties, only the first encountered value
1123is of any importance, for others the values might be cumulative, and for
1124others they might be cumulative in a complex way).
1125
1126Some examples:
1127
1128@lisp
1129(hfy-face-to-style 'default) =>
1130
1131 (("background" . "rgb(0, 0, 0)" )
1132 ("color" . "rgb(255, 255, 255)")
1133 ("font-style" . "normal" )
1134 ("font-weight" . "500" )
1135 ("font-stretch" . "normal" )
1136 ("font-family" . "misc-fixed" )
1137 ("font-size" . "13pt" )
1138 ("text-decoration" . "none" ))
1139
1140(hfy-face-to-style 'Info-title-3-face) =>
1141
1142 (("font-weight" . "700" )
1143 ("font-family" . "helv" )
1144 ("font-size" . "120%" )
1145 ("text-decoration" . "none") )
1146@end lisp
1147
1148@item hfy-sheet-assoc
1149@cindex hfy-sheet-assoc
1150@anchor{hfy-sheet-assoc}
1151
1152An assoc with elements of the form (face-name style-name . stlye-string):
1153The actual stylesheet for each page is derived from one of these.
1154
1155@lisp
1156'((default "default" . "@{ background: black; color: white@}")
1157 (font-lock-string-face "string" . "@{ color: rgb(64,224,208) @}"))
1158@end lisp
1159
1160@item hfy-facemap-assoc
1161@cindex hfy-facemap-assoc
1162@anchor{hfy-facemap-assoc}
1163
1164An assoc of (point . @var{face-symbol}) or
1165(point . @code{defface} attribute list) and (point . 'end) elements, in
1166descending order of point value (ie from the file's end to its beginning).
1167The map is in reverse order because inserting a <style> tag (or any other
1168string) at @var{point} invalidates the map for all entries with a greater
1169value of point. By traversing the map from greatest to least @var{point},
1170we still invalidate the map as we go, but only those points we have already
1171dealt with ( and therefore no longer care about ) will be invalid at any
1172time.
1173
1174@lisp
1175'((64820 . end)
1176 (64744 . font-lock-comment-face)
1177 (64736 . end)
1178 (64722 . font-lock-string-face)
1179 (64630 . end)
1180 (64623 . font-lock-string-face)
1181 (64449 . end)
1182 ;; big similar section elided. You get the idea.
1183 (5459 . end)
1184 (5431 . (:inherit font-lock-keyword-face :background "7e7e7e"))
1185 (5431 . end)
1186 (4285 . font-lock-constant-face)
1187 (4285 . end)
1188 (4221 . font-lock-comment-face)
1189 (4221 . end)
1190 (4197 . font-lock-constant-face)
1191 (4197 . end)
1192 (1 . font-lock-comment-face))
1193@end lisp
1194
1195@end table
1196
1197@node Examples, , Data Structures, Usage & Examples
1198@section Examples
1199@cindex Examples
1200
1201The following is a lump of code I use to fontify source code on my
1202site, @url{http://rtfm.etla.org/} ( which was the reason, incidentally,
1203that htmlfontify was written in the first place ).
1204
1205@lisp
1206(defvar rtfm-section nil)
1207
1208;; constructs an appropriate header string to fit in with rtfm's
1209;; templating system, based on the file and the stylesheet string
1210(defun rtfm-build-page-header (file style)
1211 (format "#define TEMPLATE red+black.html
1212#define DEBUG 1
1213#include <build/menu-dirlist|>\n
1214html-css-url := /css/red+black.css
1215title := rtfm.etla.org ( %s / src/%s )
1216bodytag :=
1217head <=STYLESHEET;\n
1218%s
1219STYLESHEET
1220main-title := rtfm / %s / src/%s\n
1221main-content <=MAIN_CONTENT;\n" rtfm-section file style rtfm-section file))
1222
1223;; the footer:
1224(defun rtfm-build-page-footer (file) "\nMAIN_CONTENT\n")
1225
1226(defun rtfm-fontify-buffer (section)
1227 (interactive "s section[eg- emacs / p4-blame]: ")
1228 (require 'htmlfontify)
1229 (let ((hfy-page-header 'rtfm-build-page-header)
1230 (hfy-page-footer 'rtfm-build-page-footer)
1231 (rtfm-section section))
1232 (htmlfontify-buffer)
1233 )
1234 )
1235
1236;; here's the function I catually call - it asks me for a section label,
1237;; and source and destination directories, and then binds a couple of
1238;; customisation variable in a let before calling htmlfontify:
1239(defun rtfm-build-source-docs (section srcdir destdir)
1240 (interactive
1241 "s section[eg- emacs / p4-blame]:\nD source-dir: \nD output-dir: ")
1242 (require 'htmlfontify)
1243 (hfy-load-tags-cache srcdir)
1244 (let ((hfy-page-header 'rtfm-build-page-header)
1245 (hfy-page-footer 'rtfm-build-page-footer)
1246 (rtfm-section section)
1247 (hfy-index-file "index")
1248 (auto-mode-alist (append auto-mode-alist
1249 '(("dbi\\(shell\\|gtk\\)$" . cperl-mode)
1250 ("\\.xpm$" . c-mode ))))
1251 )
1252 (htmlfontify-run-etags srcdir)
1253 (htmlfontify-copy-and-link-dir srcdir destdir ".src" ".html")))
1254@end lisp
1255
1256@node Customisation, Requirements, Usage & Examples, Top
1257@chapter Customisation
1258@cindex variables (customisation)
1259
1260Htmlfontify provides the following variable and customisation entries:
1261
1262@table @code
1263@comment AUTOGENERATED BLOCK
1264
1265@item hfy-link-style-fun
1266@vindex hfy-link-style-fun
1267@anchor{hfy-link-style-fun}
1268
1269Set this to a function, which will be called with one argument
1270(a "@{ foo: bar; ...@}" css style-string) - it should return a copy of
1271its argument, altered so as to make any changes you want made for text which
1272is a hyperlink, in addition to being in the class to which that style would
1273normally be applied.
1274
1275@item hfy-html-quote-regex
1276@vindex hfy-html-quote-regex
1277@anchor{hfy-html-quote-regex}
1278
1279Regex to match (with a single back-reference per match) strings in HTML
1280which should be quoted with @ref{hfy-html-quote}
1281(and @pxref{hfy-html-quote-map}) to make them safe.
1282
1283@item hfy-page-footer
1284@vindex hfy-page-footer
1285@anchor{hfy-page-footer}
1286
1287As @ref{hfy-page-header}, but generates the output footer
1288(and takes only 1 argument, the filename).
1289
1290@item hfy-display-class
1291@vindex hfy-display-class
1292@anchor{hfy-display-class}
1293
1294Display class to use to determine which display class to use when
1295calculating a face's attributes. This is useful when, for example, you
1296are running emacs on a tty or in batch mode, and want htmlfontify to have
1297access to the face spec you would use if you were connected to an X display.
1298
1299Some valid class specification elements are:
1300
1301@lisp
1302 '(class color)
1303 '(class grayscale)
1304 '(background dark)
1305 '(background light)
1306 '(type x-toolkit)
1307 '(type tty)
1308 '(type motif)
1309 '(type lucid)
1310@end lisp
1311
1312Multiple values for a tag may be combined, to indicate that any one or more
1313of these values in the specification key constitutes a match, eg:
1314
1315'((class color grayscale) (type tty)) would match any of:
1316@lisp
1317 '((class color))
1318 '((class grayscale))
1319 '((class color grayscale)))
1320 '((class color foo))
1321 '((type tty))
1322 '((type tty) (class color))
1323@end lisp
1324and so on.
1325
1326@item hfy-page-header
1327@vindex hfy-page-header
1328@anchor{hfy-page-header}
1329
1330Function called with two arguments (the filename relative to the top
1331level source directory being etag'd and fontified), and a string containing
1332the <style>...</style> text to embed in the document- the string returned will
1333be used as the header for the htmlfontified version of the source file.
1334
1335See also: @ref{hfy-page-footer}
1336
1337@item hfy-src-doc-link-style
1338@vindex hfy-src-doc-link-style
1339@anchor{hfy-src-doc-link-style}
1340
1341String to add to the '<style> a' variant of an htmlfontify css class.
1342
1343@item hfy-fast-lock-save
1344@vindex hfy-fast-lock-save
1345@anchor{hfy-fast-lock-save}
1346
1347Minimum size of a buffer for cached fontification.
1348This value is temporarily assigned to @code{fast-lock-minimum-size} during
1349html-fontification.
1350
1351Only buffers more than this can have associated Font Lock cache files saved.
1352
1353If nil, means cache files are never created.
1354
1355If a list, each element should be a cons pair of the form
1356@code{(@var{major-mode} . @var{size})}, where @var{major-mode}
1357is a symbol or t (meaning the default). For example:
1358
1359@lisp
1360 ((c-mode . 25600 )
1361 (c++-mode . 25600 )
1362 (rmail-mode . 1048576))
1363@end lisp
1364
1365means that the minimum size is 25K for buffers in C or C++ modes, one megabyte
1366for buffers in Rmail mode, and size is irrelevant (ie no saves) otherwise.
1367
1368@item hfy-split-index
1369@vindex hfy-split-index
1370@anchor{hfy-split-index}
1371
1372Whether or not to split the index @ref{hfy-index-file} alphabetically
1373on the first letter of each tag. Useful when the index would otherwise
1374be large and take a long time to render or be difficult to navigate.
1375
1376@item hfy-find-cmd
1377@vindex hfy-find-cmd
1378@anchor{hfy-find-cmd}
1379
1380``find'' command used to harvest a list of files to attempt to fontify.
1381
1382@item hfy-extn
1383@vindex hfy-extn
1384@anchor{hfy-extn}
1385
1386File extension used for output files
1387
1388@item hfy-default-face-def
1389@vindex hfy-default-face-def
1390@anchor{hfy-default-face-def}
1391
1392Fallback @code{defface} specification for the face @code{default}, used
1393when @ref{hfy-display-class} has been set ( the normal htmlfontify way of
1394extracting potentially non-current face information doesn't necessarily
1395work for @code{default} ).
1396
1397Example: I customise this to:
1398
1399@lisp
1400((t :background "black" :foreground "white" :family "misc-fixed"))
1401@end lisp
1402
1403@item hfy-init-kludge-hooks
1404@vindex hfy-init-kludge-hooks
1405@anchor{hfy-init-kludge-hooks}
1406
1407List of functions to call when starting htmlfontify-buffer to do any
1408kludging necessary to get highlighting modes to bahave as you want, even
1409when not running under a window system.
1410
1411@item hfy-shell-file-name
1412@vindex hfy-shell-file-name
1413@anchor{hfy-shell-file-name}
1414
1415Should be set to a bourne compatible shell, which will be invoked
1416for the more complex shell interactions needed by htmlfontify.
1417Currently this is only required/used when using GNU etags, see
1418@ref{hfy-etags-cmd-alist} for details.
1419
1420@item hfy-optimisations
1421@vindex hfy-optimisations
1422@anchor{hfy-optimisations}
1423
1424Optimisations to turn on: So far, the following have been implemented:
1425
1426@table @option
1427@item merge-adjacent-tags
1428If two (or more) span tags are adjacent, identical and separated by nothing
1429more than whitespace, they will be merged into one span.
1430
1431@item zap-comment-links
1432Suppress hyperlinking of tags found in comments.
1433
1434@item zap-string-links
1435Suppress hyperlinking of tags found in strings.
1436
1437@item div-wrapper
1438Add <div class="default"> </div> tags around the fontified body.
1439( some people like this because they cut and paste the html into
1440 a page with different colours than the fontified code. )
1441
1442@item keep-overlays
1443preserve overlay highlighting (cf @code{ediff} or @code{goo-font-lock})
1444as well as basic faces. Can result in extremely verbose highlighting
1445if there are many overlays (as is the case with @code{goo-font-lock}).
1446
1447@end table
1448
1449And the following are planned but not yet available:
1450
1451@table @option
1452@item kill-context-leak
1453Suppress hyperlinking between files highlighted by different modes.
1454
1455@end table
1456
1457Note: like compiler optimisations, these optimise the _output_ of the code,
1458not the processing of the source itself, and are therefore likely to slow
1459htmlfontify down, at least a little. Except for skip-refontification,
1460which can never slow you down, but may result in incomplete fontification.
1461
1462@item hfy-src-doc-link-unstyle
1463@vindex hfy-src-doc-link-unstyle
1464@anchor{hfy-src-doc-link-unstyle}
1465
1466Regex to remove from the <style> a variant of an htmlfontify css class.
1467
1468@item hfy-link-extn
1469@vindex hfy-link-extn
1470@anchor{hfy-link-extn}
1471
1472File extension used for href links - Useful where the htmlfontify
1473output files are going to be processed again, with a rersulting change
1474in file extension. If @code{nil}, then any code using this should fall back
1475to @ref{hfy-extn}.
1476
1477@item hfy-istext-command
1478@vindex hfy-istext-command
1479@anchor{hfy-istext-command}
1480
1481Command to run with the name of a file, to see whether it is a text file
1482or not. The command should emit a string containing the word 'text' if
1483the file is a text file, and a string not containing 'text' otherwise.
1484
1485@item hfy-etags-cmd-alist
1486@vindex hfy-etags-cmd-alist
1487@anchor{hfy-etags-cmd-alist}
1488
1489An alist of possible shell commands that will generate etags output that
1490Htmlfontify can use. '%s' will be replaced by @ref{hfy-etags-bin}.
1491
1492@item hfy-etags-bin
1493@vindex hfy-etags-bin
1494@anchor{hfy-etags-bin}
1495
1496The Location of the etags binary (we begin by assuming it's in your path).
1497
1498Note that if etags is not in your path, you will need to alter the shell
1499commands in @ref{hfy-etags-cmd-alist}.
1500
1501[ As of version 0.17, this requirement has been removed: It should
1502 all just work(tm) ]
1503
1504@item hfy-etags-cmd
1505@vindex hfy-etags-cmd
1506@anchor{hfy-etags-cmd}
1507
1508An etags shell command to run in the source directory to generate a tags
1509file for the whole source tree from there on down. The command should emit
1510the etags output on standard output.
1511
1512Two canned commands are provided - they drive emacs' etags and
1513exuberant-ctags' etags respectively.
1514
1515@item hfy-etag-regex
1516@vindex hfy-etag-regex
1517@anchor{hfy-etag-regex}
1518
1519Regex used to parse an etags entry: must have 3 subexps, corresponding,
1520in order, to:
1521
1522@enumerate
1523 The tag
1524 The line
1525 The char (point) at which the tag occurs
1526@end enumerate
1527
1528@item hfy-index-file
1529@vindex hfy-index-file
1530@anchor{hfy-index-file}
1531
1532Name (sans extension) of the index file produced during
1533fontification-and-hyperlinking.
1534
1535@item hfy-instance-file
1536@vindex hfy-instance-file
1537@anchor{hfy-instance-file}
1538
1539Name (sans extension) of the tag usage index file produced during
1540fontification-and-hyperlinking.
1541
1542@item hfy-html-quote-map
1543@vindex hfy-html-quote-map
1544@anchor{hfy-html-quote-map}
1545
1546An alist of char -> entity mappings used to make the text html-safe.
1547
1548@comment /AUTOGENERATED BLOCK
1549@end table
1550
1551@node Requirements, Index, Customisation, Top
1552@chapter Requirements
1553@cindex Requirements, Prerequisites
1554
1555Htmlfontify has a couple of external requirements:
1556
1557@itemize @bullet
1558
1559@item
1560GNU Emacs 20.7+ or 21.1+
1561
1562Other versions may work - these have been used successfully by the
1563author. If you intend to use Htmlfontify in batch mode, 21.1+ is
1564pretty much required. The author does not know if XEmacs, NTemacs,
1565or J.Random Emacs will run Htmlfontify, but reports/patches/bags of
1566money are always welcome.
1567
1568@item
1569A copy of etags ( exuberant-ctags or GNU etags ). Htmlfontify attempts
1570to autodetect the version you have and customise itself accordingly,
1571but you should be able to override this.
1572
1573See: @ref{Customisation}
1574
1575@item
1576A copy of find (eg GNU find) that provides the @code{-path} predicate.
1577
1578You may be able to work around this with a suitable clever shell
1579command and the customisation entry: @ref{hfy-find-cmd}
1580
1581@item
1582A copy of sed (eg GNU sed).
1583
1584@item
1585A copy of the @code{file} command.
1586
1587@end itemize
1588
1589@node Index, , Requirements, Top
1590@unnumbered Index
1591
1592@table @var
1593@item Concepts
1594@printindex cp
1595
1596@item Functions
1597@printindex fn
1598
1599@item Variables & Customisation
1600@printindex vr
1601
1602@end table
1603
1604@node COPYING, , , Top
1605@appendix GNU Free Documentation Licence
1606
1607@cindex FDL, GNU Free Documentation License
1608@center Version 1.1, March 2000
1609
1610@display
1611Copyright @copyright{} 2000 Free Software Foundation, Inc.
161259 Temple Place, Suite 330, Boston, MA 02111-1307, USA
1613
1614Everyone is permitted to copy and distribute verbatim copies
1615of this license document, but changing it is not allowed.
1616@end display
1617
1618@enumerate 0
1619@item
1620PREAMBLE
1621
1622The purpose of this License is to make a manual, textbook, or other
1623written document @dfn{free} in the sense of freedom: to assure everyone
1624the effective freedom to copy and redistribute it, with or without
1625modifying it, either commercially or noncommercially. Secondarily,
1626this License preserves for the author and publisher a way to get
1627credit for their work, while not being considered responsible for
1628modifications made by others.
1629
1630This License is a kind of ``copyleft'', which means that derivative
1631works of the document must themselves be free in the same sense. It
1632complements the GNU General Public License, which is a copyleft
1633license designed for free software.
1634
1635We have designed this License in order to use it for manuals for free
1636software, because free software needs free documentation: a free
1637program should come with manuals providing the same freedoms that the
1638software does. But this License is not limited to software manuals;
1639it can be used for any textual work, regardless of subject matter or
1640whether it is published as a printed book. We recommend this License
1641principally for works whose purpose is instruction or reference.
1642
1643@item
1644APPLICABILITY AND DEFINITIONS
1645
1646This License applies to any manual or other work that contains a
1647notice placed by the copyright holder saying it can be distributed
1648under the terms of this License. The ``Document'', below, refers to any
1649such manual or work. Any member of the public is a licensee, and is
1650addressed as ``you''.
1651
1652A ``Modified Version'' of the Document means any work containing the
1653Document or a portion of it, either copied verbatim, or with
1654modifications and/or translated into another language.
1655
1656A ``Secondary Section'' is a named appendix or a front-matter section of
1657the Document that deals exclusively with the relationship of the
1658publishers or authors of the Document to the Document's overall subject
1659(or to related matters) and contains nothing that could fall directly
1660within that overall subject. (For example, if the Document is in part a
1661textbook of mathematics, a Secondary Section may not explain any
1662mathematics.) The relationship could be a matter of historical
1663connection with the subject or with related matters, or of legal,
1664commercial, philosophical, ethical or political position regarding
1665them.
1666
1667The ``Invariant Sections'' are certain Secondary Sections whose titles
1668are designated, as being those of Invariant Sections, in the notice
1669that says that the Document is released under this License.
1670
1671The ``Cover Texts'' are certain short passages of text that are listed,
1672as Front-Cover Texts or Back-Cover Texts, in the notice that says that
1673the Document is released under this License.
1674
1675A ``Transparent'' copy of the Document means a machine-readable copy,
1676represented in a format whose specification is available to the
1677general public, whose contents can be viewed and edited directly and
1678straightforwardly with generic text editors or (for images composed of
1679pixels) generic paint programs or (for drawings) some widely available
1680drawing editor, and that is suitable for input to text formatters or
1681for automatic translation to a variety of formats suitable for input
1682to text formatters. A copy made in an otherwise Transparent file
1683format whose markup has been designed to thwart or discourage
1684subsequent modification by readers is not Transparent. A copy that is
1685not ``Transparent'' is called ``Opaque''.
1686
1687Examples of suitable formats for Transparent copies include plain
1688@sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
1689@acronym{SGML} or @acronym{XML} using a publicly available
1690@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
1691for human modification. Opaque formats include PostScript,
1692@acronym{PDF}, proprietary formats that can be read and edited only by
1693proprietary word processors, @acronym{SGML} or @acronym{XML} for which
1694the @acronym{DTD} and/or processing tools are not generally available,
1695and the machine-generated @acronym{HTML} produced by some word
1696processors for output purposes only.
1697
1698The ``Title Page'' means, for a printed book, the title page itself,
1699plus such following pages as are needed to hold, legibly, the material
1700this License requires to appear in the title page. For works in
1701formats which do not have any title page as such, ``Title Page'' means
1702the text near the most prominent appearance of the work's title,
1703preceding the beginning of the body of the text.
1704
1705@item
1706VERBATIM COPYING
1707
1708You may copy and distribute the Document in any medium, either
1709commercially or noncommercially, provided that this License, the
1710copyright notices, and the license notice saying this License applies
1711to the Document are reproduced in all copies, and that you add no other
1712conditions whatsoever to those of this License. You may not use
1713technical measures to obstruct or control the reading or further
1714copying of the copies you make or distribute. However, you may accept
1715compensation in exchange for copies. If you distribute a large enough
1716number of copies you must also follow the conditions in section 3.
1717
1718You may also lend copies, under the same conditions stated above, and
1719you may publicly display copies.
1720
1721@item
1722COPYING IN QUANTITY
1723
1724If you publish printed copies of the Document numbering more than 100,
1725and the Document's license notice requires Cover Texts, you must enclose
1726the copies in covers that carry, clearly and legibly, all these Cover
1727Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
1728the back cover. Both covers must also clearly and legibly identify
1729you as the publisher of these copies. The front cover must present
1730the full title with all words of the title equally prominent and
1731visible. You may add other material on the covers in addition.
1732Copying with changes limited to the covers, as long as they preserve
1733the title of the Document and satisfy these conditions, can be treated
1734as verbatim copying in other respects.
1735
1736If the required texts for either cover are too voluminous to fit
1737legibly, you should put the first ones listed (as many as fit
1738reasonably) on the actual cover, and continue the rest onto adjacent
1739pages.
1740
1741If you publish or distribute Opaque copies of the Document numbering
1742more than 100, you must either include a machine-readable Transparent
1743copy along with each Opaque copy, or state in or with each Opaque copy
1744a publicly-accessible computer-network location containing a complete
1745Transparent copy of the Document, free of added material, which the
1746general network-using public has access to download anonymously at no
1747charge using public-standard network protocols. If you use the latter
1748option, you must take reasonably prudent steps, when you begin
1749distribution of Opaque copies in quantity, to ensure that this
1750Transparent copy will remain thus accessible at the stated location
1751until at least one year after the last time you distribute an Opaque
1752copy (directly or through your agents or retailers) of that edition to
1753the public.
1754
1755It is requested, but not required, that you contact the authors of the
1756Document well before redistributing any large number of copies, to give
1757them a chance to provide you with an updated version of the Document.
1758
1759@item
1760MODIFICATIONS
1761
1762You may copy and distribute a Modified Version of the Document under
1763the conditions of sections 2 and 3 above, provided that you release
1764the Modified Version under precisely this License, with the Modified
1765Version filling the role of the Document, thus licensing distribution
1766and modification of the Modified Version to whoever possesses a copy
1767of it. In addition, you must do these things in the Modified Version:
1768
1769@enumerate A
1770@item
1771Use in the Title Page (and on the covers, if any) a title distinct
1772from that of the Document, and from those of previous versions
1773(which should, if there were any, be listed in the History section
1774of the Document). You may use the same title as a previous version
1775if the original publisher of that version gives permission.
1776
1777@item
1778List on the Title Page, as authors, one or more persons or entities
1779responsible for authorship of the modifications in the Modified
1780Version, together with at least five of the principal authors of the
1781Document (all of its principal authors, if it has less than five).
1782
1783@item
1784State on the Title page the name of the publisher of the
1785Modified Version, as the publisher.
1786
1787@item
1788Preserve all the copyright notices of the Document.
1789
1790@item
1791Add an appropriate copyright notice for your modifications
1792adjacent to the other copyright notices.
1793
1794@item
1795Include, immediately after the copyright notices, a license notice
1796giving the public permission to use the Modified Version under the
1797terms of this License, in the form shown in the Addendum below.
1798
1799@item
1800Preserve in that license notice the full lists of Invariant Sections
1801and required Cover Texts given in the Document's license notice.
1802
1803@item
1804Include an unaltered copy of this License.
1805
1806@item
1807Preserve the section entitled ``History'', and its title, and add to
1808it an item stating at least the title, year, new authors, and
1809publisher of the Modified Version as given on the Title Page. If
1810there is no section entitled ``History'' in the Document, create one
1811stating the title, year, authors, and publisher of the Document as
1812given on its Title Page, then add an item describing the Modified
1813Version as stated in the previous sentence.
1814
1815@item
1816Preserve the network location, if any, given in the Document for
1817public access to a Transparent copy of the Document, and likewise
1818the network locations given in the Document for previous versions
1819it was based on. These may be placed in the ``History'' section.
1820You may omit a network location for a work that was published at
1821least four years before the Document itself, or if the original
1822publisher of the version it refers to gives permission.
1823
1824@item
1825In any section entitled ``Acknowledgments'' or ``Dedications'',
1826preserve the section's title, and preserve in the section all the
1827substance and tone of each of the contributor acknowledgments
1828and/or dedications given therein.
1829
1830@item
1831Preserve all the Invariant Sections of the Document,
1832unaltered in their text and in their titles. Section numbers
1833or the equivalent are not considered part of the section titles.
1834
1835@item
1836Delete any section entitled ``Endorsements''. Such a section
1837may not be included in the Modified Version.
1838
1839@item
1840Do not retitle any existing section as ``Endorsements''
1841or to conflict in title with any Invariant Section.
1842@end enumerate
1843
1844If the Modified Version includes new front-matter sections or
1845appendices that qualify as Secondary Sections and contain no material
1846copied from the Document, you may at your option designate some or all
1847of these sections as invariant. To do this, add their titles to the
1848list of Invariant Sections in the Modified Version's license notice.
1849These titles must be distinct from any other section titles.
1850
1851You may add a section entitled ``Endorsements'', provided it contains
1852nothing but endorsements of your Modified Version by various
1853parties---for example, statements of peer review or that the text has
1854been approved by an organization as the authoritative definition of a
1855standard.
1856
1857You may add a passage of up to five words as a Front-Cover Text, and a
1858passage of up to 25 words as a Back-Cover Text, to the end of the list
1859of Cover Texts in the Modified Version. Only one passage of
1860Front-Cover Text and one of Back-Cover Text may be added by (or
1861through arrangements made by) any one entity. If the Document already
1862includes a cover text for the same cover, previously added by you or
1863by arrangement made by the same entity you are acting on behalf of,
1864you may not add another; but you may replace the old one, on explicit
1865permission from the previous publisher that added the old one.
1866
1867The author(s) and publisher(s) of the Document do not by this License
1868give permission to use their names for publicity for or to assert or
1869imply endorsement of any Modified Version.
1870
1871@item
1872COMBINING DOCUMENTS
1873
1874You may combine the Document with other documents released under this
1875License, under the terms defined in section 4 above for modified
1876versions, provided that you include in the combination all of the
1877Invariant Sections of all of the original documents, unmodified, and
1878list them all as Invariant Sections of your combined work in its
1879license notice.
1880
1881The combined work need only contain one copy of this License, and
1882multiple identical Invariant Sections may be replaced with a single
1883copy. If there are multiple Invariant Sections with the same name but
1884different contents, make the title of each such section unique by
1885adding at the end of it, in parentheses, the name of the original
1886author or publisher of that section if known, or else a unique number.
1887Make the same adjustment to the section titles in the list of
1888Invariant Sections in the license notice of the combined work.
1889
1890In the combination, you must combine any sections entitled ``History''
1891in the various original documents, forming one section entitled
1892``History''; likewise combine any sections entitled ``Acknowledgments'',
1893and any sections entitled ``Dedications''. You must delete all sections
1894entitled ``Endorsements.''
1895
1896@item
1897COLLECTIONS OF DOCUMENTS
1898
1899You may make a collection consisting of the Document and other documents
1900released under this License, and replace the individual copies of this
1901License in the various documents with a single copy that is included in
1902the collection, provided that you follow the rules of this License for
1903verbatim copying of each of the documents in all other respects.
1904
1905You may extract a single document from such a collection, and distribute
1906it individually under this License, provided you insert a copy of this
1907License into the extracted document, and follow this License in all
1908other respects regarding verbatim copying of that document.
1909
1910@item
1911AGGREGATION WITH INDEPENDENT WORKS
1912
1913A compilation of the Document or its derivatives with other separate
1914and independent documents or works, in or on a volume of a storage or
1915distribution medium, does not as a whole count as a Modified Version
1916of the Document, provided no compilation copyright is claimed for the
1917compilation. Such a compilation is called an ``aggregate'', and this
1918License does not apply to the other self-contained works thus compiled
1919with the Document, on account of their being thus compiled, if they
1920are not themselves derivative works of the Document.
1921
1922If the Cover Text requirement of section 3 is applicable to these
1923copies of the Document, then if the Document is less than one quarter
1924of the entire aggregate, the Document's Cover Texts may be placed on
1925covers that surround only the Document within the aggregate.
1926Otherwise they must appear on covers around the whole aggregate.
1927
1928@item
1929TRANSLATION
1930
1931Translation is considered a kind of modification, so you may
1932distribute translations of the Document under the terms of section 4.
1933Replacing Invariant Sections with translations requires special
1934permission from their copyright holders, but you may include
1935translations of some or all Invariant Sections in addition to the
1936original versions of these Invariant Sections. You may include a
1937translation of this License provided that you also include the
1938original English version of this License. In case of a disagreement
1939between the translation and the original English version of this
1940License, the original English version will prevail.
1941
1942@item
1943TERMINATION
1944
1945You may not copy, modify, sublicense, or distribute the Document except
1946as expressly provided for under this License. Any other attempt to
1947copy, modify, sublicense or distribute the Document is void, and will
1948automatically terminate your rights under this License. However,
1949parties who have received copies, or rights, from you under this
1950License will not have their licenses terminated so long as such
1951parties remain in full compliance.
1952
1953@item
1954FUTURE REVISIONS OF THIS LICENSE
1955
1956The Free Software Foundation may publish new, revised versions
1957of the GNU Free Documentation License from time to time. Such new
1958versions will be similar in spirit to the present version, but may
1959differ in detail to address new problems or concerns. See
1960@uref{http://www.gnu.org/copyleft/}.
1961
1962Each version of the License is given a distinguishing version number.
1963If the Document specifies that a particular numbered version of this
1964License ``or any later version'' applies to it, you have the option of
1965following the terms and conditions either of that specified version or
1966of any later version that has been published (not as a draft) by the
1967Free Software Foundation. If the Document does not specify a version
1968number of this License, you may choose any version ever published (not
1969as a draft) by the Free Software Foundation.
1970@end enumerate
1971
1972@page
1973@appendixsubsec ADDENDUM: How to use this License for your documents
1974
1975To use this License in a document you have written, include a copy of
1976the License in the document and put the following copyright and
1977license notices just after the title page:
1978
1979@smallexample
1980@group
1981 Copyright (C) @var{year} @var{your name}.
1982 Permission is granted to copy, distribute and/or modify this document
1983 under the terms of the GNU Free Documentation License, Version 1.1
1984 or any later version published by the Free Software Foundation;
1985 with the Invariant Sections being @var{list their titles}, with the
1986 Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
1987 A copy of the license is included in the section entitled ``GNU
1988 Free Documentation License''.
1989@end group
1990@end smallexample
1991
1992If you have no Invariant Sections, write ``with no Invariant Sections''
1993instead of saying which ones are invariant. If you have no
1994Front-Cover Texts, write ``no Front-Cover Texts'' instead of
1995``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
1996
1997If your document contains nontrivial examples of program code, we
1998recommend releasing these examples in parallel under your choice of
1999free software license, such as the GNU General Public License,
2000to permit their use in free software.
2001
2002@setchapternewpage odd
2003@contents
2004@bye