blob: 871d340342cf203011e4c72bcffa32d0b4c076ca [file] [log] [blame]
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -04001.if false
2==================================================================================
3 Copyright (c) 2019 Nokia
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18.fi
19
20.if false
21 Mnemonic: rts.im
22 Abstract: This file provides macros allowing {X}fm source to generate
23 rts input from {X}fm source when the doc is passed through
24 tfm, and to generate postscirpt output when passed through
25 pfm. Simalar to the roff.im macro set that allows the generation
26 of troff input for man pages.
27
28 Author: E. Scott Daniels
29 Date: 7 February 2019
30
31
32 Maybe useful (but doesn't explain why real formatters aren't being used)
33 http://docutils.sourceforge.net/docs/user/rst/quickref.html
34.fi
35
36
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040037 .** convert {X}fm input into rts.
38 .** post processing is needed to strip the leading space that tfm insists on adding.
39
40 .** bloody rst has no consistant marking character, and each header level must be different and as long as the text.
41 .** and of course they don't generate <hx> tags in the resulting HTML, but <section> tags. WTF?
E. Scott Daniels117030c2020-04-10 17:17:02 -040042 .dv many_equals ============================================================================================
43 .dv many_dashes --------------------------------------------------------------------------------------------
44 .dv many_tildas ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 .dv h1 .sp 1 $1 .br &many_equals .sp 1
46 .dv h2 .sp 1 $1 .br &many_dashes .sp 1
47 .dv h3 .sp 1 $1 .br &many_tildas .sp 1
48
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040049 .dv h4 **$1**
50 .** .dv h1 === $1 .br === .sp 1
51 .** .dv h2 === $1 .br === .sp 1
52 .** .dv h3 === $1 .br === .sp 1
53
54 .dv fig
55 .dv set_font_cw
56
57 .dv nf .sp 1 ^:^: .br .ll -2 .in +2
58 .dv fo .in -2 .ll +2 .sp 1
59
60 .dv indent
61 .dv uindent
62
63 .dv lic1 +
64 .dv lic2 -
65 .dv lic3 *
66
67 .in 0i .** bloody rst is indention sensitive like markdown; sheesh
68
E. Scott Danielsb7a4b522019-11-07 15:35:17 -050069 .dv esc \ : .** bloody need to escape _ and * at the end of a word
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040070 .dv line_len .ll $1
71 .dv space .sp 1
72 .dv half_space .sp 1
E. Scott Daniels4240b8b2019-08-01 10:36:14 -040073 .dv mult_space .sp $1
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040074 .dv beg_list .sp 1 .dv lic $1 ^:
75 .dv end_list .sp 1
76
E. Scott Daniels392168d2019-11-06 15:12:38 -050077 .dv beg_dlist .sp 1 .ll -3
78 .dv end_dlist .br .in 0i .ll +3
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040079
80 .** for now we allow only a single layer of defitems
E. Scott Daniels392168d2019-11-06 15:12:38 -050081 .dv di .in 0i .br $1 .br .in +3
E. Scott Daniels4d1f9bf2020-03-06 12:29:28 -050082 .dv ditem .in 0i .br $1 .br .in +3
83 .** diitem is odd and deprecated
E. Scott Daniels392168d2019-11-06 15:12:38 -050084 .dv diitem .in 0i .br $1 .br .in +3
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040085 .dv item .br &lic
E. Scott Daniels4240b8b2019-08-01 10:36:14 -040086 .dv li .br &lic
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040087
88 .dv ex_start .sp 1 ^:^: .br .ll -2 .in +2 .nf
89 .dv ex_end .fo on .in -2 .ll +2 .sp 1
E. Scott Daniels4240b8b2019-08-01 10:36:14 -040090
E. Scott Daniels06e85b72019-08-06 16:29:00 -040091 .dv proto_start .sp 1 .cc .5i .st 9 .sf Courier-bold .nf
92 .dv proto_end .fo on .sf ^&text_font .st ^&text_size .sp .3
93
E. Scott Daniels4240b8b2019-08-01 10:36:14 -040094 .dv center .br $1 .br
95 .dv center_start .br
96 .dv center_end .br
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -040097
98 .** fonts and font macros
99 .dv ital *$1*
100 .dv bold **$1**
101 .dv cw $1
102 .dv set_font_prop
103
104 .dv table .sp 1 ^[table not supported in rst output] .if false
105 .dv tab_cell
106 .dv tab_row
107 .dv end_table .fi
E. Scott Daniels06e85b72019-08-06 16:29:00 -0400108
109 .dv super .sm ^[ .sm ^&{ss_num}]
110 .dv ss_num 1
111 .dv note .dv ss_num ^[ ?%.0f ^&ss_num 1 + ] ^: .sm ^^[^&{ss_num}]
112 .** rst has no concept of a page, so all notes go to the close of the doc
113 .dv atbot atclose
Ashwin Sridharanfd9cc7a2019-04-03 16:47:02 -0400114
115 .ju off