diff options
| author | Joakim Verona | 2013-01-05 00:04:41 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-01-05 00:04:41 +0100 |
| commit | b18e01b65e651d3b626b4edcaaa2aa636fe25b69 (patch) | |
| tree | 2832e227a4c45d3a4d423f972df29fb7f8616b14 /doc/misc | |
| parent | 55b74b54b179f340bdb311070273f26da3fbd0c9 (diff) | |
| parent | 1bd71e9fe16541bc48868a00ff372018961380b0 (diff) | |
| download | emacs-b18e01b65e651d3b626b4edcaaa2aa636fe25b69.tar.gz emacs-b18e01b65e651d3b626b4edcaaa2aa636fe25b69.zip | |
auto upstream
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/ChangeLog | 16 | ||||
| -rw-r--r-- | doc/misc/Makefile.in | 13 | ||||
| -rw-r--r-- | doc/misc/htmlfontify.texi | 1609 | ||||
| -rw-r--r-- | doc/misc/makefile.w32-in | 13 |
4 files changed, 1647 insertions, 4 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index f902ca511f1..b0c39ce8507 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2013-01-04 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * Makefile.in (INFO_TARGETS, DVI_TARGETS, PDF_TARGETS): | ||
| 4 | Add htmlfontify. | ||
| 5 | (htmlfontify, $(buildinfodir)/htmlfontify$(INFO_EXT)) | ||
| 6 | (htmlfontify.dvi, htmlfontify.pdf): New targets. | ||
| 7 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add htmlfontify. | ||
| 8 | ($(infodir)/htmlfontify$(INFO_EXT), htmlfontify.dvi): New targets. | ||
| 9 | |||
| 10 | * htmlfontify.texi: Miscellaneous fixes and updates. | ||
| 11 | Set copyright to FSF, update license to GFDL 1.3+. | ||
| 12 | |||
| 13 | 2013-01-04 Vivek Dasmohapatra <vivek@etla.org> | ||
| 14 | |||
| 15 | * htmlfontify.texi: New file. | ||
| 16 | |||
| 1 | 2013-01-02 Jay Belanger <jay.p.belanger@gmail.com> | 17 | 2013-01-02 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 18 | ||
| 3 | * calc.texi (Free-Form Dates): Expand on the date reading | 19 | * calc.texi (Free-Form Dates): Expand on the date reading |
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index edfef9cbb5b..3dac35aafee 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in | |||
| @@ -43,7 +43,7 @@ MAKEINFO_OPTS = --force -I$(emacsdir) | |||
| 43 | INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \ | 43 | INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \ |
| 44 | dbus dired-x ebrowse ede ediff edt eieio \ | 44 | dbus dired-x ebrowse ede ediff edt eieio \ |
| 45 | emacs-mime epa erc ert eshell eudc efaq \ | 45 | emacs-mime epa erc ert eshell eudc efaq \ |
| 46 | flymake forms gnus emacs-gnutls idlwave info.info \ | 46 | flymake forms gnus emacs-gnutls htmlfontify idlwave info.info \ |
| 47 | mairix-el message mh-e newsticker nxml-mode \ | 47 | mairix-el message mh-e newsticker nxml-mode \ |
| 48 | org pcl-cvs pgg rcirc remember reftex sasl \ | 48 | org pcl-cvs pgg rcirc remember reftex sasl \ |
| 49 | sc semantic ses sieve smtpmail speedbar srecode tramp \ | 49 | sc semantic ses sieve smtpmail speedbar srecode tramp \ |
| @@ -75,6 +75,7 @@ DVI_TARGETS = \ | |||
| 75 | forms.dvi \ | 75 | forms.dvi \ |
| 76 | gnus.dvi \ | 76 | gnus.dvi \ |
| 77 | emacs-gnutls.dvi \ | 77 | emacs-gnutls.dvi \ |
| 78 | htmlfontify.dvi \ | ||
| 78 | idlwave.dvi \ | 79 | idlwave.dvi \ |
| 79 | info.dvi \ | 80 | info.dvi \ |
| 80 | mairix-el.dvi \ | 81 | mairix-el.dvi \ |
| @@ -129,6 +130,7 @@ PDF_TARGETS = \ | |||
| 129 | flymake.pdf \ | 130 | flymake.pdf \ |
| 130 | forms.pdf \ | 131 | forms.pdf \ |
| 131 | gnus.pdf \ | 132 | gnus.pdf \ |
| 133 | htmlfontify.pdf \ | ||
| 132 | emacs-gnutls.pdf \ | 134 | emacs-gnutls.pdf \ |
| 133 | idlwave.pdf \ | 135 | idlwave.pdf \ |
| 134 | info.pdf \ | 136 | info.pdf \ |
| @@ -440,6 +442,15 @@ gnus.pdf: ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi ${gfdl} | |||
| 440 | cp gnustmp.pdf $@ | 442 | cp gnustmp.pdf $@ |
| 441 | rm gnustmp.* | 443 | rm gnustmp.* |
| 442 | 444 | ||
| 445 | htmlfontify : $(buildinfodir)/htmlfontify$(INFO_EXT) | ||
| 446 | $(buildinfodir)/htmlfontify$(INFO_EXT): ${srcdir}/htmlfontify.texi ${gfdl} | ||
| 447 | $(mkinfodir) | ||
| 448 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/htmlfontify.texi | ||
| 449 | htmlfontify.dvi: ${srcdir}/htmlfontify.texi ${gfdl} | ||
| 450 | $(ENVADD) $(TEXI2DVI) ${srcdir}/htmlfontify.texi | ||
| 451 | htmlfontify.pdf: ${srcdir}/htmlfontify.texi ${gfdl} | ||
| 452 | $(ENVADD) $(TEXI2PDF) ${srcdir}/htmlfontify.texi | ||
| 453 | |||
| 443 | # NB this one needs --no-split even without a .info extension. | 454 | # NB this one needs --no-split even without a .info extension. |
| 444 | idlwave : $(buildinfodir)/idlwave$(INFO_EXT) | 455 | idlwave : $(buildinfodir)/idlwave$(INFO_EXT) |
| 445 | $(buildinfodir)/idlwave$(INFO_EXT): ${srcdir}/idlwave.texi ${gfdl} | 456 | $(buildinfodir)/idlwave$(INFO_EXT): ${srcdir}/idlwave.texi ${gfdl} |
diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi new file mode 100644 index 00000000000..d6904740778 --- /dev/null +++ b/doc/misc/htmlfontify.texi | |||
| @@ -0,0 +1,1609 @@ | |||
| 1 | \input texinfo | ||
| 2 | @comment %**start of header | ||
| 3 | @setfilename ../../info/htmlfontify | ||
| 4 | @settitle Htmlfontify User Manual | ||
| 5 | @exampleindent 2 | ||
| 6 | @comment %**end of header | ||
| 7 | |||
| 8 | @copying | ||
| 9 | This manual documents Htmlfontify, a source code -> crosslinked + | ||
| 10 | formatted + syntax colorised html transformer. | ||
| 11 | |||
| 12 | Copyright @copyright{} 2002, 2003, 2013 Free Software Foundation, Inc. | ||
| 13 | |||
| 14 | @quotation | ||
| 15 | Permission is granted to copy, distribute and/or modify this document | ||
| 16 | under the terms of the GNU Free Documentation License, Version 1.3 or | ||
| 17 | any later version published by the Free Software Foundation; with no | ||
| 18 | Invariant Sections, with the Front-Cover texts being ``A GNU Manual,'' | ||
| 19 | and with the Back-Cover Texts as in (a) below. A copy of the license | ||
| 20 | is included in the section entitled ``GNU Free Documentation License''. | ||
| 21 | |||
| 22 | (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and | ||
| 23 | modify this GNU manual.'' | ||
| 24 | @end quotation | ||
| 25 | @end copying | ||
| 26 | |||
| 27 | @dircategory Emacs misc features | ||
| 28 | @direntry | ||
| 29 | * Htmlfontify: (htmlfontify). Convert source code to html. | ||
| 30 | @end direntry | ||
| 31 | |||
| 32 | @titlepage | ||
| 33 | @title Htmlfontify User Manual | ||
| 34 | @sp 4 | ||
| 35 | @subtitle Htmlfontify version 0.20 | ||
| 36 | @sp 1 | ||
| 37 | @subtitle Jun 2002 | ||
| 38 | @sp 5 | ||
| 39 | @author Vivek Dasmohapatra | ||
| 40 | @page | ||
| 41 | |||
| 42 | @vskip 0pt plus 1filll | ||
| 43 | @noindent | ||
| 44 | @insertcopying | ||
| 45 | @end titlepage | ||
| 46 | |||
| 47 | @contents | ||
| 48 | |||
| 49 | @ifnottex | ||
| 50 | @node Top | ||
| 51 | @top Htmlfontify | ||
| 52 | |||
| 53 | @insertcopying | ||
| 54 | @end ifnottex | ||
| 55 | |||
| 56 | @menu | ||
| 57 | * Introduction:: About Htmlfontify. | ||
| 58 | * Usage & Examples:: How to use Htmlfontify. | ||
| 59 | * Customisation:: Fine-tuning Htmlfontify's behaviour. | ||
| 60 | * Requirements:: External programs used by Htmlfontify. | ||
| 61 | * GNU Free Documentation License:: The license for this documentation. | ||
| 62 | * Index:: Index of contents. | ||
| 63 | @end menu | ||
| 64 | |||
| 65 | @node Introduction | ||
| 66 | @chapter Introduction | ||
| 67 | @cindex Introduction | ||
| 68 | |||
| 69 | Htmlfontify provides a means of converting individual Emacs buffers, | ||
| 70 | source files, or entire source trees to html, preserving formatting | ||
| 71 | and Emacs colorisation / syntax highlighting as much as possible | ||
| 72 | through careful application of CSS stylesheets and html tags. | ||
| 73 | |||
| 74 | It can also turn instances of functions, methods and (for some | ||
| 75 | languages) variables and other constructs and items into links | ||
| 76 | to their definitions, and create an index file (or files) of | ||
| 77 | all such symbols, also linked to their points of definition. | ||
| 78 | |||
| 79 | Htmlfontify also provides several customisation items, which should | ||
| 80 | allow it to mesh more-or-less seamlessly with various templating or | ||
| 81 | publishing systems (in the event, for instance, that you don't want | ||
| 82 | to produce the html pages directly). | ||
| 83 | |||
| 84 | @node Usage & Examples | ||
| 85 | @chapter Usage & Examples | ||
| 86 | @cindex Usage & Examples | ||
| 87 | |||
| 88 | Htmlfontify can be used both interactively and as part of another | ||
| 89 | elisp function. If you're running it in a modern Emacs, it will also | ||
| 90 | run when attached to a terminal (i.e., without X) or even when in | ||
| 91 | batch mode. | ||
| 92 | |||
| 93 | @menu | ||
| 94 | * Interactive:: Using Htmlfontify interactively. | ||
| 95 | * Non-interactive:: Using Htmlfontify from elisp. | ||
| 96 | * Variables:: Variables (other than customisation entries). | ||
| 97 | * Data Structures:: Important data structures. | ||
| 98 | * Examples:: Example(s) of Htmlfontify in use. | ||
| 99 | @end menu | ||
| 100 | |||
| 101 | @node Interactive | ||
| 102 | @section Interactive | ||
| 103 | @cindex Interactive | ||
| 104 | @cindex functions (interactive) | ||
| 105 | |||
| 106 | Htmlfontify provides the following interactive functions: | ||
| 107 | |||
| 108 | @table @code | ||
| 109 | @item htmlfontify-buffer | ||
| 110 | @findex htmlfontify-buffer | ||
| 111 | @anchor{htmlfontify-buffer} | ||
| 112 | |||
| 113 | @lisp | ||
| 114 | |||
| 115 | (htmlfontify-buffer &optional @var{srcdir} @var{file}) | ||
| 116 | @end lisp | ||
| 117 | |||
| 118 | Create a new buffer, named for the current buffer + a .html extension, | ||
| 119 | containing an inline CSS-stylesheet and formatted CSS-markup html that | ||
| 120 | reproduces the look of the current Emacs buffer as closely as possible. | ||
| 121 | |||
| 122 | ``Dangerous'' characters in the existing buffer are turned into html | ||
| 123 | entities, so you should even be able to do html-within-html fontified | ||
| 124 | display. | ||
| 125 | |||
| 126 | You should, however, note that random control or eight-bit characters | ||
| 127 | such as ^L (\x0c) or ¤ (\xa4) won't get mapped yet. | ||
| 128 | |||
| 129 | If the @var{srcdir} and @var{file} arguments are set, lookup etags | ||
| 130 | derived entries in the @ref{hfy-tags-cache} and add html anchors | ||
| 131 | and hyperlinks as appropriate. | ||
| 132 | |||
| 133 | @item htmlfontify-run-etags | ||
| 134 | @findex htmlfontify-run-etags | ||
| 135 | @anchor{htmlfontify-run-etags} | ||
| 136 | |||
| 137 | @lisp | ||
| 138 | |||
| 139 | (htmlfontify-run-etags @var{srcdir}) | ||
| 140 | @end lisp | ||
| 141 | |||
| 142 | Load the etags cache for @var{srcdir}. See @ref{hfy-load-tags-cache}. | ||
| 143 | |||
| 144 | @item htmlfontify-copy-and-link-dir | ||
| 145 | @findex htmlfontify-copy-and-link-dir | ||
| 146 | @anchor{htmlfontify-copy-and-link-dir} | ||
| 147 | |||
| 148 | @lisp | ||
| 149 | |||
| 150 | (htmlfontify-copy-and-link-dir @var{srcdir} @var{dstdir} &optional @var{f-ext} @var{l-ext}) | ||
| 151 | @end lisp | ||
| 152 | |||
| 153 | Trawl @var{srcdir} and write fontified-and-hyperlinked output in | ||
| 154 | @var{dstdir}. @var{f-ext} and @var{l-ext} specify values for | ||
| 155 | @ref{hfy-extn} and @ref{hfy-link-extn}. | ||
| 156 | |||
| 157 | You may also want to set @ref{hfy-page-header} and @ref{hfy-page-footer}. | ||
| 158 | |||
| 159 | @item htmlfontify-load-rgb-file | ||
| 160 | @findex htmlfontify-load-rgb-file | ||
| 161 | @anchor{htmlfontify-load-rgb-file} | ||
| 162 | |||
| 163 | @lisp | ||
| 164 | |||
| 165 | (htmlfontify-load-rgb-file &optional @var{file}) | ||
| 166 | @end lisp | ||
| 167 | |||
| 168 | Load an X11 style rgb.txt file (search @code{hfy-rgb-load-path} if | ||
| 169 | @var{file} is not specified). | ||
| 170 | |||
| 171 | Note that this is not necessary if all you want is the standard X11 | ||
| 172 | (XFree86 4.1.0) color name -> rgb triplet mapping. Htmlfontify has | ||
| 173 | a copy built in, for use when it cannot contact an X server. | ||
| 174 | |||
| 175 | Loads the variable @code{hfy-rgb-txt-color-map}, which is used by | ||
| 176 | @ref{hfy-fallback-color-values}. | ||
| 177 | |||
| 178 | @item htmlfontify-unload-rgb-file | ||
| 179 | @findex htmlfontify-unload-rgb-file | ||
| 180 | @anchor{htmlfontify-unload-rgb-file} | ||
| 181 | |||
| 182 | @lisp | ||
| 183 | |||
| 184 | (htmlfontify-unload-rgb-file) | ||
| 185 | @end lisp | ||
| 186 | |||
| 187 | Unload the currently loaded X11 style rgb.txt file (if any). | ||
| 188 | @end table | ||
| 189 | |||
| 190 | @node Non-interactive | ||
| 191 | @section Non-interactive | ||
| 192 | @cindex Noninteractive | ||
| 193 | @cindex functions (noninteractive) | ||
| 194 | |||
| 195 | In addition to the aforementioned interactive methods, Htmlfontify | ||
| 196 | provides the following non-interactive ones: | ||
| 197 | |||
| 198 | @table @code | ||
| 199 | @comment AUTOGENERATED BLOCK | ||
| 200 | |||
| 201 | @item hfy-face-to-style | ||
| 202 | @findex hfy-face-to-style | ||
| 203 | @anchor{hfy-face-to-style} | ||
| 204 | |||
| 205 | @lisp | ||
| 206 | |||
| 207 | (hfy-face-to-style @var{fn}) | ||
| 208 | @end lisp | ||
| 209 | |||
| 210 | Take @var{fn}, a font or @code{defface} style font specification, | ||
| 211 | (as returned by @code{face-attr-construct} or @ref{hfy-face-attr-for-class}) | ||
| 212 | and return a @ref{hfy-style-assoc}. | ||
| 213 | |||
| 214 | See also: @ref{hfy-face-to-style-i}, @ref{hfy-flatten-style}. | ||
| 215 | |||
| 216 | @item hfy-fallback-color-values | ||
| 217 | @findex hfy-fallback-color-values | ||
| 218 | @anchor{hfy-fallback-color-values} | ||
| 219 | |||
| 220 | @lisp | ||
| 221 | |||
| 222 | (hfy-fallback-color-values @var{color-string}) | ||
| 223 | @end lisp | ||
| 224 | |||
| 225 | Use a fallback method for obtaining the rgb values for a color. | ||
| 226 | If @ref{htmlfontify-load-rgb-file} has been called, it uses the | ||
| 227 | color map specified, otherwise it uses Htmlfontify's built in map. | ||
| 228 | |||
| 229 | @item hfy-combined-face-spec | ||
| 230 | @findex hfy-combined-face-spec | ||
| 231 | @anchor{hfy-combined-face-spec} | ||
| 232 | |||
| 233 | @lisp | ||
| 234 | |||
| 235 | (hfy-combined-face-spec @var{face}) | ||
| 236 | @end lisp | ||
| 237 | |||
| 238 | Return a @code{defface} style alist of possible specifications for | ||
| 239 | @var{face}, with any entries resulting from user customisation | ||
| 240 | (@code{custom-set-faces}) taking precedence. | ||
| 241 | |||
| 242 | See also: @ref{hfy-default-face-def} | ||
| 243 | |||
| 244 | @item hfy-word-regex | ||
| 245 | @findex hfy-word-regex | ||
| 246 | @anchor{hfy-word-regex} | ||
| 247 | |||
| 248 | @lisp | ||
| 249 | |||
| 250 | (hfy-word-regex @var{string}) | ||
| 251 | @end lisp | ||
| 252 | |||
| 253 | Return a regex that matches @var{string} as the first @code{match-string}, | ||
| 254 | with non word characters on either side (vaguely emulating the perl @code{\b} | ||
| 255 | regex atom). | ||
| 256 | |||
| 257 | @item hfy-force-fontification | ||
| 258 | @findex hfy-force-fontification | ||
| 259 | @anchor{hfy-force-fontification} | ||
| 260 | |||
| 261 | @lisp | ||
| 262 | |||
| 263 | (hfy-force-fontification) | ||
| 264 | @end lisp | ||
| 265 | |||
| 266 | Emacs's fontification is designed for interactive use. As such, it sometimes | ||
| 267 | does things like deferring fontification until a section of the buffer is | ||
| 268 | exposed and rendered, or until Emacs is idle for a while. Sometimes, in | ||
| 269 | non-interactive circumstances, or if it can't see X, it doesn't bother | ||
| 270 | with some of the harder stuff. While this is all great from the perspective | ||
| 271 | of a user waiting for Emacs to load a 20000 line file and colorise it, | ||
| 272 | it's a pain from the point of view from non-interactive code. This function | ||
| 273 | lies, cheats, steals and generally bullies Emacs into fontifying a buffer | ||
| 274 | from start to finish, with all the extra frills, whether it thinks it nneds | ||
| 275 | to or not. Oh yes: it operates on the current buffer. | ||
| 276 | |||
| 277 | @item hfy-link-style-string | ||
| 278 | @findex hfy-link-style-string | ||
| 279 | @anchor{hfy-link-style-string} | ||
| 280 | |||
| 281 | @lisp | ||
| 282 | |||
| 283 | (hfy-link-style-string @var{style-string}) | ||
| 284 | @end lisp | ||
| 285 | |||
| 286 | Replace the end of a CSS style declaration @var{style-string} with the contents | ||
| 287 | of the variable @ref{hfy-src-doc-link-style}, removing text matching the | ||
| 288 | regex @ref{hfy-src-doc-link-unstyle} first, if necessary. | ||
| 289 | |||
| 290 | |||
| 291 | @item hfy-prepare-index-i | ||
| 292 | @findex hfy-prepare-index-i | ||
| 293 | @anchor{hfy-prepare-index-i} | ||
| 294 | |||
| 295 | @lisp | ||
| 296 | |||
| 297 | (hfy-prepare-index-i @var{srcdir} @var{dstdir} @var{filename} &optional @var{stub} @var{map}) | ||
| 298 | @end lisp | ||
| 299 | |||
| 300 | Prepare a tags index buffer for @var{srcdir}. | ||
| 301 | @ref{hfy-tags-cache} must already have an entry for @var{srcdir} for | ||
| 302 | this to work. @ref{hfy-page-header}, @ref{hfy-page-footer}, | ||
| 303 | @ref{hfy-link-extn} and @ref{hfy-extn} all play a part here. | ||
| 304 | |||
| 305 | If @var{stub} is set, prepare an (appropriately named) index buffer | ||
| 306 | specifically for entries beginning with @var{stub}. | ||
| 307 | |||
| 308 | If @var{map} is set, use that instead of @ref{hfy-tags-cache}. | ||
| 309 | |||
| 310 | @item hfy-compile-stylesheet | ||
| 311 | @findex hfy-compile-stylesheet | ||
| 312 | @anchor{hfy-compile-stylesheet} | ||
| 313 | |||
| 314 | @lisp | ||
| 315 | |||
| 316 | (hfy-compile-stylesheet) | ||
| 317 | @end lisp | ||
| 318 | |||
| 319 | Trawl the current buffer, construct and return a @ref{hfy-sheet-assoc}. | ||
| 320 | |||
| 321 | @item hfy-css-name | ||
| 322 | @findex hfy-css-name | ||
| 323 | @anchor{hfy-css-name} | ||
| 324 | |||
| 325 | @lisp | ||
| 326 | |||
| 327 | (hfy-css-name @var{fn}) | ||
| 328 | @end lisp | ||
| 329 | |||
| 330 | Strip some of the boring bits from a font-name and return a CSS style | ||
| 331 | name. If @var{fn} is a @code{defface} attribute list, either construct | ||
| 332 | a name for it, store it in the cache, and return it, or just fetch it | ||
| 333 | from the cache if it's already there. | ||
| 334 | |||
| 335 | @item hfy-make-directory | ||
| 336 | @findex hfy-make-directory | ||
| 337 | @anchor{hfy-make-directory} | ||
| 338 | |||
| 339 | @lisp | ||
| 340 | |||
| 341 | (hfy-make-directory @var{dir}) | ||
| 342 | @end lisp | ||
| 343 | |||
| 344 | Approximate equivalent of @code{mkdir -p @var{dir}}. | ||
| 345 | |||
| 346 | @item hfy-triplet | ||
| 347 | @findex hfy-triplet | ||
| 348 | @anchor{hfy-triplet} | ||
| 349 | |||
| 350 | @lisp | ||
| 351 | |||
| 352 | (hfy-triplet @var{color}) | ||
| 353 | @end lisp | ||
| 354 | |||
| 355 | Takes a color name (string) and return a CSS rgb(R, G, B) triplet string. | ||
| 356 | Uses the definition of ``white'' to map the numbers to the 0-255 range, so | ||
| 357 | if you've redefined white, (especially if you've redefined it to have | ||
| 358 | a triplet member lower than that of the color you are processing, | ||
| 359 | strange things may happen). | ||
| 360 | |||
| 361 | @item hfy-default-footer | ||
| 362 | @findex hfy-default-footer | ||
| 363 | @anchor{hfy-default-footer} | ||
| 364 | |||
| 365 | @lisp | ||
| 366 | |||
| 367 | (hfy-default-footer @var{file}) | ||
| 368 | @end lisp | ||
| 369 | |||
| 370 | Default value for @ref{hfy-page-footer} | ||
| 371 | |||
| 372 | @item hfy-list-files | ||
| 373 | @findex hfy-list-files | ||
| 374 | @anchor{hfy-list-files} | ||
| 375 | |||
| 376 | @lisp | ||
| 377 | |||
| 378 | (hfy-list-files @var{directory}) | ||
| 379 | @end lisp | ||
| 380 | |||
| 381 | Return a list of files under @var{directory}. | ||
| 382 | Strips any leading @samp{./} from each filename. | ||
| 383 | |||
| 384 | @item hfy-color-vals | ||
| 385 | @findex hfy-color-vals | ||
| 386 | @anchor{hfy-color-vals} | ||
| 387 | |||
| 388 | @lisp | ||
| 389 | |||
| 390 | (hfy-color-vals @var{color}) | ||
| 391 | @end lisp | ||
| 392 | |||
| 393 | Where @var{color} is a color name or #XXXXXX style triplet, return a list of | ||
| 394 | 3 (16 bit) rgb values for said color. If a window system is unavailable, | ||
| 395 | calls @ref{hfy-fallback-color-values}. | ||
| 396 | |||
| 397 | @item hfy-href-stub | ||
| 398 | @findex hfy-href-stub | ||
| 399 | @anchor{hfy-href-stub} | ||
| 400 | |||
| 401 | @lisp | ||
| 402 | |||
| 403 | (hfy-href-stub @var{this-file} @var{def-files} @var{tag}) | ||
| 404 | @end lisp | ||
| 405 | |||
| 406 | Return an href stub for a tag href: if @var{def-files} (list of files | ||
| 407 | containing definitions for the tag in question) contains only one entry, | ||
| 408 | the href should link straight to that file. Otherwise, the link should | ||
| 409 | be to the index file. | ||
| 410 | |||
| 411 | We are not yet concerned with the file extensions/tag line number and | ||
| 412 | so on at this point. | ||
| 413 | |||
| 414 | If @ref{hfy-split-index} is set, and the href will be to an index file | ||
| 415 | rather than a source file, append a @samp{.X} to @ref{hfy-index-file}, where | ||
| 416 | @samp{X} is the uppercased first character of @var{tag}. | ||
| 417 | |||
| 418 | See also: @ref{hfy-relstub}, @ref{hfy-index-file}. | ||
| 419 | |||
| 420 | @item hfy-line-number | ||
| 421 | @findex hfy-line-number | ||
| 422 | @anchor{hfy-line-number} | ||
| 423 | |||
| 424 | @lisp | ||
| 425 | |||
| 426 | (hfy-line-number) | ||
| 427 | @end lisp | ||
| 428 | |||
| 429 | Returns the line number of the point in the current buffer. | ||
| 430 | |||
| 431 | @item hfy-merge-adjacent-spans | ||
| 432 | @findex hfy-merge-adjacent-spans | ||
| 433 | @anchor{hfy-merge-adjacent-spans} | ||
| 434 | |||
| 435 | @lisp | ||
| 436 | |||
| 437 | (hfy-merge-adjacent-spans @var{face-map}) | ||
| 438 | @end lisp | ||
| 439 | |||
| 440 | Where @var{face-map} is a @ref{hfy-facemap-assoc} for the current buffer, | ||
| 441 | this function merges adjacent style blocks which are of the same value | ||
| 442 | and are separated by nothing more interesting than whitespace. | ||
| 443 | |||
| 444 | @code{<span class="foo">narf</span> <span class="foo">brain</span>} | ||
| 445 | |||
| 446 | (as interpreted from @var{face-map}) would become: | ||
| 447 | |||
| 448 | @code{<span class="foo">narf brain</span>} | ||
| 449 | |||
| 450 | Returns a modified copy of @var{face-map} (also a @ref{hfy-facemap-assoc}). | ||
| 451 | |||
| 452 | @item hfy-mark-tag-names | ||
| 453 | @findex hfy-mark-tag-names | ||
| 454 | @anchor{hfy-mark-tag-names} | ||
| 455 | |||
| 456 | @lisp | ||
| 457 | |||
| 458 | (hfy-mark-tag-names @var{srcdir} @var{file}) | ||
| 459 | @end lisp | ||
| 460 | |||
| 461 | Mark tags in @var{file} (lookup @var{srcdir} in @ref{hfy-tags-cache}) with the | ||
| 462 | @code{hfy-anchor} property, with a value of @samp{tag.line-number}. | ||
| 463 | |||
| 464 | @item hfy-weight | ||
| 465 | @findex hfy-weight | ||
| 466 | @anchor{hfy-weight} | ||
| 467 | |||
| 468 | @lisp | ||
| 469 | |||
| 470 | (hfy-weight @var{weight}) | ||
| 471 | @end lisp | ||
| 472 | |||
| 473 | Derive a font-weight CSS specifier from an Emacs weight specification symbol. | ||
| 474 | |||
| 475 | @item hfy-size | ||
| 476 | @findex hfy-size | ||
| 477 | @anchor{hfy-size} | ||
| 478 | |||
| 479 | @lisp | ||
| 480 | |||
| 481 | (hfy-size @var{height}) | ||
| 482 | @end lisp | ||
| 483 | |||
| 484 | Derive a CSS font-size specifier from an Emacs font @code{:height} attribute. | ||
| 485 | Does not cope with the case where height is a function to be applied to | ||
| 486 | the height of the underlying font. | ||
| 487 | |||
| 488 | @item hfy-default-header | ||
| 489 | @findex hfy-default-header | ||
| 490 | @anchor{hfy-default-header} | ||
| 491 | |||
| 492 | @lisp | ||
| 493 | |||
| 494 | (hfy-default-header @var{file} @var{style}) | ||
| 495 | @end lisp | ||
| 496 | |||
| 497 | Default value for @ref{hfy-page-header} | ||
| 498 | |||
| 499 | @item hfy-family | ||
| 500 | @findex hfy-family | ||
| 501 | @anchor{hfy-family} | ||
| 502 | |||
| 503 | @lisp | ||
| 504 | |||
| 505 | (hfy-family @var{family}) | ||
| 506 | @end lisp | ||
| 507 | |||
| 508 | Derives a CSS font-family specifier from an Emacs @code{:family} attribute. | ||
| 509 | |||
| 510 | @item hfy-mark-tag-hrefs | ||
| 511 | @findex hfy-mark-tag-hrefs | ||
| 512 | @anchor{hfy-mark-tag-hrefs} | ||
| 513 | |||
| 514 | @lisp | ||
| 515 | |||
| 516 | (hfy-mark-tag-hrefs @var{srcdir} @var{file}) | ||
| 517 | @end lisp | ||
| 518 | |||
| 519 | Mark href start points with the @code{hfy-link} property (value: href string). | ||
| 520 | |||
| 521 | Mark href end points with the @code{hfy-endl} property (value @code{t}). | ||
| 522 | |||
| 523 | Avoid overlapping links, and mark links in descending length of | ||
| 524 | tag name in order to prevent subtags from usurping supertags; | ||
| 525 | e.g., ``term'' for ``terminal''). | ||
| 526 | |||
| 527 | @item hfy-box | ||
| 528 | @findex hfy-box | ||
| 529 | @anchor{hfy-box} | ||
| 530 | |||
| 531 | @lisp | ||
| 532 | |||
| 533 | (hfy-box @var{box}) | ||
| 534 | @end lisp | ||
| 535 | |||
| 536 | Derive CSS border-* attributes from the Emacs @code{:box} attribute. | ||
| 537 | |||
| 538 | @item hfy-box-to-style | ||
| 539 | @findex hfy-box-to-style | ||
| 540 | @anchor{hfy-box-to-style} | ||
| 541 | |||
| 542 | @lisp | ||
| 543 | |||
| 544 | (hfy-box-to-style @var{spec}) | ||
| 545 | @end lisp | ||
| 546 | |||
| 547 | Convert a complex @code{:box} Emacs font attribute set to a list of | ||
| 548 | CSS border-* attributes. Don't call this directly---it is called by | ||
| 549 | @ref{hfy-box} when necessary. | ||
| 550 | |||
| 551 | @item hfy-html-enkludge-buffer | ||
| 552 | @findex hfy-html-enkludge-buffer | ||
| 553 | @anchor{hfy-html-enkludge-buffer} | ||
| 554 | |||
| 555 | @lisp | ||
| 556 | |||
| 557 | (hfy-html-enkludge-buffer) | ||
| 558 | @end lisp | ||
| 559 | |||
| 560 | Mark dangerous @samp{["<>]} characters with the @code{hfy-quoteme} property. | ||
| 561 | |||
| 562 | See also @ref{hfy-html-dekludge-buffer}. | ||
| 563 | |||
| 564 | @item hfy-buffer | ||
| 565 | @findex hfy-buffer | ||
| 566 | @anchor{hfy-buffer} | ||
| 567 | |||
| 568 | @lisp | ||
| 569 | |||
| 570 | (hfy-buffer) | ||
| 571 | @end lisp | ||
| 572 | |||
| 573 | Generate and return an Htmlfontify html output buffer for the current | ||
| 574 | buffer. May trample an existing buffer. | ||
| 575 | |||
| 576 | @item hfy-fontified-p | ||
| 577 | @findex hfy-fontified-p | ||
| 578 | @anchor{hfy-fontified-p} | ||
| 579 | |||
| 580 | @lisp | ||
| 581 | |||
| 582 | (hfy-fontified-p) | ||
| 583 | @end lisp | ||
| 584 | |||
| 585 | @code{font-lock} doesn't like to say a buffer's been fontified when in | ||
| 586 | batch mode, but we want to know if we should fontify or raw copy, so in | ||
| 587 | batch mode we check for non-default face properties. Otherwise we test | ||
| 588 | @code{font-lock-mode} and @code{font-lock-fontified} for truth. | ||
| 589 | |||
| 590 | @item hfy-lookup | ||
| 591 | @findex hfy-lookup | ||
| 592 | @anchor{hfy-lookup} | ||
| 593 | |||
| 594 | @lisp | ||
| 595 | |||
| 596 | (hfy-lookup @var{face} @var{style}) | ||
| 597 | @end lisp | ||
| 598 | |||
| 599 | Where @var{style} is a @ref{hfy-sheet-assoc} and @var{face} is an Emacs face, | ||
| 600 | return the relevant @var{css} style name. | ||
| 601 | |||
| 602 | @item hfy-fontify-buffer | ||
| 603 | @findex hfy-fontify-buffer | ||
| 604 | @anchor{hfy-fontify-buffer} | ||
| 605 | |||
| 606 | @lisp | ||
| 607 | |||
| 608 | (hfy-fontify-buffer &optional @var{srcdir} @var{file}) | ||
| 609 | @end lisp | ||
| 610 | |||
| 611 | Implement the guts of @ref{htmlfontify-buffer}. | ||
| 612 | |||
| 613 | @item hfy-color | ||
| 614 | @findex hfy-color | ||
| 615 | @anchor{hfy-color} | ||
| 616 | |||
| 617 | @lisp | ||
| 618 | |||
| 619 | (hfy-color @var{color}) | ||
| 620 | @end lisp | ||
| 621 | |||
| 622 | Convert an Emacs :foreground property to a CSS color property. | ||
| 623 | |||
| 624 | @item hfy-flatten-style | ||
| 625 | @findex hfy-flatten-style | ||
| 626 | @anchor{hfy-flatten-style} | ||
| 627 | |||
| 628 | @lisp | ||
| 629 | |||
| 630 | (hfy-flatten-style @var{style}) | ||
| 631 | @end lisp | ||
| 632 | |||
| 633 | Take @var{style} (see @ref{hfy-face-to-style-i}, @ref{hfy-face-to-style}) | ||
| 634 | and merge any multiple attributes appropriately. Currently only font-size is | ||
| 635 | merged down to a single occurrence---others may need special handling, but I | ||
| 636 | haven't encountered them yet. Returns a @ref{hfy-style-assoc}. | ||
| 637 | |||
| 638 | @item hfy-size-to-int | ||
| 639 | @findex hfy-size-to-int | ||
| 640 | @anchor{hfy-size-to-int} | ||
| 641 | |||
| 642 | @lisp | ||
| 643 | |||
| 644 | (hfy-size-to-int @var{spec}) | ||
| 645 | @end lisp | ||
| 646 | |||
| 647 | Convert @var{spec}, a CSS font-size specifier, back to an Emacs | ||
| 648 | @code{:height} attribute value. Used while merging multiple font-size | ||
| 649 | attributes. | ||
| 650 | |||
| 651 | @item hfy-sprintf-stylesheet | ||
| 652 | @findex hfy-sprintf-stylesheet | ||
| 653 | @anchor{hfy-sprintf-stylesheet} | ||
| 654 | |||
| 655 | @lisp | ||
| 656 | |||
| 657 | (hfy-sprintf-stylesheet @var{css} @var{file}) | ||
| 658 | @end lisp | ||
| 659 | |||
| 660 | Generates a header, via @ref{hfy-page-header}, for @var{file}, containing the | ||
| 661 | stylesheet derived from @var{css}, which is a @ref{hfy-sheet-assoc}. Returns a | ||
| 662 | string containing the same. | ||
| 663 | |||
| 664 | @item hfy-relstub | ||
| 665 | @findex hfy-relstub | ||
| 666 | @anchor{hfy-relstub} | ||
| 667 | |||
| 668 | @lisp | ||
| 669 | |||
| 670 | (hfy-relstub @var{file} &optional @var{start}) | ||
| 671 | @end lisp | ||
| 672 | |||
| 673 | Return a @samp{../} stub of the appropriate length for the current source | ||
| 674 | tree depth (as determined from @var{file}). @c iyswim. | ||
| 675 | |||
| 676 | @item hfy-compile-face-map | ||
| 677 | @findex hfy-compile-face-map | ||
| 678 | @anchor{hfy-compile-face-map} | ||
| 679 | |||
| 680 | @lisp | ||
| 681 | |||
| 682 | (hfy-compile-face-map) | ||
| 683 | @end lisp | ||
| 684 | |||
| 685 | Compile and return a @ref{hfy-facemap-assoc} for the current buffer. | ||
| 686 | |||
| 687 | @item hfy-prepare-index | ||
| 688 | @findex hfy-prepare-index | ||
| 689 | @anchor{hfy-prepare-index} | ||
| 690 | |||
| 691 | @lisp | ||
| 692 | |||
| 693 | (hfy-prepare-index @var{srcdir} @var{dstdir}) | ||
| 694 | @end lisp | ||
| 695 | |||
| 696 | Return as list of index buffer(s), as determined by @ref{hfy-split-index}. | ||
| 697 | Uses @ref{hfy-prepare-index-i} to do this. | ||
| 698 | |||
| 699 | @item hfy-prepare-tag-map | ||
| 700 | @findex hfy-prepare-tag-map | ||
| 701 | @anchor{hfy-prepare-tag-map} | ||
| 702 | |||
| 703 | @lisp | ||
| 704 | |||
| 705 | (hfy-prepare-tag-map @var{srcdir} @var{dstdir}) | ||
| 706 | @end lisp | ||
| 707 | |||
| 708 | Prepare the counterpart(s) to the index buffer(s)---a list of buffers with | ||
| 709 | the same structure, but listing (and linking to) instances of tags (as | ||
| 710 | opposed to their definitions). | ||
| 711 | |||
| 712 | See also: @ref{hfy-prepare-index}, @ref{hfy-split-index} | ||
| 713 | |||
| 714 | @item hfy-subtract-maps | ||
| 715 | @findex hfy-subtract-maps | ||
| 716 | @anchor{hfy-subtract-maps} | ||
| 717 | |||
| 718 | @lisp | ||
| 719 | |||
| 720 | (hfy-subtract-maps @var{srcdir}) | ||
| 721 | @end lisp | ||
| 722 | |||
| 723 | Internal function---strips definitions of tags from the instance map. | ||
| 724 | See: @ref{hfy-tags-cache} and @ref{hfy-tags-rmap} | ||
| 725 | |||
| 726 | @item hfy-face-to-style-i | ||
| 727 | @findex hfy-face-to-style-i | ||
| 728 | @anchor{hfy-face-to-style-i} | ||
| 729 | |||
| 730 | @lisp | ||
| 731 | |||
| 732 | (hfy-face-to-style-i @var{fn}) | ||
| 733 | @end lisp | ||
| 734 | |||
| 735 | The guts of @ref{hfy-face-to-style}. @var{fn} should be a @code{defface} | ||
| 736 | font specification, as returned by @code{face-attr-construct} or | ||
| 737 | @ref{hfy-face-attr-for-class}. Note that this function does not get | ||
| 738 | font-sizes right if they are based on inherited modifiers (via the | ||
| 739 | :inherit) attribute, and any other modifiers that are cumulative if they | ||
| 740 | appear multiple times need to be merged by the user---@ref{hfy-flatten-style} | ||
| 741 | should do this. | ||
| 742 | |||
| 743 | @item hfy-face-to-css | ||
| 744 | @findex hfy-face-to-css | ||
| 745 | @anchor{hfy-face-to-css} | ||
| 746 | |||
| 747 | @lisp | ||
| 748 | |||
| 749 | (hfy-face-to-css @var{fn}) | ||
| 750 | @end lisp | ||
| 751 | |||
| 752 | Take @var{fn}, a font or @code{defface} specification (c.f. | ||
| 753 | @code{face-attr-construct}) and return a CSS style specification. | ||
| 754 | |||
| 755 | See also: @ref{hfy-face-to-style} | ||
| 756 | |||
| 757 | @item hfy-html-quote | ||
| 758 | @findex hfy-html-quote | ||
| 759 | @anchor{hfy-html-quote} | ||
| 760 | |||
| 761 | @lisp | ||
| 762 | |||
| 763 | (hfy-html-quote @var{char-string}) | ||
| 764 | @end lisp | ||
| 765 | |||
| 766 | Map a string (usually 1 character long) to an html safe string | ||
| 767 | (entity) if need be. | ||
| 768 | |||
| 769 | @item hfy-link-style | ||
| 770 | @findex hfy-link-style | ||
| 771 | @anchor{hfy-link-style} | ||
| 772 | |||
| 773 | @lisp | ||
| 774 | |||
| 775 | (hfy-link-style @var{style-string}) | ||
| 776 | @end lisp | ||
| 777 | |||
| 778 | Convert the CSS style spec @var{style-string} to its equivalent | ||
| 779 | hyperlink style. | ||
| 780 | |||
| 781 | See: @ref{hfy-link-style-fun}. | ||
| 782 | |||
| 783 | @item hfy-p-to-face | ||
| 784 | @findex hfy-p-to-face | ||
| 785 | @anchor{hfy-p-to-face} | ||
| 786 | |||
| 787 | @lisp | ||
| 788 | |||
| 789 | (hfy-p-to-face @var{props}) | ||
| 790 | @end lisp | ||
| 791 | |||
| 792 | Given @var{props}, a list of text-properties, return the value of the | ||
| 793 | face property, or nil. | ||
| 794 | |||
| 795 | @item hfy-box-to-border-assoc | ||
| 796 | @findex hfy-box-to-border-assoc | ||
| 797 | @anchor{hfy-box-to-border-assoc} | ||
| 798 | |||
| 799 | @lisp | ||
| 800 | |||
| 801 | (hfy-box-to-border-assoc @var{spec}) | ||
| 802 | @end lisp | ||
| 803 | |||
| 804 | Helper function for @ref{hfy-box-to-style}. | ||
| 805 | |||
| 806 | @item hfy-face-attr-for-class | ||
| 807 | @findex hfy-face-attr-for-class | ||
| 808 | @anchor{hfy-face-attr-for-class} | ||
| 809 | |||
| 810 | @lisp | ||
| 811 | |||
| 812 | (hfy-face-attr-for-class @var{face} &optional @var{class}) | ||
| 813 | @end lisp | ||
| 814 | |||
| 815 | Return the face attributes for @var{face}. If @var{class} is set, it | ||
| 816 | must be a @code{defface} alist key [see below]. Prior to version 0.18, | ||
| 817 | the first face specification returned by @ref{hfy-combined-face-spec} | ||
| 818 | which @emph{didn't} clash with @var{class} was returned. In versions | ||
| 819 | from 0.18 onwards, each font attribute list is scored, and the | ||
| 820 | non-conflicting list with the highest score is returned. (A specification | ||
| 821 | with a class of @code{t} is considered to match any class you specify. | ||
| 822 | This matches Emacs's behaviour when deciding on which face attributes to | ||
| 823 | use, to the best of my understanding ). | ||
| 824 | |||
| 825 | If @var{class} is nil, then you just get get whatever | ||
| 826 | @code{face-attr-construct} returns; i.e., the current specification in | ||
| 827 | effect for @var{face}. | ||
| 828 | |||
| 829 | See @ref{hfy-display-class} for details of valid values for @var{class}. | ||
| 830 | |||
| 831 | @item hfy-face-at | ||
| 832 | @findex hfy-face-at | ||
| 833 | @anchor{hfy-face-at} | ||
| 834 | |||
| 835 | @lisp | ||
| 836 | |||
| 837 | (hfy-face-at P) | ||
| 838 | @end lisp | ||
| 839 | |||
| 840 | Find face in effect at point P. If overlays are to be considered | ||
| 841 | (see @ref{hfy-optimisations}) then this may return a @code{defface} style | ||
| 842 | list of face properties instead of a face symbol. | ||
| 843 | |||
| 844 | @item hfy-bgcol | ||
| 845 | @findex hfy-bgcol | ||
| 846 | @anchor{hfy-bgcol} | ||
| 847 | |||
| 848 | @lisp | ||
| 849 | |||
| 850 | (hfy-bgcol @var{color}) | ||
| 851 | @end lisp | ||
| 852 | |||
| 853 | As per @ref{hfy-color} but for background colors. | ||
| 854 | |||
| 855 | @item hfy-kludge-cperl-mode | ||
| 856 | @findex hfy-kludge-cperl-mode | ||
| 857 | @anchor{hfy-kludge-cperl-mode} | ||
| 858 | |||
| 859 | @lisp | ||
| 860 | |||
| 861 | (hfy-kludge-cperl-mode) | ||
| 862 | @end lisp | ||
| 863 | |||
| 864 | cperl mode does its damndest not to do some of its fontification when not | ||
| 865 | in a windowing system---we try to trick it@dots{} | ||
| 866 | |||
| 867 | @item hfy-href | ||
| 868 | @findex hfy-href | ||
| 869 | @anchor{hfy-href} | ||
| 870 | |||
| 871 | @lisp | ||
| 872 | |||
| 873 | (hfy-href @var{this-file} @var{def-files} @var{tag} @var{tag-map}) | ||
| 874 | @end lisp | ||
| 875 | |||
| 876 | Return a relative href to the tag in question, based on | ||
| 877 | |||
| 878 | @var{this-file} @ref{hfy-link-extn} @ref{hfy-extn} @var{def-files} @var{tag} and @var{tag-map} | ||
| 879 | |||
| 880 | @var{this-file} is the current source file | ||
| 881 | @var{def-files} is a list of file containing possible link endpoints for @var{tag} | ||
| 882 | @var{tag} is the @var{tag} in question | ||
| 883 | @var{tag-map} is the entry in @ref{hfy-tags-cache}. | ||
| 884 | |||
| 885 | @item hfy-shell | ||
| 886 | @findex hfy-shell | ||
| 887 | @anchor{hfy-shell} | ||
| 888 | |||
| 889 | @lisp | ||
| 890 | |||
| 891 | (hfy-shell) | ||
| 892 | @end lisp | ||
| 893 | |||
| 894 | Returns a best guess at a Bourne compatible shell to use: If the current | ||
| 895 | shell doesn't look promising, fall back to @ref{hfy-shell-file-name}. | ||
| 896 | |||
| 897 | @item hfy-load-tags-cache | ||
| 898 | @findex hfy-load-tags-cache | ||
| 899 | @anchor{hfy-load-tags-cache} | ||
| 900 | |||
| 901 | @lisp | ||
| 902 | |||
| 903 | (hfy-load-tags-cache @var{srcdir}) | ||
| 904 | @end lisp | ||
| 905 | |||
| 906 | Run @ref{hfy-etags-cmd} on @var{srcdir}: load @ref{hfy-tags-cache} and @ref{hfy-tags-sortl}. | ||
| 907 | |||
| 908 | @item hfy-parse-tags-buffer | ||
| 909 | @findex hfy-parse-tags-buffer | ||
| 910 | @anchor{hfy-parse-tags-buffer} | ||
| 911 | |||
| 912 | @lisp | ||
| 913 | |||
| 914 | (hfy-parse-tags-buffer @var{srcdir} @var{buffer}) | ||
| 915 | @end lisp | ||
| 916 | |||
| 917 | Parse a @var{buffer} containing etags formatted output, loading the | ||
| 918 | @ref{hfy-tags-cache} and @ref{hfy-tags-sortl} entries for @var{srcdir}. | ||
| 919 | |||
| 920 | @item hfy-interq | ||
| 921 | @findex hfy-interq | ||
| 922 | @anchor{hfy-interq} | ||
| 923 | |||
| 924 | @lisp | ||
| 925 | |||
| 926 | (hfy-interq @var{set-a} @var{set-b}) | ||
| 927 | @end lisp | ||
| 928 | |||
| 929 | Return the intersection (using @code{eq}) of 2 lists. | ||
| 930 | |||
| 931 | @item hfy-text-p | ||
| 932 | @findex hfy-text-p | ||
| 933 | @anchor{hfy-text-p} | ||
| 934 | |||
| 935 | @lisp | ||
| 936 | |||
| 937 | (hfy-text-p @var{srcdir} @var{file}) | ||
| 938 | @end lisp | ||
| 939 | |||
| 940 | Is @var{srcdir}/@var{file} text? Uses @ref{hfy-istext-command} to determine this. | ||
| 941 | |||
| 942 | @item hfy-opt | ||
| 943 | @findex hfy-opt | ||
| 944 | @anchor{hfy-opt} | ||
| 945 | |||
| 946 | @lisp | ||
| 947 | |||
| 948 | (hfy-opt @var{symbol}) | ||
| 949 | @end lisp | ||
| 950 | |||
| 951 | Is @ref{hfy-optimisations} member @var{symbol} set or not? | ||
| 952 | |||
| 953 | @item hfy-dirname | ||
| 954 | @findex hfy-dirname | ||
| 955 | @anchor{hfy-dirname} | ||
| 956 | |||
| 957 | @lisp | ||
| 958 | |||
| 959 | (hfy-dirname @var{file}) | ||
| 960 | @end lisp | ||
| 961 | |||
| 962 | Return everything preceding the last @samp{/} from a relative filename, | ||
| 963 | on the assumption that this will produce a relative directory name. Hardly | ||
| 964 | bombproof, but good enough in the context in which it is being used. | ||
| 965 | |||
| 966 | @item hfy-html-dekludge-buffer | ||
| 967 | @findex hfy-html-dekludge-buffer | ||
| 968 | @anchor{hfy-html-dekludge-buffer} | ||
| 969 | |||
| 970 | @lisp | ||
| 971 | |||
| 972 | (hfy-html-dekludge-buffer) | ||
| 973 | @end lisp | ||
| 974 | |||
| 975 | Transform all dangerous characters marked with the @code{hfy-quoteme} property | ||
| 976 | using @ref{hfy-html-quote} | ||
| 977 | |||
| 978 | See also @ref{hfy-html-enkludge-buffer}. | ||
| 979 | |||
| 980 | @item hfy-copy-and-fontify-file | ||
| 981 | @findex hfy-copy-and-fontify-file | ||
| 982 | @anchor{hfy-copy-and-fontify-file} | ||
| 983 | |||
| 984 | @lisp | ||
| 985 | |||
| 986 | (hfy-copy-and-fontify-file @var{srcdir} @var{dstdir} @var{file}) | ||
| 987 | @end lisp | ||
| 988 | |||
| 989 | Open @var{file} in @var{srcdir}---if fontified, write a fontified copy to @var{dstdir} | ||
| 990 | adding an extension of @ref{hfy-extn}. Fontification is actually done by | ||
| 991 | @ref{htmlfontify-buffer}. If the buffer is not fontified, just copy it. | ||
| 992 | |||
| 993 | @item hfy-decor | ||
| 994 | @findex hfy-decor | ||
| 995 | @anchor{hfy-decor} | ||
| 996 | |||
| 997 | @lisp | ||
| 998 | |||
| 999 | (hfy-decor @var{tag} @var{val}) | ||
| 1000 | @end lisp | ||
| 1001 | |||
| 1002 | Derive CSS text-decoration specifiers from various Emacs font attributes. | ||
| 1003 | |||
| 1004 | @item hfy-slant | ||
| 1005 | @findex hfy-slant | ||
| 1006 | @anchor{hfy-slant} | ||
| 1007 | |||
| 1008 | @lisp | ||
| 1009 | |||
| 1010 | (hfy-slant @var{slant}) | ||
| 1011 | @end lisp | ||
| 1012 | |||
| 1013 | Derive a font-style CSS specifier from the Emacs :slant | ||
| 1014 | attribute---CSS does not define the reverse-* styles, so just maps | ||
| 1015 | those to the regular specifiers. | ||
| 1016 | |||
| 1017 | @item hfy-tags-for-file | ||
| 1018 | @findex hfy-tags-for-file | ||
| 1019 | @anchor{hfy-tags-for-file} | ||
| 1020 | |||
| 1021 | @lisp | ||
| 1022 | |||
| 1023 | (hfy-tags-for-file @var{srcdir} @var{file}) | ||
| 1024 | @end lisp | ||
| 1025 | |||
| 1026 | List of etags tags that have definitions in this @var{file}. Looks up | ||
| 1027 | the tags cache in @ref{hfy-tags-cache} using @var{srcdir} as the key. | ||
| 1028 | |||
| 1029 | @item hfy-width | ||
| 1030 | @findex hfy-width | ||
| 1031 | @anchor{hfy-width} | ||
| 1032 | |||
| 1033 | @lisp | ||
| 1034 | |||
| 1035 | (hfy-width @var{width}) | ||
| 1036 | @end lisp | ||
| 1037 | |||
| 1038 | Convert an Emacs @code{:width} attribute to a CSS font-stretch attribute. | ||
| 1039 | |||
| 1040 | @comment /AUTOGENERATED BLOCK | ||
| 1041 | @end table | ||
| 1042 | |||
| 1043 | @node Variables | ||
| 1044 | @section Variables | ||
| 1045 | @cindex variables | ||
| 1046 | |||
| 1047 | Important variables that are not customisation items: | ||
| 1048 | |||
| 1049 | @table @code | ||
| 1050 | |||
| 1051 | @item hfy-tags-cache | ||
| 1052 | @vindex hfy-tags-cache | ||
| 1053 | @anchor{hfy-tags-cache} | ||
| 1054 | |||
| 1055 | This is an alist of the form: | ||
| 1056 | |||
| 1057 | @example | ||
| 1058 | (("/src/dir/0" . tag-hash0) ("/src/dir/1" tag-hash1) @dots{} ) | ||
| 1059 | @end example | ||
| 1060 | |||
| 1061 | Each tag hash entry then contains entries of the form: | ||
| 1062 | |||
| 1063 | @example | ||
| 1064 | "tag_string" => (("file/name.ext" line char) @dots{} ) | ||
| 1065 | @end example | ||
| 1066 | |||
| 1067 | i.e., an alist mapping (relative) file paths to line and character offsets. | ||
| 1068 | |||
| 1069 | See @ref{hfy-load-tags-cache}. | ||
| 1070 | |||
| 1071 | @item hfy-tags-rmap | ||
| 1072 | @vindex hfy-tags-rmap | ||
| 1073 | @anchor{hfy-tags-rmap} | ||
| 1074 | |||
| 1075 | @code{hfy-tags-rmap} is an alist of the form: | ||
| 1076 | |||
| 1077 | @lisp | ||
| 1078 | (("/src/dir" . tag-rmap-hash)) | ||
| 1079 | @end lisp | ||
| 1080 | |||
| 1081 | Where tag-rmap-hash has entries of the form: | ||
| 1082 | |||
| 1083 | @example | ||
| 1084 | "tag_string" => ( "file/name.ext" line char ) | ||
| 1085 | @end example | ||
| 1086 | |||
| 1087 | Unlike @ref{hfy-tags-cache} these are the locations of occurrences of | ||
| 1088 | tagged items, not the locations of their definitions. | ||
| 1089 | |||
| 1090 | @item hfy-tags-sortl | ||
| 1091 | @vindex hfy-tags-sortl | ||
| 1092 | @anchor{hfy-tags-sortl} | ||
| 1093 | |||
| 1094 | @code{hfy-tags-sortl} is an alist of the form: | ||
| 1095 | |||
| 1096 | @example | ||
| 1097 | (("/src/dir" . (tag0 tag1 tag2)) @dots{} ) | ||
| 1098 | @end example | ||
| 1099 | |||
| 1100 | Where the tags are stored in descending order of length. | ||
| 1101 | |||
| 1102 | See: @ref{hfy-load-tags-cache}. | ||
| 1103 | |||
| 1104 | @end table | ||
| 1105 | |||
| 1106 | @node Data Structures | ||
| 1107 | @section Data Structures | ||
| 1108 | @cindex Data Structures | ||
| 1109 | |||
| 1110 | Some of the (informal) data structures used in Htmlfontify are detailed here: | ||
| 1111 | |||
| 1112 | @table @code | ||
| 1113 | |||
| 1114 | @item hfy-style-assoc | ||
| 1115 | @cindex hfy-style-assoc | ||
| 1116 | @anchor{hfy-style-assoc} | ||
| 1117 | |||
| 1118 | An assoc representing/describing an Emacs face. Properties may be repeated, | ||
| 1119 | in which case later properties should be treated as if they were inherited | ||
| 1120 | from a ``parent'' font. (For some properties, only the first encountered value | ||
| 1121 | is of any importance, for others the values might be cumulative, and for | ||
| 1122 | others they might be cumulative in a complex way.) | ||
| 1123 | |||
| 1124 | Some examples: | ||
| 1125 | |||
| 1126 | @lisp | ||
| 1127 | (hfy-face-to-style 'default) => | ||
| 1128 | |||
| 1129 | (("background" . "rgb(0, 0, 0)" ) | ||
| 1130 | ("color" . "rgb(255, 255, 255)") | ||
| 1131 | ("font-style" . "normal" ) | ||
| 1132 | ("font-weight" . "500" ) | ||
| 1133 | ("font-stretch" . "normal" ) | ||
| 1134 | ("font-family" . "misc-fixed" ) | ||
| 1135 | ("font-size" . "13pt" ) | ||
| 1136 | ("text-decoration" . "none" )) | ||
| 1137 | |||
| 1138 | (hfy-face-to-style 'Info-title-3-face) => | ||
| 1139 | |||
| 1140 | (("font-weight" . "700" ) | ||
| 1141 | ("font-family" . "helv" ) | ||
| 1142 | ("font-size" . "120%" ) | ||
| 1143 | ("text-decoration" . "none") ) | ||
| 1144 | @end lisp | ||
| 1145 | |||
| 1146 | @item hfy-sheet-assoc | ||
| 1147 | @cindex hfy-sheet-assoc | ||
| 1148 | @anchor{hfy-sheet-assoc} | ||
| 1149 | |||
| 1150 | An assoc with elements of the form @samp{(face-name style-name . style-string)}. | ||
| 1151 | The actual stylesheet for each page is derived from one of these. | ||
| 1152 | |||
| 1153 | @lisp | ||
| 1154 | '((default "default" . "@{ background: black; color: white@}") | ||
| 1155 | (font-lock-string-face "string" . "@{ color: rgb(64,224,208) @}")) | ||
| 1156 | @end lisp | ||
| 1157 | |||
| 1158 | @item hfy-facemap-assoc | ||
| 1159 | @cindex hfy-facemap-assoc | ||
| 1160 | @anchor{hfy-facemap-assoc} | ||
| 1161 | |||
| 1162 | An assoc of @code{(point . @var{face-symbol})} or | ||
| 1163 | @code{(point . @code{defface} attribute list)} and @code{(point | ||
| 1164 | . end)} elements, in descending order of point value (i.e., from the | ||
| 1165 | file's end to its beginning). The map is in reverse order because | ||
| 1166 | inserting a @samp{<style>} tag (or any other string) at @var{point} | ||
| 1167 | invalidates the map for all entries with a greater value of point. By | ||
| 1168 | traversing the map from greatest to least @var{point}, we still | ||
| 1169 | invalidate the map as we go, but only those points we have already | ||
| 1170 | dealt with (and therefore no longer care about) will be invalid at any | ||
| 1171 | time. | ||
| 1172 | |||
| 1173 | @lisp | ||
| 1174 | '((64820 . end) | ||
| 1175 | (64744 . font-lock-comment-face) | ||
| 1176 | (64736 . end) | ||
| 1177 | (64722 . font-lock-string-face) | ||
| 1178 | (64630 . end) | ||
| 1179 | (64623 . font-lock-string-face) | ||
| 1180 | (64449 . end) | ||
| 1181 | ;; Big similar section elided. You get the idea. | ||
| 1182 | (5459 . end) | ||
| 1183 | (5431 . (:inherit font-lock-keyword-face :background "7e7e7e")) | ||
| 1184 | (5431 . end) | ||
| 1185 | (4285 . font-lock-constant-face) | ||
| 1186 | (4285 . end) | ||
| 1187 | (4221 . font-lock-comment-face) | ||
| 1188 | (4221 . end) | ||
| 1189 | (4197 . font-lock-constant-face) | ||
| 1190 | (4197 . end) | ||
| 1191 | (1 . font-lock-comment-face)) | ||
| 1192 | @end lisp | ||
| 1193 | |||
| 1194 | @end table | ||
| 1195 | |||
| 1196 | @node Examples | ||
| 1197 | @section Examples | ||
| 1198 | @cindex Examples | ||
| 1199 | |||
| 1200 | The following is a lump of code I use to fontify source code on my | ||
| 1201 | site, @url{http://rtfm.etla.org/} (which was the reason, incidentally, | ||
| 1202 | that Htmlfontify was written in the first place). | ||
| 1203 | |||
| 1204 | @lisp | ||
| 1205 | (defvar rtfm-section nil) | ||
| 1206 | |||
| 1207 | ;; Constructs an appropriate header string to fit in with rtfm's | ||
| 1208 | ;; templating system, based on the file and the stylesheet string | ||
| 1209 | (defun rtfm-build-page-header (file style) | ||
| 1210 | (format "#define TEMPLATE red+black.html | ||
| 1211 | #define DEBUG 1 | ||
| 1212 | #include <build/menu-dirlist|>\n | ||
| 1213 | html-css-url := /css/red+black.css | ||
| 1214 | title := rtfm.etla.org ( %s / src/%s ) | ||
| 1215 | bodytag := | ||
| 1216 | head <=STYLESHEET;\n | ||
| 1217 | %s | ||
| 1218 | STYLESHEET | ||
| 1219 | main-title := rtfm / %s / src/%s\n | ||
| 1220 | main-content <=MAIN_CONTENT;\n" rtfm-section file style rtfm-section file)) | ||
| 1221 | |||
| 1222 | ;; the footer: | ||
| 1223 | (defun rtfm-build-page-footer (file) "\nMAIN_CONTENT\n") | ||
| 1224 | |||
| 1225 | (defun rtfm-fontify-buffer (section) | ||
| 1226 | (interactive "s section[eg- emacs / p4-blame]: ") | ||
| 1227 | (require 'htmlfontify) | ||
| 1228 | (let ((hfy-page-header 'rtfm-build-page-header) | ||
| 1229 | (hfy-page-footer 'rtfm-build-page-footer) | ||
| 1230 | (rtfm-section section)) | ||
| 1231 | (htmlfontify-buffer) | ||
| 1232 | ) | ||
| 1233 | ) | ||
| 1234 | |||
| 1235 | ;; Here's the function I actually call---it asks me for a section label, | ||
| 1236 | ;; and source and destination directories, and then binds a couple of | ||
| 1237 | ;; customisation variable in a let before calling htmlfontify: | ||
| 1238 | (defun rtfm-build-source-docs (section srcdir destdir) | ||
| 1239 | (interactive | ||
| 1240 | "s section[eg- emacs / p4-blame]:\nD source-dir: \nD output-dir: ") | ||
| 1241 | (require 'htmlfontify) | ||
| 1242 | (hfy-load-tags-cache srcdir) | ||
| 1243 | (let ((hfy-page-header 'rtfm-build-page-header) | ||
| 1244 | (hfy-page-footer 'rtfm-build-page-footer) | ||
| 1245 | (rtfm-section section) | ||
| 1246 | (hfy-index-file "index") | ||
| 1247 | (auto-mode-alist (append auto-mode-alist | ||
| 1248 | '(("dbi\\(shell\\|gtk\\)$" . cperl-mode) | ||
| 1249 | ("\\.xpm$" . c-mode )))) | ||
| 1250 | ) | ||
| 1251 | (htmlfontify-run-etags srcdir) | ||
| 1252 | (htmlfontify-copy-and-link-dir srcdir destdir ".src" ".html"))) | ||
| 1253 | @end lisp | ||
| 1254 | |||
| 1255 | @node Customisation | ||
| 1256 | @chapter Customisation | ||
| 1257 | @cindex variables (customisation) | ||
| 1258 | |||
| 1259 | Htmlfontify provides the following variable and customisation entries: | ||
| 1260 | |||
| 1261 | @table @code | ||
| 1262 | @comment AUTOGENERATED BLOCK | ||
| 1263 | |||
| 1264 | @item hfy-link-style-fun | ||
| 1265 | @vindex hfy-link-style-fun | ||
| 1266 | @anchor{hfy-link-style-fun} | ||
| 1267 | |||
| 1268 | Set this to a function, which will be called with one argument | ||
| 1269 | (a @samp{@{ foo: bar; @dots{}@}} CSS style-string)---it should return a copy of | ||
| 1270 | its argument, altered so as to make any changes you want made for text which | ||
| 1271 | is a hyperlink, in addition to being in the class to which that style would | ||
| 1272 | normally be applied. | ||
| 1273 | |||
| 1274 | @item hfy-html-quote-regex | ||
| 1275 | @vindex hfy-html-quote-regex | ||
| 1276 | @anchor{hfy-html-quote-regex} | ||
| 1277 | |||
| 1278 | Regex to match (with a single back-reference per match) strings in HTML | ||
| 1279 | which should be quoted with @ref{hfy-html-quote} | ||
| 1280 | (and @pxref{hfy-html-quote-map}) to make them safe. | ||
| 1281 | |||
| 1282 | @item hfy-page-footer | ||
| 1283 | @vindex hfy-page-footer | ||
| 1284 | @anchor{hfy-page-footer} | ||
| 1285 | |||
| 1286 | As @ref{hfy-page-header}, but generates the output footer | ||
| 1287 | (and takes only 1 argument, the filename). | ||
| 1288 | |||
| 1289 | @item hfy-display-class | ||
| 1290 | @vindex hfy-display-class | ||
| 1291 | @anchor{hfy-display-class} | ||
| 1292 | |||
| 1293 | Display class to use to determine which display class to use when | ||
| 1294 | calculating a face's attributes. This is useful when, for example, you | ||
| 1295 | are running Emacs on a tty or in batch mode, and want Htmlfontify to have | ||
| 1296 | access to the face spec you would use if you were connected to an X display. | ||
| 1297 | |||
| 1298 | Some valid class specification elements are: | ||
| 1299 | |||
| 1300 | @lisp | ||
| 1301 | '(class color) | ||
| 1302 | '(class grayscale) | ||
| 1303 | '(background dark) | ||
| 1304 | '(background light) | ||
| 1305 | '(type x-toolkit) | ||
| 1306 | '(type tty) | ||
| 1307 | '(type motif) | ||
| 1308 | '(type lucid) | ||
| 1309 | @end lisp | ||
| 1310 | |||
| 1311 | Multiple values for a tag may be combined, to indicate that any one or more | ||
| 1312 | of these values in the specification key constitutes a match, eg: | ||
| 1313 | |||
| 1314 | '((class color grayscale) (type tty)) would match any of: | ||
| 1315 | @lisp | ||
| 1316 | '((class color)) | ||
| 1317 | '((class grayscale)) | ||
| 1318 | '((class color grayscale))) | ||
| 1319 | '((class color foo)) | ||
| 1320 | '((type tty)) | ||
| 1321 | '((type tty) (class color)) | ||
| 1322 | @end lisp | ||
| 1323 | and so on. | ||
| 1324 | |||
| 1325 | @item hfy-page-header | ||
| 1326 | @vindex hfy-page-header | ||
| 1327 | @anchor{hfy-page-header} | ||
| 1328 | |||
| 1329 | Function called with two arguments (the filename relative to the top | ||
| 1330 | level source directory being etag'd and fontified), and a string containing | ||
| 1331 | the @samp{<style>@dots{}</style>} text to embed in the document---the string | ||
| 1332 | returned will be used as the header for the htmlfontified version of | ||
| 1333 | the source file. | ||
| 1334 | |||
| 1335 | See 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 | |||
| 1341 | String to add to the @samp{<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 | |||
| 1347 | Minimum size of a buffer for cached fontification. | ||
| 1348 | This value is temporarily assigned to @code{fast-lock-minimum-size} during | ||
| 1349 | html-fontification. | ||
| 1350 | |||
| 1351 | Only buffers more than this can have associated Font Lock cache files saved. | ||
| 1352 | |||
| 1353 | If nil, means cache files are never created. | ||
| 1354 | |||
| 1355 | If a list, each element should be a cons pair of the form | ||
| 1356 | @code{(@var{major-mode} . @var{size})}, where @var{major-mode} | ||
| 1357 | is 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 | |||
| 1365 | means that the minimum size is 25K for buffers in C or C++ modes, one megabyte | ||
| 1366 | for buffers in Rmail mode, and size is irrelevant (i.e., no saves) otherwise. | ||
| 1367 | |||
| 1368 | @item hfy-split-index | ||
| 1369 | @vindex hfy-split-index | ||
| 1370 | @anchor{hfy-split-index} | ||
| 1371 | |||
| 1372 | Whether or not to split the index @ref{hfy-index-file} alphabetically | ||
| 1373 | on the first letter of each tag. Useful when the index would otherwise | ||
| 1374 | be 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 | |||
| 1386 | File 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 | |||
| 1392 | Fallback @code{defface} specification for the face @code{default}, used | ||
| 1393 | when @ref{hfy-display-class} has been set (the normal Htmlfontify way of | ||
| 1394 | extracting potentially non-current face information doesn't necessarily | ||
| 1395 | work for @code{default}). | ||
| 1396 | |||
| 1397 | For example, 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 | |||
| 1407 | List of functions to call when starting htmlfontify-buffer to do any | ||
| 1408 | kludging necessary to get highlighting modes to bahave as you want, even | ||
| 1409 | when 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 | |||
| 1415 | Should be set to a Bourne compatible shell, which will be invoked | ||
| 1416 | for the more complex shell interactions needed by Htmlfontify. | ||
| 1417 | Currently 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 | |||
| 1424 | Optimisations to turn on. So far, the following have been implemented: | ||
| 1425 | |||
| 1426 | @table @option | ||
| 1427 | @item merge-adjacent-tags | ||
| 1428 | If two (or more) span tags are adjacent, identical and separated by nothing | ||
| 1429 | more than whitespace, they will be merged into one span. | ||
| 1430 | |||
| 1431 | @item zap-comment-links | ||
| 1432 | Suppress hyperlinking of tags found in comments. | ||
| 1433 | |||
| 1434 | @item zap-string-links | ||
| 1435 | Suppress hyperlinking of tags found in strings. | ||
| 1436 | |||
| 1437 | @item div-wrapper | ||
| 1438 | Add @samp{<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 colors than the fontified code.) | ||
| 1441 | |||
| 1442 | @item keep-overlays | ||
| 1443 | Preserve overlay highlighting (c.f. @code{ediff} or @code{goo-font-lock}) | ||
| 1444 | as well as basic faces. Can result in extremely verbose highlighting | ||
| 1445 | if there are many overlays (as is the case with @code{goo-font-lock}). | ||
| 1446 | |||
| 1447 | @end table | ||
| 1448 | |||
| 1449 | And the following are planned but not yet available: | ||
| 1450 | |||
| 1451 | @table @option | ||
| 1452 | @item kill-context-leak | ||
| 1453 | Suppress hyperlinking between files highlighted by different modes. | ||
| 1454 | |||
| 1455 | @end table | ||
| 1456 | |||
| 1457 | Note: like compiler optimisations, these optimise the _output_ of the code, | ||
| 1458 | not the processing of the source itself, and are therefore likely to slow | ||
| 1459 | Htmlfontify down, at least a little. Except for skip-refontification, | ||
| 1460 | which 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 | |||
| 1466 | Regex 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 | |||
| 1472 | File extension used for href links---useful where the Htmlfontify | ||
| 1473 | output files are going to be processed again, with a rersulting change | ||
| 1474 | in file extension. If @code{nil}, then any code using this should fall back | ||
| 1475 | to @ref{hfy-extn}. | ||
| 1476 | |||
| 1477 | @item hfy-istext-command | ||
| 1478 | @vindex hfy-istext-command | ||
| 1479 | @anchor{hfy-istext-command} | ||
| 1480 | |||
| 1481 | Command to run with the name of a file, to see whether it is a text file | ||
| 1482 | or not. The command should emit a string containing the word @samp{text} if | ||
| 1483 | the file is a text file, and a string not containing @samp{text} otherwise. | ||
| 1484 | |||
| 1485 | @item hfy-etags-cmd-alist | ||
| 1486 | @vindex hfy-etags-cmd-alist | ||
| 1487 | @anchor{hfy-etags-cmd-alist} | ||
| 1488 | |||
| 1489 | An alist of possible shell commands that will generate etags output that | ||
| 1490 | Htmlfontify can use. @samp{%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 | |||
| 1496 | The location of the etags binary (we begin by assuming it's in your path). | ||
| 1497 | |||
| 1498 | Note that if etags is not in your path, you will need to alter the shell | ||
| 1499 | commands 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 | |||
| 1508 | An etags shell command to run in the source directory to generate a tags | ||
| 1509 | file for the whole source tree from there on down. The command should emit | ||
| 1510 | the etags output on standard output. | ||
| 1511 | |||
| 1512 | Two canned commands are provided---they drive Emacs's etags and | ||
| 1513 | exuberant-ctags's etags respectively. | ||
| 1514 | |||
| 1515 | @item hfy-etag-regex | ||
| 1516 | @vindex hfy-etag-regex | ||
| 1517 | @anchor{hfy-etag-regex} | ||
| 1518 | |||
| 1519 | Regex used to parse an etags entry: must have 3 subexps, corresponding, | ||
| 1520 | in order, to: | ||
| 1521 | |||
| 1522 | @enumerate | ||
| 1523 | The tag | ||
| 1524 | The line | ||
| 1525 | The character (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 | |||
| 1532 | Name (sans extension) of the index file produced during | ||
| 1533 | fontification-and-hyperlinking. | ||
| 1534 | |||
| 1535 | @item hfy-instance-file | ||
| 1536 | @vindex hfy-instance-file | ||
| 1537 | @anchor{hfy-instance-file} | ||
| 1538 | |||
| 1539 | Name (sans extension) of the tag usage index file produced during | ||
| 1540 | fontification-and-hyperlinking. | ||
| 1541 | |||
| 1542 | @item hfy-html-quote-map | ||
| 1543 | @vindex hfy-html-quote-map | ||
| 1544 | @anchor{hfy-html-quote-map} | ||
| 1545 | |||
| 1546 | An alist of character -> entity mappings used to make the text html-safe. | ||
| 1547 | |||
| 1548 | @comment /AUTOGENERATED BLOCK | ||
| 1549 | @end table | ||
| 1550 | |||
| 1551 | @node Requirements | ||
| 1552 | @chapter Requirements | ||
| 1553 | @cindex Requirements, Prerequisites | ||
| 1554 | |||
| 1555 | Htmlfontify has a couple of external requirements: | ||
| 1556 | |||
| 1557 | @itemize @bullet | ||
| 1558 | |||
| 1559 | @item | ||
| 1560 | GNU Emacs 20.7+ or 21.1+ | ||
| 1561 | |||
| 1562 | Other versions may work---these have been used successfully by the | ||
| 1563 | author. If you intend to use Htmlfontify in batch mode, 21.1+ is | ||
| 1564 | pretty much required. The author does not know if XEmacs, NTemacs, | ||
| 1565 | or J.Random Emacs will run Htmlfontify, but reports/patches/bags of | ||
| 1566 | money are always welcome. | ||
| 1567 | |||
| 1568 | @item | ||
| 1569 | A copy of etags (exuberant-ctags or GNU etags). Htmlfontify attempts | ||
| 1570 | to autodetect the version you have and customise itself accordingly, | ||
| 1571 | but you should be able to override this. | ||
| 1572 | |||
| 1573 | See: @ref{Customisation} | ||
| 1574 | |||
| 1575 | @item | ||
| 1576 | A copy of find (e.g., GNU find) that provides the @code{-path} predicate. | ||
| 1577 | |||
| 1578 | You may be able to work around this with a suitable clever shell | ||
| 1579 | command and the customisation entry: @ref{hfy-find-cmd} | ||
| 1580 | |||
| 1581 | @item | ||
| 1582 | A copy of sed (e.g., GNU sed). | ||
| 1583 | |||
| 1584 | @item | ||
| 1585 | A copy of the @code{file} command. | ||
| 1586 | |||
| 1587 | @end itemize | ||
| 1588 | |||
| 1589 | @node GNU Free Documentation License | ||
| 1590 | @appendix GNU Free Documentation License | ||
| 1591 | @include doclicense.texi | ||
| 1592 | |||
| 1593 | @node Index | ||
| 1594 | @unnumbered Index | ||
| 1595 | |||
| 1596 | @table @var | ||
| 1597 | @item Concepts | ||
| 1598 | @printindex cp | ||
| 1599 | |||
| 1600 | @item Functions | ||
| 1601 | @printindex fn | ||
| 1602 | |||
| 1603 | @item Variables & Customisation | ||
| 1604 | @printindex vr | ||
| 1605 | |||
| 1606 | @end table | ||
| 1607 | |||
| 1608 | @setchapternewpage odd | ||
| 1609 | @bye | ||
diff --git a/doc/misc/makefile.w32-in b/doc/misc/makefile.w32-in index ac1446cb668..11c76dcfcf7 100644 --- a/doc/misc/makefile.w32-in +++ b/doc/misc/makefile.w32-in | |||
| @@ -56,7 +56,7 @@ INFO_TARGETS = $(infodir)/ccmode$(INFO_EXT) \ | |||
| 56 | $(infodir)/auth$(INFO_EXT) $(infodir)/eieio$(INFO_EXT) $(infodir)/ede$(INFO_EXT) \ | 56 | $(infodir)/auth$(INFO_EXT) $(infodir)/eieio$(INFO_EXT) $(infodir)/ede$(INFO_EXT) \ |
| 57 | $(infodir)/semantic$(INFO_EXT) $(infodir)/edt$(INFO_EXT) $(infodir)/emacs-gnutls$(INFO_EXT) \ | 57 | $(infodir)/semantic$(INFO_EXT) $(infodir)/edt$(INFO_EXT) $(infodir)/emacs-gnutls$(INFO_EXT) \ |
| 58 | $(infodir)/srecode$(INFO_EXT) $(infodir)/bovine$(INFO_EXT) \ | 58 | $(infodir)/srecode$(INFO_EXT) $(infodir)/bovine$(INFO_EXT) \ |
| 59 | $(infodir)/wisent$(INFO_EXT) | 59 | $(infodir)/wisent$(INFO_EXT) $(infodir)/htmlfontify$(INFO_EXT) |
| 60 | DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \ | 60 | DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \ |
| 61 | ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \ | 61 | ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \ |
| 62 | sieve.dvi pgg.dvi mh-e.dvi \ | 62 | sieve.dvi pgg.dvi mh-e.dvi \ |
| @@ -68,7 +68,7 @@ DVI_TARGETS = calc.dvi cc-mode.dvi cl.dvi dbus.dvi dired-x.dvi \ | |||
| 68 | remember.dvi nxml-mode.dvi \ | 68 | remember.dvi nxml-mode.dvi \ |
| 69 | epa.dvi mairix-el.dvi sasl.dvi auth.dvi eieio.dvi ede.dvi \ | 69 | epa.dvi mairix-el.dvi sasl.dvi auth.dvi eieio.dvi ede.dvi \ |
| 70 | semantic.dvi edt.dvi emacs-gnutls.dvi srecode.dvi bovine.dvi \ | 70 | semantic.dvi edt.dvi emacs-gnutls.dvi srecode.dvi bovine.dvi \ |
| 71 | wisent.dvi | 71 | wisent.dvi htmlfontify.dvi |
| 72 | INFOSOURCES = info.texi | 72 | INFOSOURCES = info.texi |
| 73 | 73 | ||
| 74 | # The following rule does not work with all versions of `make'. | 74 | # The following rule does not work with all versions of `make'. |
| @@ -374,6 +374,12 @@ $(infodir)/wisent$(INFO_EXT): wisent.texi | |||
| 374 | wisent.dvi: wisent.texi | 374 | wisent.dvi: wisent.texi |
| 375 | $(ENVADD) $(TEXI2DVI) $(srcdir)/wisent.texi | 375 | $(ENVADD) $(TEXI2DVI) $(srcdir)/wisent.texi |
| 376 | 376 | ||
| 377 | $(infodir)/htmlfontify$(INFO_EXT): htmlfontify.texi | ||
| 378 | $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ htmlfontify.texi | ||
| 379 | htmlfontify.dvi: htmlfontify.texi | ||
| 380 | $(ENVADD) $(TEXI2DVI) $(srcdir)/htmlfontify.texi | ||
| 381 | |||
| 382 | |||
| 377 | $(INFO_TARGETS): doclicense.texi | 383 | $(INFO_TARGETS): doclicense.texi |
| 378 | $(DVI_TARGETS): doclicense.texi | 384 | $(DVI_TARGETS): doclicense.texi |
| 379 | 385 | ||
| @@ -406,7 +412,8 @@ clean: mostlyclean | |||
| 406 | $(infodir)/eieio* $(infodir)/ede* \ | 412 | $(infodir)/eieio* $(infodir)/ede* \ |
| 407 | $(infodir)/semantic* $(infodir)edt* \ | 413 | $(infodir)/semantic* $(infodir)edt* \ |
| 408 | $(infodir)/emacs-gnutls* $(infodir)/srecode* \ | 414 | $(infodir)/emacs-gnutls* $(infodir)/srecode* \ |
| 409 | $(infodir)/bovine* $(infodir)/wisent* | 415 | $(infodir)/bovine* $(infodir)/wisent* \ |
| 416 | $(infodir)/htmlfontify* | ||
| 410 | 417 | ||
| 411 | distclean: clean | 418 | distclean: clean |
| 412 | - $(DEL) makefile | 419 | - $(DEL) makefile |