summaryrefslogtreecommitdiff
path: root/tmac/devtag.tmac
blob: 8a6204a29f27d82d2cdc90d5529b8e0daeec01a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.ig
devtag.tmac - macro package for adding tags to roff documents.

------------------------------------------------------------------------
    Legalese
------------------------------------------------------------------------

This file is part of groff, the GNU roff type-setting system.

Copyright (C) 2004-2020 Free Software Foundation, Inc.
written by Gaius Mulley <gaius@glam.ac.uk>.

groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or
(at your option) any later version.

groff is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


------------------------------------------------------------------------
    Description
------------------------------------------------------------------------

A simple set of macros to provide markup devices (currently only
grohtml) with tags that define the meaning of the formatted text and
also basic formatting instructions.  It generalizes the tag concept used
within grohtml and in the future it is hoped that more markup based
devices can capitalize on this work.  It also clearly defines those tags
which are honoured by grohtml.  Note that not all tags are included
here.  Some of the grohtml specific tags (header specific and jobname,
etc.) are called directly from within www.tmac.  The tags defined here
are reasonably generic and could be applied to other devices.
..
.
.do if d DEVTAG-NH .nx
.
.do nr *groff_devtag_tmac_C \n[.cp]
.cp 0
.
.\" --------------------------------------------------------------------
.\" DEVTAG <name>
.\"
.\"   Emit a tag <name>
.\"
.de1 DEVTAG
.  tag devtag:\\$*
..
.\" --------------------------------------------------------------------
.\" DEVTAG-NEXT <name>
.\"
.\"   When the troff state changes, emit tag <name>
.\"
.de1 DEVTAG-NEXT
.  taga devtag:\\$*
..
.
.\" --------------------------------------------------------------------
.\"  SH <level>
.\"  NH <level>
.\"       tell device we are starting a numbered heading
.\"       Takes a single parameter <level>. <level> 1
.\"       is the outer most level.
.
.de1 DEVTAG-NH
.   DEVTAG ".NH \\$1"
..
.als DEVTAG-SH DEVTAG-NH
.
.\" --------------------------------------------------------------------
.\"  COL <n>
.\"     indicate that the following text is aligned for the column <n>
.\"     n: [1..MAX(n)]
.
.de1 DEVTAG-COL
.   DEVTAG ".col \\$1"
..
.
.\" --------------------------------------------------------------------
.\"  EO-H
.\"     indicate that a header has finished.
.
.de1 DEVTAG-EO-H
.   DEVTAG ".eo.h"
..
.\" --------------------------------------------------------------------
.\"  EO-TL
.\"     indicate that a title has finished.
.
.de1 DEVTAG-EO-TL
.   DEVTAG ".eo.tl"
..
.\" --------------------------------------------------------------------
.\"  TL
.\"     indicate that the following text forms a title.
.
.de1 DEVTAG-TL
.   DEVTAG ".tl"
..
.
.\" --------------------------------------------------------------------
.\"  COL-NEXT <n>
.\"     emit a column tag just before the next glyph.
.
.de1 DEVTAG-COL-NEXT
.   DEVTAG-NEXT ".col \\$1"
..
.
.
.cp \n[*groff_devtag_tmac_C]
.do rr *groff_devtag_tmac_C
.
.
.\" Local Variables:
.\" mode: nroff
.\" fill-column: 72
.\" End:
.\" vim: set filetype=groff textwidth=72: