CXX peace: src/troff/input.cpp
[s-roff.git] / tmac / devtag.tmac
blobf778db38ccca383e3547b6a3fa62e7fe8be0c77f
1 .ig
2 @ devtag.tmac - macro package for adding tags to roff documents.
3 @ A simple set of macros to provide markup devices (currently only grohtml)
4 @ with tags that define the meaning of the formatted text and also
5 @ basic formatting instructions.  It generalizes the tag concept used within
6 @ grohtml and in the future it is hoped that more markup based devices
7 @ can capitalize on this work.  It also clearly defines those tags which are
8 @ honoured by grohtml.  Note that not all tags are included here.  Some
9 @ of the grohtml specific tags (header specific and jobname, etc.) are
10 @ called directly from within www.tmac.  The tags defined here are
11 @ reasonably generic and could be applied to other devices.
13 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
15 Copyright (C) 2004 Free Software Foundation, Inc.
16 written by Gaius Mulley <gaius@glam.ac.uk>.
18 This is free software; you can redistribute it and/or modify it under
19 the terms of the GNU General Public License as published by the Free
20 Software Foundation; either version 2, or (at your option) any later
21 version.
23 This is distributed in the hope that it will be useful, but WITHOUT
24 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26 for more details.
28 You should have received a copy of the GNU General Public License
29 along with groff; see the file COPYING.  If not, write to the Free
30 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
31 02110-1301, USA.
34 .do if d DEVTAG-NH .nx
36 .nr _C \n(.C
37 .cp 0
39 .\" DEVTAG <name>
40 .\"
41 .\"   Emit a tag <name>
42 .\"
43 .de DEVTAG
44 .  tag devtag:\\$*
46 .\" DEVTAG-NEXT <name>
47 .\"
48 .\"   When the troff state changes, emit tag <name>
49 .\"
50 .de DEVTAG-NEXT
51 .  taga devtag:\\$*
54 .\"  SH <level>
55 .\"  NH <level>
56 .\"       tell device we are starting a numbered heading
57 .\"       Takes a single parameter <level>. <level> 1
58 .\"       is the outer most level.
60 .de DEVTAG-NH
61 .   DEVTAG ".NH \\$1"
63 .als DEVTAG-SH DEVTAG-NH
65 .\"  COL <n>
66 .\"     indicate that the following text is aligned for the column <n>
67 .\"     n: [1..MAX(n)]
69 .de DEVTAG-COL
70 .   DEVTAG ".col \\$1"
73 .\"  EO-H
74 .\"     indicate that a header has finished.
76 .de DEVTAG-EO-H
77 .   DEVTAG ".eo.h"
79 .\"  EO-TL
80 .\"     indicate that a title has finished.
82 .de DEVTAG-EO-TL
83 .   DEVTAG ".eo.tl"
85 .\"  TL
86 .\"     indicate that the following text forms a title.
88 .de DEVTAG-TL
89 .   DEVTAG ".tl"
92 .\"  COL-NEXT <n>
93 .\"     emit a column tag just before the next glyph.
95 .de DEVTAG-COL-NEXT
96 .   DEVTAG-NEXT ".col \\$1"
100 .cp \n[_C]
102 .\" s-ts-mode