1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
!config
# Arara, the cool TeX automation tool
# Copyright (c) 2018, Paulo Roberto Massa Cereda
# All rights reserved.
#
# This rule is part of arara.
identifier: bib2gls
name: Bib2Gls
authors:
- Nicola Talbot
- Paulo Cereda
commands:
- name: The Bib2Gls software
command: >
@{
return getCommand('bib2gls', dir, trans, group, interpret,
breakspace, trimfields, recordcount, recordcountunit,
cite, verbose, merge, locale, uniscript, packages,
ignore, custom, mapformats, options, getBasename(file));
}
arguments:
- identifier: dir
flag: >
@{
return ['--dir', parameters.dir]
}
- identifier: trans
flag: >
@{
return ['--log-file', getBasename(file)+"."+parameters.trans]
}
- identifier: locale
flag: >
@{
return ['--locale', parameters.locale]
}
- identifier: group
flag: >
@{
isTrue(parameters.group, '--group', '--no-group')
}
- identifier: interpret
flag: >
@{
isTrue(parameters.interpret, '--interpret', '--no-interpret')
}
- identifier: breakspace
flag: >
@{
isTrue(parameters.breakspace, '--break-space', '--no-break-space')
}
- identifier: trimfields
flag: >
@{
isTrue(parameters.trimfields, '--trim-fields', '--no-trim-fields')
}
- identifier: recordcount
flag: >
@{
isTrue(parameters.recordcount, '--record-count', '--no-record-count')
}
- identifier: recordcountunit
flag: >
@{
isTrue(parameters.recordcountunit, '--record-count-unit',
'--no-record-count-unit')
}
- identifier: cite
flag: >
@{
isTrue(parameters.cite, '--cite-as-record', '--no-cite-as-record')
}
- identifier: verbose
flag: >
@{
isTrue(parameters.verbose, '--verbose', '--no-verbose')
}
- identifier: merge
flag: >
@{
isTrue(parameters.merge, '--merge-wrglossary-records',
'--no-merge-wrglossary-records')
}
- identifier: uniscript
flag: >
@{
isTrue(parameters.uniscript, '--support-unicode-script',
'--no-support-unicode-script')
}
- identifier: packages
flag: >
@{
if (isList(parameters.packages)) {
elements = [];
foreach (element : parameters.packages) {
elements.add('--packages');
elements.add(element);
}
return elements;
}
else {
throwError('I was expecting a list of package names.');
}
}
- identifier: ignore
flag: >
@{
if (isList(parameters.ignore)) {
elements = [];
foreach (element : parameters.ignore) {
elements.add('--ignore-packages');
elements.add(element);
}
return elements;
}
else {
throwError('I was expecting a list of package names.');
}
}
- identifier: custom
flag: >
@{
if (isList(parameters.custom)) {
elements = [];
foreach (element : parameters.custom) {
elements.add('--custom-packages');
elements.add(element);
}
return elements;
}
else {
throwError('I was expecting a list of package names.');
}
}
- identifier: mapformats
flag: >
@{
if (isList(parameters.mapformats)) {
elements = [];
foreach (element : parameters.mapformats) {
if (isList(element) && element.size() == 2) {
elements.add('--map-format');
elements.add(element.get(0) + ':' + element.get(1));
}
else {
throwError('I was expecting a map ' +
'format list [<key>, <value>] ');
}
}
return elements;
}
else {
throwError('I was expecting mapformats: [ [<key>, <value>], ' +
'..., [<key>, <value>] ].');
}
}
- identifier: options
flag: >
@{
if (isList(parameters.options)) {
return parameters.options;
}
else {
throwError('I was expecting a list of options.');
}
}
|