]> git.ipfire.org Git - thirdparty/gcc.git/blob - texinfo/makeinfo/macros/html.texi
Initial revision
[thirdparty/gcc.git] / texinfo / makeinfo / macros / html.texi
1 @c html.texi: -*- Texinfo -*- Macros which support HTML output.
2
3 @c Copyright (c) 1995 Brian Fox (bfox@ai.mit.edu)
4 @c Author: Brian J. Fox (bfox@ai.mit.edu) Sat Apr 1 20:30:54 1995.
5 @c
6 @c I didn't want to write this myself, because I wanted some HTML wizard
7 @c to get everything exactly right. However, rms continues to believe
8 @c that the macro system is not a good idea. I couldn't disagree more,
9 @c so I am writing this as an example of how useful such macros can be.
10
11 @macro html
12 @set html
13 <html>
14 @end macro
15
16 @c
17 @c The first step is to define the macros which really only have meaning
18 @c when producing output for HTML.
19
20 @c
21 @c @anchor{Brian Fox, http://www.ua.com/users/bfox/}
22 @c
23 @macro anchor{text, link}
24 @ifset html
25 <a href="\link\">\text\</a>
26 @end ifset
27 @ifclear html
28 \text\
29 @end ifclear
30 @end macro
31
32 @macro pre{}
33 @ifset html
34 <pre>
35 @end ifset
36 @end macro
37
38 @macro endpre{}
39 @ifset html
40 </pre>
41 @end ifset
42 @end macro
43
44 @macro TeX
45 @ifset html
46 <i>T</i>e<i>X</i>
47 @end ifset
48 @ifclear html
49 @TeX{}
50 @end ifclear
51 @end macro
52
53 @macro paragraph{}
54 @ifset html
55 <p>
56 @end ifset
57 @end macro
58
59 @c
60 @c @email{bfox@@ai.mit.edu}
61 @c
62 @macro email{address}
63 @anchor{mailto:\address\, \address\}
64 @end macro
65
66 @c
67 @c Redefine the TeXinfo commands which have direct HTML counterparts.
68 @c
69
70 @macro html-define-0arg{command, html-insertion}
71 @macro \command\
72 @ifset html
73 \html-insertion\
74 @end ifset
75 @ifclear html
76 @\command\
77 @end ifclear
78 @end macro
79 @end macro
80
81 @macro html-define-1arg{command, html-insertion}
82 @macro \command\{arg}
83 @ifset html
84 \html-insertion\
85 @end ifset
86 @ifclear html
87 @\command\{\arg\}
88 @end ifclear
89 @end macro
90 @end macro
91
92 @macro html-define-line{command, html-insertion}
93 @macro \command\{line}
94 @ifset html
95 \html-insertion\
96 @end ifset
97 @ifclear html
98 @\command\ \line\
99 @end ifclear
100 @end macro
101 @end macro
102
103 @html-define-0arg{*, <br>}
104 @html-define-1arg{b, <b>\\arg\\</b>}
105 @html-define-1arg{code, <tt><b>\\arg\\</b></tt>}
106 @html-define-line{itemize, <ul>}
107 @html-define-line{item,<p><li>}
108 @html-define-line{heading,<h1>\\line\\</h1>}
109 @html-define-0arg{bye, </html>}
110
111 @c
112 @c Define into nothing the macros which do nothing in html.
113 @c
114 @html-define-line{group,}
115
116 @c
117 @c Define a macro which is used to define other macros. This one makes
118 @c a macro which creates an HTML header line. No sectioning commands
119 @c are used. This takes advantage of the non-recursion feature of
120 @c macro execution.
121 @macro node_define{orig-name, header-style}
122 @macro \orig-name\{title}
123 @ifset html
124 @node \title\
125 <a name="\title\"><\header-style\>\title\</\header-style\></a>
126 @end ifset
127 @ifclear html
128 @\orig-name\ \title\
129 @end ifclear
130 @end macro
131 @end macro
132
133 @c
134 @c The same as NODE_DEFINE, but italicized.
135 @macro inode_define{orig-name, header-style}
136 @macro \orig-name\{title}
137 @ifset html
138 @node \title\
139 <a name="\title\"><\header-style\><i>\title\</i></\header-style\></a>
140 @end ifset
141 @ifclear html
142 @\orig-name\ \title\
143 @end ifclear
144 @end macro
145 @end macro
146
147 @c Ignore @node commands.
148 @html-define-line{node,}
149
150 @c Here is a special one for "@top".
151 @macro top{title}
152 @end macro
153
154 @c Now actually define a new set of sectioning commands.
155 @node_define {appendix, h1}
156 @node_define {appendixsec, h2}
157 @node_define {appendixsubsec, h3}
158 @node_define {appendixsubsubsec, h4}
159 @node_define {chapter, h1}
160 @node_define {section, h2}
161 @node_define {subsection, h3}
162 @node_define {subsubsec, h4}
163 @node_define {unnumbered, h1}
164 @node_define {unnumberedsec, h2}
165 @node_define {unnumberedsubsec, h3}
166 @node_define {unnumberedsubsubsec, h4}
167
168 @c The italicized analogues.
169 @inode_define {iappendix, h1}
170 @inode_define {iappendixsec, h2}
171 @inode_define {iappendixsubsec, h3}
172 @inode_define {iappendixsubsubsec, h4}
173 @inode_define {ichapter, h1}
174 @inode_define {isection, h2}
175 @inode_define {isubsection, h3}
176 @inode_define {isubsubsec, h4}
177 @inode_define {iunnumbered, h1}
178 @inode_define {iunnumberedsec, h2}
179 @inode_define {iunnumberedsubsec, h3}
180 @inode_define {iunnumberedsubsubsec, h4}
181
182 @c Manual starter:
183 @c
184 @c Pass arguments of TITLE, AUTHOR, and a short DESCRIPTION.
185 @c Immediately following, insert the Top node's menu.
186 @c
187 @c Typical usage:
188 @c
189 @c @document{Makeinfo, Brian J. Fox, This file documents the use of the
190 @c @code{makeinfo} program\, versions 1.61 and later.}
191 @c
192 @c @menu
193 @c * What is @makeinfo{}?::
194 @c @end menu
195 @macro document{title, author, description}
196 @ifinfo
197 \description\
198
199 Copyright @copyright{} 1995 \author\
200 Copyright @copyright{} 1995 Free Software Foundation, Inc.
201
202 Permission is granted to make and distribute verbatim copies of
203 this manual provided the copyright notice and this permission notice
204 are preserved on all copies.
205
206 Permission is granted to process this file through TeX and print the
207 results, provided the printed document carries copying permission
208 notice identical to this one except for the removal of this paragraph
209 (this paragraph not being relevant to the printed manual).
210
211 Permission is granted to copy and distribute modified versions of this
212 manual under the conditions for verbatim copying, provided that the entire
213 resulting derived work is distributed under the terms of a permission
214 notice identical to this one.
215
216 Permission is granted to copy and distribute translations of this manual
217 into another language, under the above conditions for modified versions,
218 except that this permission notice may be stated in a translation approved
219 by the copyright holders.
220 @end ifinfo
221
222 @titlepage
223 @title \title\
224 @author \author\
225
226 @page
227 @vskip 0pt plus 1filll
228 Copyright @copyright{} 1995 \author\
229 Copyright @copyright{} 1995 Free Software Foundation, Inc.
230
231 Permission is granted to make and distribute verbatim copies of
232 this manual provided the copyright notice and this permission notice
233 are preserved on all copies.
234
235 Permission is granted to copy and distribute modified versions of this
236 manual under the conditions for verbatim copying, provided that the entire
237 resulting derived work is distributed under the terms of a permission
238 notice identical to this one.
239
240 Permission is granted to copy and distribute translations of this manual
241 into another language, under the above conditions for modified versions,
242 except that this permission notice may be stated in a translation approved
243 by the copyright holders.
244 @end titlepage
245
246 @top{\title\}
247
248 \description\
249 @end macro
250
251 @html-define-line{end,
252 @ifeq{"\\line\\"\, "ifinfo"\, @end ifinfo}
253 @ifeq{"\\line\\"\, "ifset"\, @end ifset}
254 @ifeq{"\\line\\"\, "ifclear"\, @end ifclear}
255 @ifeq{"\\line\\"\, "cartouche"\, @end cartouche}
256 @ifeq{"\\line\\"\, "menu"\, @end menu}
257 @ifeq{"\\line\\"\, "itemize"\, </ul>}
258 @ifeq{"\\line\\"\, "enumerate"\, </ul>}
259 @ifeq{"\\line\\"\, "table"\, </ul>}
260 @ifeq{"\\line\\"\, "ftable"\, </ul>}
261 @ifeq{"\\line\\"\, "vtable"\, </ul>}
262 @ifeq{"\\line\\"\, "menu"\, xxx}
263 @ifeq{"\\line\\"\, "quotation"\, </pre>}
264 @ifeq{"\\line\\"\, "example"\, </tt></pre>}
265 @ifeq{"\\line\\"\, "smallexample"\, </tt></pre>}
266 @ifeq{"\\line\\"\, "lisp"\, </tt></pre>}
267 @ifeq{"\\line\\"\, "format"\, </tt></pre>}
268 @ifeq{"\\line\\"\, "display"\, </tt></pre>}
269 @ifeq{"\\line\\"\, "group"}}