2 ==================================================================================
3 Copyright (c) 2020 Nokia
4 Copyright (c) 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: Provide general setup for all documents. It will include the
23 {X}fm common macro definitions (cmd) which provide the ability
24 to generate markdown, roff, and RST "source" from {X}fm source
25 while still allowing postscript to be generated.
27 Visit gitlab.com/rouxware/xfm for info on how to bulid
37 .** our imbeds live here
40 .** sane default for everything except rst
43 .dv textfont Helvetica
44 .dv boldfont Helvetica-Bold
48 .** imbed output type specific macro file
50 .dv output_type &{ot!txt}
53 .** {X}fm package provided common macro definitions
56 .** because of the current RTD "template" we MUST force double spaceing
57 .** in definition lists else the bloody thing runs them all onto one line.
58 .** the following will do this and is harmless for other output types.
65 .** check that current version of {X}fm is greater/equal to our minimum req'd
66 .if ! [ "2.3.2" CVGE ]
68 .mg ### WARN ### this document source expects {X}fm version 2.3.2 or greater; found &{_major}.&{_minor}.&_patch
75 .mg ### WARNING ### XFM_PATH should be set to reference the shared imbed files; likely these are in /usr/local/share/xfm
79 .** forward variable reference support
80 .** define a 'subroutine' to add a variable and place it into the forward reference file
81 .** fref_sub.ca contains code to execute by the set_fref macor and fref.ca contains the
82 .** forward references to include during pass2. The macro set_ref will define the variable
83 .** passed as $1 (name) with the value passed as $2 and will add it to the fref.ca file.
85 .ca shift start _fref_sub.ca
86 .** be careful... the next 'ca end' MUST be tab indented before {X} version 2.4.
87 .** with 2.4 and after it can be space indented
89 .ca expand extend _fref.ca
93 .** the previous 'ca end' MUST be in col 0
94 .dv export_var .dv vname $1 ^: .dv vval $2 ^: .dv $1 $2 ^: .im _fref_sub.ca
95 .dv export_fig .dv vname $1 ^: .gv fig .ev ^`.dv vval ^^&_fig ^: ^` .im _fref_sub.ca
96 .dv export_tab .dv vname $1 ^: .gv table .ev ^`.dv vval ^^&_table ^` ^: .im _fref_sub.ca
97 .dv export_pg .dv vname $1 ^: .gv page .ev ^`.dv vval ^^&_page ^` ^: .im _fref_sub.ca
103 .** initialise the forward ref file
105 .** forward reference variables; auto generated
110 .** set up for an index when using pfm and snare file is defined
112 .** {X}fm macro definitions are too big
113 .dh 1 p=14 s=2,1 e=off
115 .dh 3 p=&{textsize!10} s=1,0
118 .ix space .sp 1 .cc 5 %c .ln ^: .sp 0
119 .ix term .br %s `^` ^`` %d
120 .ix groupb .sp .5 %s .br .ll -.25i .in +.25i
121 .ix groupe .sp .1 .in -.25i .ll +.25i
126 .dv index_col_width [ 6.5 &index_cols / .25 &index_cols 1 - * - ]
127 .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
128 .im &index_snare_file