From 0961243b069979fca29a4e540bf88f0578fc69ba Mon Sep 17 00:00:00 2001 From: Paulo Roberto Massa Cereda Date: Fri, 13 Dec 2024 05:43:26 -0300 Subject: [PATCH] First draft for tex-fmt (fixes #127) --- rules/arara-rule-texfmt.yaml | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 rules/arara-rule-texfmt.yaml diff --git a/rules/arara-rule-texfmt.yaml b/rules/arara-rule-texfmt.yaml new file mode 100644 index 00000000..c13346c9 --- /dev/null +++ b/rules/arara-rule-texfmt.yaml @@ -0,0 +1,78 @@ +!config +# Arara, the cool TeX automation tool +# Copyright (c) 2024, Island of TeX +# All rights reserved. +# +# This rule is part of arara. +identifier: texfmt +name: tex-fmt +authors: +- William Underwood +- Island of TeX +commands: +- name: The tex-fmt application + command: > + @{ + return getCommand('tex-fmt', check, print, messages, tabs, stdin, + config, wrap, tabsize, options, reference); + } +arguments: +- identifier: check + flag: > + @{ + isTrue(parameters.check, '--check') + } +- identifier: print + flag: > + @{ + isTrue(parameters.print, '--print') + } +- identifier: messages + flag: > + @{ + if ([ 'verbose', 'quiet', 'trace' ].contains(parameters.messages)) { + return '--'.concat(parameters.messages); + } + else { + throwError('You provided an invalid value for messages.'); + } + } +- identifier: tabs + flag: > + @{ + isTrue(parameters.tabs, '--usetabs') + } +- identifier: stdin + flag: > + @{ + isTrue(parameters.stdin, '--stdin') + } +- identifier: config + flag: > + @{ + config = parameters.config.toString().toLowerCase(); + return isTrue([ 'no', 'false', '0', 'off' ].contains(config), + '--noconfig', [ '--config', parameters.config ]); + } +- identifier: wrap + flag: > + @{ + wrap = parameters.wrap.toString().toLowerCase(); + return isTrue([ 'no', 'false', '0', 'off' ].contains(wrap), + '--nowrap', [ '--wraplen', parameters.wrap ]); + } +- identifier: tabsize + flag: > + @{ + [ '--tabsize', parameters.tabsize ] + } +- identifier: options + flag: > + @{ + if (isList(parameters.options)) { + return parameters.options; + } + else { + throwError('I was expecting a list of options.'); + } + }