fde3ade046296a66c6dcb125013b5ff39f34aae5
[platform/upstream/groff.git] / tmac / devtag.tmac
1 .\" -*- nroff -*-
2 .ig
3 devtag.tmac - macro package for adding tags to roff documents.
4
5 File position: <groff_source_top>/tmac/devtag.tmac
6 Installed position: groff's main macro directory.
7
8 ------------------------------------------------------------------------
9     Legalese
10 ------------------------------------------------------------------------
11
12 This file is part of groff, the GNU roff type-setting system.
13
14 Copyright (C) 2004-2014 Free Software Foundation, Inc.
15 written by Gaius Mulley <gaius@glam.ac.uk>.
16
17 groff is free software; you can redistribute it and/or modify it under
18 the terms of the GNU General Public License as published by the Free
19 Software Foundation, either version 3 of the License, or
20 (at your option) any later version.
21
22 groff is distributed in the hope that it will be useful, but WITHOUT
23 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25 for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with this program. If not, see <http://www.gnu.org/licenses/>.
29
30
31 ------------------------------------------------------------------------
32     Description
33 ------------------------------------------------------------------------
34
35 A simple set of macros to provide markup devices (currently only grohtml)
36 with tags that define the meaning of the formatted text and also
37 basic formatting instructions.  It generalizes the tag concept used within
38 grohtml and in the future it is hoped that more markup based devices
39 can capitalize on this work.  It also clearly defines those tags which are
40 honoured by grohtml.  Note that not all tags are included here.  Some
41 of the grohtml specific tags (header specific and jobname, etc.) are
42 called directly from within www.tmac.  The tags defined here are
43 reasonably generic and could be applied to other devices.
44 ..
45 .
46 .do if d DEVTAG-NH .nx
47 .
48 .nr _C \n(.C
49 .cp 0
50 .
51 .\" --------------------------------------------------------------------
52 .\" DEVTAG <name>
53 .\"
54 .\"   Emit a tag <name>
55 .\"
56 .de DEVTAG
57 .  tag devtag:\\$*
58 ..
59 .\" --------------------------------------------------------------------
60 .\" DEVTAG-NEXT <name>
61 .\"
62 .\"   When the troff state changes, emit tag <name>
63 .\"
64 .de DEVTAG-NEXT
65 .  taga devtag:\\$*
66 ..
67 .
68 .\" --------------------------------------------------------------------
69 .\"  SH <level>
70 .\"  NH <level>
71 .\"       tell device we are starting a numbered heading
72 .\"       Takes a single parameter <level>. <level> 1
73 .\"       is the outer most level.
74 .
75 .de DEVTAG-NH
76 .   DEVTAG ".NH \\$1"
77 ..
78 .als DEVTAG-SH DEVTAG-NH
79 .
80 .\" --------------------------------------------------------------------
81 .\"  COL <n>
82 .\"     indicate that the following text is aligned for the column <n>
83 .\"     n: [1..MAX(n)]
84 .
85 .de DEVTAG-COL
86 .   DEVTAG ".col \\$1"
87 ..
88 .
89 .\" --------------------------------------------------------------------
90 .\"  EO-H
91 .\"     indicate that a header has finished.
92 .
93 .de DEVTAG-EO-H
94 .   DEVTAG ".eo.h"
95 ..
96 .\" --------------------------------------------------------------------
97 .\"  EO-TL
98 .\"     indicate that a title has finished.
99 .
100 .de DEVTAG-EO-TL
101 .   DEVTAG ".eo.tl"
102 ..
103 .\" --------------------------------------------------------------------
104 .\"  TL
105 .\"     indicate that the following text forms a title.
106 .
107 .de DEVTAG-TL
108 .   DEVTAG ".tl"
109 ..
110 .
111 .\" --------------------------------------------------------------------
112 .\"  COL-NEXT <n>
113 .\"     emit a column tag just before the next glyph.
114 .
115 .de DEVTAG-COL-NEXT
116 .   DEVTAG-NEXT ".col \\$1"
117 ..
118 .
119 .
120 .cp \n[_C]
121 .
122 .
123 .\" --------------------------------------------------------------------
124 .\" Emacs settings
125 .\" --------------------------------------------------------------------
126 .
127 .\" Local Variables:
128 .\" mode: nroff
129 .\" End:
130 .\" EOF