Add support for config file parsing and watching
[ric-plt/xapp-frame-cpp.git] / doc / src / lib / setup.im
1 .if false
2 ==================================================================================
3     Copyright (c) 2020 Nokia
4     Copyright (c) 2020 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:   setup.im
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.
26
27                                 Visit gitlab.com/rouxware/xfm for info on how to bulid
28                                 {X}fm if needed.
29
30     Date:       29 July 2019
31 .fi
32
33
34 .if ! _setup_im
35         .dv _setup_im 1
36
37         .** our imbeds live here
38         .dv lib ../lib
39
40         .** sane default for everything except rst
41         .dv col_width 6.5i
42         .dv textsize 10
43         .dv textfont Helvetica
44         .dv boldfont Helvetica-Bold
45         .hn off
46         .tm .75i
47
48         .**  imbed output type specific macro file
49         .gv e OUTPUT_TYPE ot
50         .dv output_type &{ot!txt}
51
52
53         .** {X}fm package provided common macro definitions
54         .im cmd_master.im
55
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.
59         &force_diterm_breaks
60
61         .gv e XFM_PASS pass
62         .dv pass &{pass!1}
63
64
65         .** check that current version of {X}fm is greater/equal to our minimum req'd
66         .if ! [ "2.3.2" CVGE ]
67                 .gv
68                 .mg ### WARN ###  this document source expects {X}fm version 2.3.2 or greater; found &{_major}.&{_minor}.&_patch
69         .fi
70
71         .gv e XFM_PATH xpath
72         .if ! xpath
73                 .gv e TFM_PATH xpath
74                 .if ! xpath
75                         .mg ### WARNING ###  XFM_PATH should be set to reference the shared imbed files; likely these are in /usr/local/share/xfm
76                 .fi
77         .fi
78
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.
84         .**
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
88
89                 .ca expand extend _fref.ca
90                 .dv &vname &vval
91                 .ca end
92 .ca end
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
98
99
100         .if &pass 2 =
101                 .im _fref.ca
102         .ei
103                 .** initialise the forward ref file
104                 .ca start _fref.ca
105                         .** forward reference variables; auto generated
106 .ca end
107         .fi
108
109
110         .** set up for an index when using pfm and snare file is defined
111         .if pfm
112                 .** {X}fm macro definitions are too big
113                 .dh 1 p=14 s=2,1 e=off
114                 .dh 2 p=12 s=1,.5
115                 .dh 3 p=&{textsize!10} s=1,0
116
117                 .if index_snare_file
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
122                         .if ! index_cols
123                                 .dv index_cols 2
124                         .fi
125
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
129                 .fi
130         .fi
131
132 .fi