summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/arara/rules/arara-rule-pythontex.yaml
blob: 19de0e52f3ecbd420d9d5d9f8d2a71722e9c6740 (plain)
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
!config
# Arara, the cool TeX automation tool
# Copyright (c) 2022, Island of TeX
# All rights reserved.
#
# This rule is part of arara.
identifier: pythontex
name: PythonTeX
authors:
- Island of TeX
commands:
- name: PythonTeX wrapper
  command: >
    @{
        return getCommand('pythontex', encoding, errorcode, runall, rerun,
                          hashdependencies, jobs, verbose, options,
                          reference.getName());
    }
arguments:
- identifier: encoding
  flag: >
    @{
        return '--encoding='.concat(parameters.encoding);
    }
- identifier: errorcode
  flag: >
    @{
        return '--error-exit-code='.concat(isTrue(parameters.errorcode,
               'true', 'false'));
    }
- identifier: runall
  flag: >
    @{
        return '--runall='.concat(isTrue(parameters.runall, 'true', 'false'));
    }
- identifier: rerun
  flag: >
    @{
        if ([ 'never', 'modified', 'errors', 'warnings',
              'always' ].contains(parameters.rerun)) {
            return '--rerun='.concat(parameters.rerun);
        }
        else {
            throwError('The provided value is not valid.');
        }
    }
- identifier: hashdependencies
  flag: >
    @{
        return '--hashdependencies='.concat(isTrue(parameters.hashdependencies,
               'true', 'false'));
    }
- identifier: jobs
  flag: >
    @{
        return [ '--jobs', parameters.jobs ];
    }
- identifier: verbose
  flag: >
    @{
        return isTrue(parameters.verbose, '--verbose');
    }
- identifier: options
  flag: >
    @{
        if (isList(parameters.options)) {
            return parameters.options;
        } else {
            throwError('I was expecting a list of options.');
        }
    }