2 ==================================================================================
3 Copyright (c) 2019-2020 Nokia
4 Copyright (c) 2018-2020 AT&T Intellectual Property.
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
10 http://www.apache.org/licenses/LICENSE-2.0
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 ==================================================================================
22 Abstract: Look at environment variables and pull in the correct setup prep
23 imbed file based on the desired output type (when running tfm).
25 This also sets up the front junk (table of contents, copyright page
26 and page numbering) when generating postscript. For non-postscript
27 output a licence/caution are added if the output type supports
28 comments. Document title is also added.
30 These variables are expected to be defined:
31 pass (current parsing pass over the source)
33 See front_junk.im for the list of variables it expects.
50 .** sane default for everything except rst and markdown which override later
59 .** for everything except rst backslants don't need to be escaped
62 .dv ditext Helvetica-bold
64 .im &{lib}/generic_ps.im
73 .** CAUTION: xfm comparisons are reverse polish so "a b =" is true if a == b.
79 .if &reverse_titles 1 =
80 .** for some RST output reversing disambiguates the generated document list
82 .dv doc_title &doc_subtitle
83 .dv doc_subtitle &_hold
90 .if "&ot" "markdown" =
93 .im &{lib}/markdown.im
103 .** do not force header level 1s to all upper case
106 .cd 1 &col_width i=&col_indent
110 .** set up for an index when using pfm and snare file is defined
113 .ix space .sp 1 .cc 5 %c .ln ^: .sp 0
114 .ix term .br %s `^` ^`` %d
115 .ix groupb .sp .5 %s .br .ll -.25i .in +.25i
116 .ix groupe .sp .1 .in -.25i .ll +.25i
121 .dv index_col_width [ 6.5 &index_cols / .25 &index_cols 1 - * - ]
122 .dv index_here .pa .ju off .st &textsize .cd 1 i=1i w=7 ^: .h1 INDEX ^: .pn off .lw 0 .sp 0 .tt ^: .cd &index_cols i=1i w=&{index_col_width}i g=.25i ^: .in -i .ll &{index_col_width}i .ix insert
123 .im &index_snare_file
128 .** two pass mode -- pull in variables captured during pass 1 for forward references
131 .** clear the capture file if it was there (end must be in col 0)
132 .ca start p1var_setup.ca
136 .gv e GEN_TITLE gen_title
137 .if "&gen_title" "1" =
138 .im ../rtd/gen_title.im
142 .** func allows us to force an index entry for the function without having to
143 .** define function names in the capture file. func is a bit odd; if punct
144 .** needs to be added, it must be supplied as the second .** parm because
145 .** we add () to the first. E.g. &func(foo_bar:.) will add a full stop.
148 .dv func .ix force ${1} ^: ^&cw(${1}()$2 )
150 .dv func ^&cw(${1}()$2)
153 .** license/copyright, table of contents, title page, start index capture
158 .pn on noline center f=%d 0
161 .** work around bug until change made (RouxWare issue #4)