diff options
author | Norbert Preining <norbert@preining.info> | 2023-10-14 03:01:20 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-10-14 03:01:20 +0000 |
commit | 315010c30c0dab68a71ca741364438a7a0b1261f (patch) | |
tree | 1892d65e76bc025eede34669c33667d1e8c1f218 /support/latexindent | |
parent | 7c1335b7f300ea31a40bf83026d6b7d24d7bafc5 (diff) |
CTAN sync 202310140301
Diffstat (limited to 'support/latexindent')
-rw-r--r-- | support/latexindent/LatexIndent/BackUpFileProcedure.pm | 142 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/Environment.pm | 28 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/Version.pm | 4 | ||||
-rw-r--r-- | support/latexindent/README | 2 | ||||
-rw-r--r-- | support/latexindent/bin/linux/latexindent | bin | 6173390 -> 6173164 bytes | |||
-rw-r--r-- | support/latexindent/bin/macos/latexindent | bin | 6402617 -> 6402390 bytes | |||
-rw-r--r-- | support/latexindent/defaultSettings.yaml | 777 | ||||
-rw-r--r-- | support/latexindent/documentation/latexindent-yaml-schema.json | 2557 | ||||
-rw-r--r-- | support/latexindent/documentation/latexindent.pdf | bin | 1265479 -> 1268947 bytes | |||
-rw-r--r-- | support/latexindent/documentation/latexindent.tex | 110 | ||||
-rwxr-xr-x | support/latexindent/latexindent.pl | 2 |
11 files changed, 1928 insertions, 1694 deletions
diff --git a/support/latexindent/LatexIndent/BackUpFileProcedure.pm b/support/latexindent/LatexIndent/BackUpFileProcedure.pm index 1fc5bbb28c..7828c44be3 100644 --- a/support/latexindent/LatexIndent/BackUpFileProcedure.pm +++ b/support/latexindent/LatexIndent/BackUpFileProcedure.pm @@ -26,14 +26,14 @@ use Exporter qw/import/; use Encode qw/decode/; our @EXPORT_OK = qw/create_back_up_file check_if_different/; -# copy main file to a back up in the case of the overwrite switch being active +# copy main file to a backup in the case of the overwrite switch being active sub create_back_up_file { my $self = shift; return unless ( ${$self}{overwrite} ); - # if we want to over write the current file create a backup first + # if we want to overwrite the current file create a backup first $logger->info("*Backup procedure (-w flag active):"); my $fileName = decode( "utf-8", ${$self}{fileName} ); @@ -46,10 +46,10 @@ sub create_back_up_file { = sort { $fileExtensionPreference{$a} <=> $fileExtensionPreference{$b} } keys(%fileExtensionPreference); # backup file name is the base name - my $backupFile = basename( ${$self}{fileName}, @fileExtensions ); + my $backupFileNoExt = basename( ${$self}{fileName}, @fileExtensions ); # add the user's backup directory to the backup path - $backupFile = decode( "utf-8", "${$self}{cruftDirectory}/$backupFile" ); + $backupFileNoExt = decode( "utf-8", "${$self}{cruftDirectory}/$backupFileNoExt" ); # local variables, determined from the YAML settings my $onlyOneBackUp = $mainSettings{onlyOneBackUp}; @@ -57,99 +57,72 @@ sub create_back_up_file { my $cycleThroughBackUps = $mainSettings{cycleThroughBackUps}; my $backupExtension = $mainSettings{backupExtension}; - # if both ($onlyOneBackUp and $maxNumberOfBackUps) then we have - # a conflict- er on the side of caution and turn off onlyOneBackUp - if ( $onlyOneBackUp and $maxNumberOfBackUps > 1 ) { - $logger->warn("*onlyOneBackUp=$onlyOneBackUp and maxNumberOfBackUps: $maxNumberOfBackUps"); - $logger->warn("setting onlyOneBackUp=0 which will allow you to reach $maxNumberOfBackUps back ups"); + # if both onlyOneBackUp and maxNumberOfBackUps are set, then we have a conflict + # err on the side of caution and turn off onlyOneBackUp + if ( $onlyOneBackUp and $maxNumberOfBackUps >= 1 ) { + $logger->warn("*onlyOneBackUp=$onlyOneBackUp and maxNumberOfBackUps=$maxNumberOfBackUps"); + $logger->warn("setting onlyOneBackUp=0 which will allow you to reach $maxNumberOfBackUps backups"); $onlyOneBackUp = 0; } - # if the user has specified that $maxNumberOfBackUps = 1 then - # they only want one backup - if ( $maxNumberOfBackUps == 1 ) { - $onlyOneBackUp = 1; - $logger->info("you set maxNumberOfBackUps=1, so I'm setting onlyOneBackUp: 1 "); - } - elsif ( $maxNumberOfBackUps <= 0 and !$onlyOneBackUp ) { - $onlyOneBackUp = 0; - $maxNumberOfBackUps = -1; - } + # determine the backup file name by adjoining backupExtension + my $backupFile = $backupFileNoExt . $backupExtension; - # if onlyOneBackUp is set, then the backup file will - # be overwritten each time - if ($onlyOneBackUp) { - $backupFile .= $backupExtension; - $logger->info("copying $fileName to $backupFile"); - $logger->info("$backupFile was overwritten (see onlyOneBackUp)") if ( -e $backupFile ); - } - else { - # start with a backup file .bak0 (or whatever $backupExtension is present) + # if onlyOneBackUp is *not* set, add a number to the backup file name + if ( !$onlyOneBackUp ) { my $backupCounter = 0; - $backupFile .= $backupExtension . $backupCounter; - - # if it exists, then keep going: .bak0, .bak1, ... - while ( -e $backupFile or $maxNumberOfBackUps > 1 ) { - if ( $backupCounter == $maxNumberOfBackUps ) { - $logger->info("maxNumberOfBackUps reached ($maxNumberOfBackUps, see maxNumberOfBackUps)"); - - # some users may wish to cycle through back up files, e.g: - # copy myfile.bak1 to myfile.bak0 - # copy myfile.bak2 to myfile.bak1 - # copy myfile.bak3 to myfile.bak2 - # - # current back up is stored in myfile.bak4 - if ($cycleThroughBackUps) { - $logger->info("cycleThroughBackUps detected (see cycleThroughBackUps) "); - for ( my $i = 1; $i <= $maxNumberOfBackUps; $i++ ) { - - # remove number from backUpFile - my $oldBackupFile = decode( "utf-8", $backupFile ); - $oldBackupFile =~ s/$backupExtension.*/$backupExtension/; - my $newBackupFile = decode( "utf-8", $oldBackupFile ); - - # add numbers back on - $oldBackupFile .= $i; - $newBackupFile .= $i - 1; - - # check that the oldBackupFile exists - if ( -e $oldBackupFile ) { - $logger->info(" copying $oldBackupFile to $newBackupFile "); - my $backUpFilePossible = 1; - copy( $oldBackupFile, $newBackupFile ) or ( $backUpFilePossible = 0 ); - if ( $backUpFilePossible == 0 ) { - $logger->fatal( - "*Could not write to backup file $backupFile. Please check permissions. Exiting."); - $logger->fatal("Exiting, no indentation done."); - $self->output_logfile(); - exit(5); - } + + # if the file already exists, increment the number until either + # the file does not exist, or you reach the maximal number of backups + while ( -e ( $backupFile . $backupCounter ) and $backupCounter != ( $maxNumberOfBackUps - 1 ) ) { + $logger->info("$backupFile$backupCounter already exists, incrementing by 1 (see maxNumberOfBackUps)"); + $backupCounter++; + } + $backupFile .= $backupCounter; + } + + # if the backup file already exists, output some information in the log file + # and proceed to cycleThroughBackUps if the latter is set + if ( -e $backupFile ) { + if ($onlyOneBackUp) { + $logger->info("$backupFile will be overwritten (see onlyOneBackUp)"); + } + else { + $logger->info("$backupFile will be overwritten (maxNumberOfBackUps reached, see maxNumberOfBackUps)"); + + # some users may wish to cycle through backup files, e.g.: + # copy myfile.bak1 to myfile.bak0 + # copy myfile.bak2 to myfile.bak1 + # copy myfile.bak3 to myfile.bak2 + # + # current backup is stored in myfile.bak4 + if ($cycleThroughBackUps) { + $logger->info("cycleThroughBackUps detected (see cycleThroughBackUps)"); + my $oldBackupFile; + my $newBackupFile; + for ( my $i = 1; $i < $maxNumberOfBackUps; $i++ ) { + $oldBackupFile = $backupFileNoExt . $backupExtension . $i; + $newBackupFile = $backupFileNoExt . $backupExtension . ( $i - 1 ); + + # check that the oldBackupFile exists + if ( -e $oldBackupFile ) { + $logger->info("Copying $oldBackupFile to $newBackupFile..."); + if ( !( copy( $oldBackupFile, $newBackupFile ) ) ) { + $logger->fatal("*Could not write to backup file $newBackupFile. Please check permissions."); + $logger->fatal("Exiting, no indentation done."); + $self->output_logfile(); + exit(5); } } } - - # rest maxNumberOfBackUps - $maxNumberOfBackUps = 1; - last; # break out of the loop } - elsif ( !( -e $backupFile ) ) { - $maxNumberOfBackUps = 1; - last; # break out of the loop - } - $logger->info( - "$backupFile already exists, incrementing by 1... (see maxNumberOfBackUps and onlyOneBackUp)"); - $backupCounter++; - $backupFile =~ s/$backupExtension.*/$backupExtension$backupCounter/; } - $logger->info("copying $fileName to $backupFile"); } # output these lines to the log file - $logger->info("Backup file: $backupFile"); + $logger->info("Backing up $fileName to $backupFile..."); $logger->info("$fileName will be overwritten after indentation"); - my $backUpFilePossible = 1; - copy( $fileName, $backupFile ) or ( $backUpFilePossible = 0 ); - if ( $backUpFilePossible == 0 ) { + if ( !( copy( $fileName, $backupFile ) ) ) { $logger->fatal("*Could not write to backup file $backupFile. Please check permissions."); $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); @@ -162,7 +135,7 @@ sub check_if_different { if ( ${$self}{originalBody} eq ${$self}{body} ) { $logger->info("*-wd switch active"); - $logger->info("Original body matches indented body, NOT overwriting, no back up files created"); + $logger->info("Original body matches indented body, NOT overwriting, no backup files created"); return; } @@ -173,4 +146,5 @@ sub check_if_different { ${$self}{overwrite} = 1; $self->create_back_up_file; } + 1; diff --git a/support/latexindent/LatexIndent/Environment.pm b/support/latexindent/LatexIndent/Environment.pm index c9a456fa1a..9a8fbaccf9 100644 --- a/support/latexindent/LatexIndent/Environment.pm +++ b/support/latexindent/LatexIndent/Environment.pm @@ -38,7 +38,32 @@ sub construct_environments_regexp { # read from fine tuning my $environmentNameRegExp = qr/${${$mainSettings{fineTuning}}{environments}}{name}/; - $environmentRegExp = qr/ + + if ( defined ${ ${ $mainSettings{fineTuning} }{environments} }{begin} + and defined ${ ${ $mainSettings{fineTuning} }{environments} }{end} ) + { + $environmentRegExp = qr/ + ( + ${${$mainSettings{fineTuning}}{environments}}{begin} + (\R*)? # possible line breaks (into $3) + ) # begin statement captured into $1 + ( + (?: # cluster-only (), don't capture + (?! # don't include \begin in the body + (?:\\begin\{) # cluster-only (), don't capture + ). # any character, but not \\begin + )*? # non-greedy + (\R*)? # possible line breaks (into $5) + ) # environment body captured into $4 + ( + ${${$mainSettings{fineTuning}}{environments}}{end} + ) # captured into $6 + (\h*)? # possibly followed by horizontal space + (\R)? # possibly followed by a line break + /sx; + } + else { + $environmentRegExp = qr/ ( \\begin\{ ( @@ -62,6 +87,7 @@ sub construct_environments_regexp { (\h*)? # possibly followed by horizontal space (\R)? # possibly followed by a line break /sx; + } } sub find_environments { diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm index 684b37c3c9..ba3d1433dd 100644 --- a/support/latexindent/LatexIndent/Version.pm +++ b/support/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.23.2'; -our $versionDate = '2023-09-23'; +our $versionNumber = '3.23.3'; +our $versionDate = '2023-10-13'; 1 diff --git a/support/latexindent/README b/support/latexindent/README index 01b6a38a63..9e6978dde6 100644 --- a/support/latexindent/README +++ b/support/latexindent/README @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - latexindent.pl, version 3.23.2, 2023-09-23 + latexindent.pl, version 3.23.3, 2023-10-13 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/support/latexindent/bin/linux/latexindent b/support/latexindent/bin/linux/latexindent Binary files differindex 928ec69c97..8c628fbbf3 100644 --- a/support/latexindent/bin/linux/latexindent +++ b/support/latexindent/bin/linux/latexindent diff --git a/support/latexindent/bin/macos/latexindent b/support/latexindent/bin/macos/latexindent Binary files differindex 0b5004c6fa..3a5b82e64e 100644 --- a/support/latexindent/bin/macos/latexindent +++ b/support/latexindent/bin/macos/latexindent diff --git a/support/latexindent/defaultSettings.yaml b/support/latexindent/defaultSettings.yaml index a3c04edf3a..67a2c4fbf4 100644 --- a/support/latexindent/defaultSettings.yaml +++ b/support/latexindent/defaultSettings.yaml @@ -1,8 +1,8 @@ # -# latexindent.pl, version 3.23.2, 2023-09-23 +# latexindent.pl, version 3.23.3, 2023-10-13 # # defaultSettings.yaml, the default settings for latexindent.pl -# +# # a script that aims to beautify .tex, .sty, .cls files # # (or latexindent.exe if you're on Windows) @@ -45,10 +45,10 @@ # according to the choices made in fileExtensionPreference # Other file extensions can be added. fileExtensionPreference: - .tex: 1 - .sty: 2 - .cls: 3 - .bib: 4 + .tex: 1 + .sty: 2 + .cls: 3 + .bib: 4 # default file extension of backup file (if -w switch is active) # for example, if your .tex file is called @@ -61,7 +61,6 @@ backupExtension: .bak # only one backup per file: # - if onlyOneBackUp is 0 then, as a safety measure, # the number on the extension increments by 1 each time: -# # myfile.bak0, myfile.bak1, myfile.bak2 # - if you set onlyOnebackUp to 1, then the backup file will # be overwritten each time (not recommended until you trust the script) @@ -89,55 +88,55 @@ cycleThroughBackUps: 0 # preferences for information displayed in the log file logFilePreferences: - showEveryYamlRead: 1 - showAmalgamatedSettings: 0 - showDecorationStartCodeBlockTrace: 0 - showDecorationFinishCodeBlockTrace: 0 - endLogFileWith: '--------------' - showGitHubInfoFooter: 1 - Dumper: - Terse: 1 - Indent: 1 - Useqq: 1 - Deparse: 1 - Quotekeys: 0 - Sortkeys: 1 - Pair: " => " + showEveryYamlRead: 1 + showAmalgamatedSettings: 0 + showDecorationStartCodeBlockTrace: 0 + showDecorationFinishCodeBlockTrace: 0 + endLogFileWith: '--------------' + showGitHubInfoFooter: 1 + Dumper: + Terse: 1 + Indent: 1 + Useqq: 1 + Deparse: 1 + Quotekeys: 0 + Sortkeys: 1 + Pair: " => " -# verbatim environments specified -# in this field will not be changed at all! +# verbatim environments specified +# in this field will not be changed at all! verbatimEnvironments: - verbatim: 1 - lstlisting: 1 - minted: 1 + verbatim: 1 + lstlisting: 1 + minted: 1 -# verbatim commands such as \verb! body !, \lstinline$something else$ +# verbatim commands such as \verb! body !, \lstinline$something else$ verbatimCommands: - verb: 1 - lstinline: 1 + verb: 1 + lstinline: 1 -# no indent blocks (not necessarily verbatim -# environments) which are marked as %\begin{noindent} -# or anything else that you detail in the following +# no indent blocks (not necessarily verbatim +# environments) which are marked as %\begin{noindent} +# or anything else that you detail in the following noIndentBlock: - noindent: 1 - cmhtest: 1 + noindent: 1 + cmhtest: 1 # \begin{document} and \end{document} are treated differently # by latexindent within filecontents environments fileContentsEnvironments: - filecontents: 1 - filecontents*: 1 + filecontents: 1 + filecontents*: 1 # indent preamble indentPreamble: 0 # assume no preamble in cls, sty, by default lookForPreamble: - .tex: 1 - .sty: 0 - .cls: 0 - .bib: 0 + .tex: 1 + .sty: 0 + .cls: 0 + .bib: 0 # some preambles can contain \begin and \end statements # that are not in their 'standard environment block', for example, @@ -151,81 +150,83 @@ defaultIndent: "\t" # remove trailing whitespace from all lines removeTrailingWhitespace: - beforeProcessing: 0 - afterProcessing: 1 + beforeProcessing: 0 + afterProcessing: 1 # name of code blocks that should have their body aligned at ampersand delimiters lookForAlignDelims: - tabular: - delims: 1 - alignDoubleBackSlash: 1 - spacesBeforeDoubleBackSlash: 1 - multiColumnGrouping: 0 - alignRowsWithoutMaxDelims: 1 - spacesBeforeAmpersand: 1 - spacesAfterAmpersand: 1 - justification: left - alignFinalDoubleBackSlash: 0 - dontMeasure: 0 - delimiterRegEx: (?<!\\)(&) - delimiterJustification: left - lookForChildCodeBlocks: 1 - alignContentAfterDoubleBackSlash: 0 - spacesAfterDoubleBackSlash: 1 - tabularx: - delims: 1 - longtable: 1 - tabu: 1 - array: 1 - matrix: 1 - listabla: 1 - # amsmath - align: 1 - align*: 1 - alignat: 1 - alignat*: 1 - aligned: 1 - bmatrix: 1 - Bmatrix: 1 - cases: 1 - flalign: 1 - flalign*: 1 - pmatrix: 1 - vmatrix: 1 - Vmatrix: 1 - # mathtools - cases*: 1 - dcases: 1 - dcases*: 1 - rcases: 1 - rcases*: 1 - drcases: 1 - drcases*: 1 - # nicematrix - NiceTabular: 1 - NiceMatrix: 1 - pNiceMatrix: 1 - bNiceMatrix: 1 - BNiceMatrix: 1 - vNiceMatrix: 1 - VNiceMatrix: 1 - NiceArray: 1 - pNiceArrayC: 1 - bNiceArrayC: 1 - BNiceArrayC: 1 - vNiceArrayC: 1 - VNiceArrayC: 1 - NiceArrayCwithDelims: 1 - pNiceArrayRC: 1 - bNiceArrayRC: 1 - BNiceArrayRC: 1 - vNiceArrayRC: 1 - VNiceArrayRC: 1 - NiceArrayRCwithDelims: 1 - # tabularray - tblr: 1 - longtblr: 1 - talltblr: 1 + tabular: + delims: 1 + alignDoubleBackSlash: 1 + spacesBeforeDoubleBackSlash: 1 + multiColumnGrouping: 0 + alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 + justification: left + alignFinalDoubleBackSlash: 0 + dontMeasure: 0 + delimiterRegEx: (?<!\\)(&) + delimiterJustification: left + lookForChildCodeBlocks: 1 + alignContentAfterDoubleBackSlash: 0 + spacesAfterDoubleBackSlash: 1 + tabularx: + delims: 1 + longtable: 1 + tabu: 1 + array: 1 + matrix: 1 + listabla: 1 + # amsmath + align: 1 + align*: 1 + alignat: 1 + alignat*: 1 + aligned: 1 + alignedat: 1 + bmatrix: 1 + Bmatrix: 1 + cases: 1 + flalign: 1 + flalign*: 1 + pmatrix: 1 + split: 1 + vmatrix: 1 + Vmatrix: 1 + # mathtools + cases*: 1 + dcases: 1 + dcases*: 1 + rcases: 1 + rcases*: 1 + drcases: 1 + drcases*: 1 + # nicematrix + NiceTabular: 1 + NiceMatrix: 1 + pNiceMatrix: 1 + bNiceMatrix: 1 + BNiceMatrix: 1 + vNiceMatrix: 1 + VNiceMatrix: 1 + NiceArray: 1 + pNiceArrayC: 1 + bNiceArrayC: 1 + BNiceArrayC: 1 + vNiceArrayC: 1 + VNiceArrayC: 1 + NiceArrayCwithDelims: 1 + pNiceArrayRC: 1 + bNiceArrayRC: 1 + BNiceArrayRC: 1 + vNiceArrayRC: 1 + VNiceArrayRC: 1 + NiceArrayRCwithDelims: 1 + # tabularray + tblr: 1 + longtblr: 1 + talltblr: 1 # if you want the script to look for \item commands # and format it, as follows (for example), @@ -237,39 +238,39 @@ lookForAlignDelims: # \end{itemize} # then populate indentAfterItems. See also itemNames indentAfterItems: - itemize: 1 - itemize*: 1 - enumerate: 1 - enumerate*: 1 - description: 1 - description*: 1 - list: 1 + itemize: 1 + itemize*: 1 + enumerate: 1 + enumerate*: 1 + description: 1 + description*: 1 + list: 1 # if you want to use other names for your items (for example, \part) # then populate them here; note that you can trick latexindent.pl # into indenting all kinds of commands (within environments specified in # indentAfterItems) using this technique. itemNames: - item: 1 - myitem: 1 + item: 1 + myitem: 1 # specialBeginEnd is, by default, mathmode focus, although # there's no restrictions specialBeginEnd: - displayMath: - begin: (?<!\\)\\\[ # \[ but *not* \\[ - end: \\\] # \] - lookForThis: 1 - inlineMath: - begin: (?<!\$)(?<!\\)\$(?!\$) # $ but *not* \$ or $$ - body: [^$]*? # anything *except* $ - end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$ - lookForThis: 1 - displayMathTeX: - begin: \$\$ # $$ - end: \$\$ # $$ - lookForThis: 1 - specialBeforeCommand: 0 + displayMath: + begin: (?<!\\)\\\[ # \[ but *not* \\[ + end: \\\] # \] + lookForThis: 1 + inlineMath: + begin: (?<!\$)(?<!\\)\$(?!\$) # $ but *not* \$ or $$ + body: [^$]*? # anything *except* $ + end: (?<!\\)\$(?!\$) # $ but *not* \$ or $$ + lookForThis: 1 + displayMathTeX: + begin: \$\$ # $$ + end: \$\$ # $$ + lookForThis: 1 + specialBeforeCommand: 0 # if you want to add indentation after # a heading, such as \part, \chapter, etc @@ -280,30 +281,30 @@ specialBeginEnd: # you can also change the level if you like, # or add your own title command indentAfterHeadings: - part: - indentAfterThisHeading: 0 - level: 1 - chapter: - indentAfterThisHeading: 0 - level: 2 - section: - indentAfterThisHeading: 0 - level: 3 - subsection: - indentAfterThisHeading: 0 - level: 4 - subsection*: - indentAfterThisHeading: 0 - level: 4 - subsubsection: - indentAfterThisHeading: 0 - level: 5 - paragraph: - indentAfterThisHeading: 0 - level: 6 - subparagraph: - indentAfterThisHeading: 0 - level: 7 + part: + indentAfterThisHeading: 0 + level: 1 + chapter: + indentAfterThisHeading: 0 + level: 2 + section: + indentAfterThisHeading: 0 + level: 3 + subsection: + indentAfterThisHeading: 0 + level: 4 + subsection*: + indentAfterThisHeading: 0 + level: 4 + subsubsection: + indentAfterThisHeading: 0 + level: 5 + paragraph: + indentAfterThisHeading: 0 + level: 6 + subparagraph: + indentAfterThisHeading: 0 + level: 7 # maximum indentation, off by default maximumIndentation: -1 @@ -314,76 +315,74 @@ maximumIndentation: -1 # the *current* level of indentation they just won't # get any *additional* indentation noAdditionalIndent: - myexample: 1 - mydefinition: 1 - problem: 1 - exercises: 1 - mysolution: 1 - foreach: 0 - widepage: 1 - comment: 1 - document: 1 - frame: 0 + myexample: 1 + mydefinition: 1 + problem: 1 + exercises: 1 + mysolution: 1 + foreach: 0 + widepage: 1 + comment: 1 + document: 1 + frame: 0 # if you have indent rules for particular code blocks # then you can populate them in indentRules; for example, you might just want # to use a space " " or maybe a double tab "\t\t" indentRules: - myenvironment: "\t\t" - anotherenvironment: "\t\t\t\t" - chapter: " " - section: " " - item: " " - myitem: " " + myenvironment: "\t\t" + anotherenvironment: "\t\t\t\t" + chapter: " " + section: " " + item: " " + myitem: " " # set noAdditionalIndent globally for codeblocks noAdditionalIndentGlobal: - environments: 0 # 0/1 - commands: 1 # 0/1 - optionalArguments: 0 # 0/1 - mandatoryArguments: 0 # 0/1 - ifElseFi: 0 # 0/1 - items: 0 # 0/1 - keyEqualsValuesBracesBrackets: 0 # 0/1 - namedGroupingBracesBrackets: 0 # 0/1 - UnNamedGroupingBracesBrackets: 0 # 0/1 - specialBeginEnd: 0 # 0/1 - afterHeading: 0 # 0/1 - filecontents: 0 # 0/1 + environments: 0 # 0/1 + commands: 1 # 0/1 + optionalArguments: 0 # 0/1 + mandatoryArguments: 0 # 0/1 + ifElseFi: 0 # 0/1 + items: 0 # 0/1 + keyEqualsValuesBracesBrackets: 0 # 0/1 + namedGroupingBracesBrackets: 0 # 0/1 + UnNamedGroupingBracesBrackets: 0 # 0/1 + specialBeginEnd: 0 # 0/1 + afterHeading: 0 # 0/1 + filecontents: 0 # 0/1 # set indentRules globally for codeblocks; these need # to be horizontal spaces, if they are to be used indentRulesGlobal: - environments: 0 # 0/h-space - commands: 0 # 0/h-space - optionalArguments: 0 # 0/h-space - mandatoryArguments: 0 # 0/h-space - ifElseFi: 0 # 0/h-space - items: 0 # 0/h-space - keyEqualsValuesBracesBrackets: 0 # 0/h-space - namedGroupingBracesBrackets: 0 # 0/h-space - UnNamedGroupingBracesBrackets: 0 # 0/h-space - specialBeginEnd: 0 # 0/h-space - afterHeading: 0 # 0/h-space - filecontents: 0 # 0/h-space + environments: 0 # 0/h-space + commands: 0 # 0/h-space + optionalArguments: 0 # 0/h-space + mandatoryArguments: 0 # 0/h-space + ifElseFi: 0 # 0/h-space + items: 0 # 0/h-space + keyEqualsValuesBracesBrackets: 0 # 0/h-space + namedGroupingBracesBrackets: 0 # 0/h-space + UnNamedGroupingBracesBrackets: 0 # 0/h-space + specialBeginEnd: 0 # 0/h-space + afterHeading: 0 # 0/h-space + filecontents: 0 # 0/h-space # command code block details commandCodeBlocks: - roundParenthesesAllowed: 1 - stringsAllowedBetweenArguments: - - - amalgamate: 1 - - node - - at - - to - - decoration - - \+\+ - - \-\- - - \#\#\d - commandNameSpecial: - - - amalgamate: 1 - - '@ifnextchar\[' + roundParenthesesAllowed: 1 + stringsAllowedBetweenArguments: + - amalgamate: 1 + - node + - at + - to + - decoration + - \+\+ + - \-\- + - \#\#\d + commandNameSpecial: + - amalgamate: 1 + - '@ifnextchar\[' # change dos line breaks into unix dos2unixlinebreaks: 0 @@ -499,130 +498,128 @@ dos2unixlinebreaks: 0 # # you can specify settings on a per-name basis modifyLineBreaks: - preserveBlankLines: 1 # 0/1 - condenseMultipleBlankLinesInto: 1 # 0/1 - oneSentencePerLine: - manipulateSentences: 0 # 0/1 - removeSentenceLineBreaks: 1 # 0/1 - multipleSpacesToSingle: 1 # 0/1 - textWrapSentences: 0 # 1 disables main textWrap - sentenceIndent: "" - sentencesFollow: - par: 1 # 0/1 - blankLine: 1 # 0/1 - fullStop: 1 # 0/1 - exclamationMark: 1 # 0/1 - questionMark: 1 # 0/1 - rightBrace: 1 # 0/1 - commentOnPreviousLine: 1 # 0/1 - other: 0 # regex - sentencesBeginWith: - A-Z: 1 # 0/1 - a-z: 0 # 0/1 - other: 0 # regex - sentencesEndWith: - basicFullStop: 0 # 0/1 - betterFullStop: 1 # 0/1 - exclamationMark: 1 # 0/1 - questionMark: 1 # 0/1 - other: 0 # regex - sentencesDoNOTcontain: - other: \\begin # regex - textWrapOptions: - columns: 0 - multipleSpacesToSingle: 1 - removeBlockLineBreaks: 1 - when: before # before/after - comments: - wrap: 0 # 0/1 - inheritLeadingSpace: 0 # 0/1 - blocksFollow: - headings: 1 # 0/1 - commentOnPreviousLine: 1 # 0/1 - par: 1 # 0/1 - blankLine: 1 # 0/1 - verbatim: 1 # 0/1 - filecontents: 1 # 0/1 - other: \\\]|\\item(?:\h|\[) # regex - blocksBeginWith: - A-Z: 1 # 0/1 - a-z: 1 # 0/1 - 0-9: 0 # 0/1 - other: 0 # regex - blocksEndBefore: - commentOnOwnLine: 1 # 0/1 - verbatim: 1 # 0/1 - filecontents: 1 # 0/1 - other: \\begin\{|\\\[|\\end\{ # regex - huge: overflow # forbid mid-word line breaks - separator: "" - # poly-switches below here # -1: remove, 0: off, 1: add, 2: comment+add, 3: add blank line, 4: add blank line - environments: - BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 - BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ## equation*: - ## BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ifElseFi: - IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 - BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 - OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 - FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ## ifnum: - ## IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ## ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - ## FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ## FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - commands: - CommandStartsOnOwnLine: 0 - CommandNameFinishesWithLineBreak: 0 - optionalArguments: - LSqBStartsOnOwnLine: 0 # -1,0,1,2,3,4 - OptArgBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - RSqBStartsOnOwnLine: 0 # -1,0,1,2,3,4 - RSqBFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - mandatoryArguments: - LCuBStartsOnOwnLine: 0 # -1,0,1,2,3,4 - MandArgBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - RCuBStartsOnOwnLine: 0 # -1,0,1,2,3,4 - RCuBFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - keyEqualsValuesBracesBrackets: - KeyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EqualsStartsOnOwnLine: 0 # -1,0,1,2,3,4 - EqualsFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - items: - ItemStartsOnOwnLine: 0 # -1,0,1,2,3,4 - ItemFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - namedGroupingBracesBrackets: - NameStartsOnOwnLine: 0 # -1,0,1,2,3,4 - NameFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - specialBeginEnd: - SpecialBeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 - SpecialBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 - SpecialEndStartsOnOwnLine: 0 # -1,0,1,2,3,4 - SpecialEndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 - verbatim: - VerbatimBeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 - VerbatimEndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + preserveBlankLines: 1 # 0/1 + condenseMultipleBlankLinesInto: 1 # 0/1 + oneSentencePerLine: + manipulateSentences: 0 # 0/1 + removeSentenceLineBreaks: 1 # 0/1 + multipleSpacesToSingle: 1 # 0/1 + textWrapSentences: 0 # 1 disables main textWrap + sentenceIndent: "" + sentencesFollow: + par: 1 # 0/1 + blankLine: 1 # 0/1 + fullStop: 1 # 0/1 + exclamationMark: 1 # 0/1 + questionMark: 1 # 0/1 + rightBrace: 1 # 0/1 + commentOnPreviousLine: 1 # 0/1 + other: 0 # regex + sentencesBeginWith: + A-Z: 1 # 0/1 + a-z: 0 # 0/1 + other: 0 # regex + sentencesEndWith: + basicFullStop: 0 # 0/1 + betterFullStop: 1 # 0/1 + exclamationMark: 1 # 0/1 + questionMark: 1 # 0/1 + other: 0 # regex + sentencesDoNOTcontain: + other: \\begin # regex + textWrapOptions: + columns: 0 + multipleSpacesToSingle: 1 + removeBlockLineBreaks: 1 + when: before # before/after + comments: + wrap: 0 # 0/1 + inheritLeadingSpace: 0 # 0/1 + blocksFollow: + headings: 1 # 0/1 + commentOnPreviousLine: 1 # 0/1 + par: 1 # 0/1 + blankLine: 1 # 0/1 + verbatim: 1 # 0/1 + filecontents: 1 # 0/1 + other: \\\]|\\item(?:\h|\[) # regex + blocksBeginWith: + A-Z: 1 # 0/1 + a-z: 1 # 0/1 + 0-9: 0 # 0/1 + other: 0 # regex + blocksEndBefore: + commentOnOwnLine: 1 # 0/1 + verbatim: 1 # 0/1 + filecontents: 1 # 0/1 + other: \\begin\{|\\\[|\\end\{ # regex + huge: overflow # forbid mid-word line breaks + separator: "" + # poly-switches below here # -1: remove, 0: off, 1: add, 2: comment+add, 3: add blank line, 4: add blank line + environments: + BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 + BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 + EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + # equation*: + # BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # EndStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ifElseFi: + IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 + BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 + OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 + FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + # ifnum: + # IfStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # OrStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + # ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + # FiStartsOnOwnLine: 0 # -1,0,1,2,3,4 + # FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + commands: + CommandStartsOnOwnLine: 0 + CommandNameFinishesWithLineBreak: 0 + optionalArguments: + LSqBStartsOnOwnLine: 0 # -1,0,1,2,3,4 + OptArgBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + RSqBStartsOnOwnLine: 0 # -1,0,1,2,3,4 + RSqBFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + mandatoryArguments: + LCuBStartsOnOwnLine: 0 # -1,0,1,2,3,4 + MandArgBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + RCuBStartsOnOwnLine: 0 # -1,0,1,2,3,4 + RCuBFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + keyEqualsValuesBracesBrackets: + KeyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + EqualsStartsOnOwnLine: 0 # -1,0,1,2,3,4 + EqualsFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + items: + ItemStartsOnOwnLine: 0 # -1,0,1,2,3,4 + ItemFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + namedGroupingBracesBrackets: + NameStartsOnOwnLine: 0 # -1,0,1,2,3,4 + NameFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + specialBeginEnd: + SpecialBeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 + SpecialBodyStartsOnOwnLine: 0 # -1,0,1,2,3,4 + SpecialEndStartsOnOwnLine: 0 # -1,0,1,2,3,4 + SpecialEndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 + verbatim: + VerbatimBeginStartsOnOwnLine: 0 # -1,0,1,2,3,4 + VerbatimEndFinishesWithLineBreak: 0 # -1,0,1,2,3,4 # replacements, only active when either -r or -rr switches are active replacements: - - - amalgamate: 1 - - - this: latexindent.pl + - amalgamate: 1 + - this: latexindent.pl that: pl.latexindent lookForThis: 0 when: before @@ -630,58 +627,58 @@ replacements: # fineTuning allows you to tweak the internal pattern matching that # is central to latexindent.pl fineTuning: - environments: - name: [a-zA-Z@\*0-9_\\]+ - ifElseFi: - name: (?!@?if[a-zA-Z@]*?\{)@?if[a-zA-Z@]*? - commands: - name: [+a-zA-Z@\*0-9_\:]+? - items: - canBeFollowedBy: (?:\[[^]]*?\])|(?:<[^>]*?>) - keyEqualsValuesBracesBrackets: - name: [a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*? - follow: (?:(?<!\\)\{)|,|(?:(?<!\\)\[) - namedGroupingBracesBrackets: - name: [0-9\.a-zA-Z@\*><]+? - follow: \h|\R|\{|\[|\$|\)|\( - UnNamedGroupingBracesBrackets: - follow: \{|\[|,|&|\)|\(|\$ - arguments: - before: (?:#\d\h*;?,?\/?)+|\<.*?\> - between: _|\^|\* - trailingComments: - notPreceededBy: (?<!\\) - afterComment: .*? - modifyLineBreaks: - doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])? - comma: ',' - betterFullStop: |- - (?x) # ignore spaces in the below - (?: # - \.\) # .) - (?!\h*[a-z]) # not *followed by* a-z - ) # - | # OR - (?: # - (?<! # not *preceded by* - (?: # - (?:[eE]\.[gG]) # e.g OR E.g OR e.G OR E.G - | # - (?:[iI]\.[eE]) # i.e OR I.e OR i.E OR I.E - | # - (?:etc) # etc - | # - (?:[wW]\.[rR]\.[tT]) # w.r.t OR W.r.t OR w.R.t OR w.r.T OR W.R.t OR W.r.T OR w.R.T OR W.R.T - ) # - ) # - ) # - \. # . - (?! # not *followed by* - (?: # - [a-zA-Z0-9-~,] # - | # - \), # ), - | # - \)\. # ). - ) # - ) # + environments: + name: [a-zA-Z@\*0-9_\\]+ + ifElseFi: + name: (?!@?if[a-zA-Z@]*?\{)@?if[a-zA-Z@]*? + commands: + name: [+a-zA-Z@\*0-9_\:]+? + items: + canBeFollowedBy: (?:\[[^]]*?\])|(?:<[^>]*?>) + keyEqualsValuesBracesBrackets: + name: [a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*? + follow: (?:(?<!\\)\{)|,|(?:(?<!\\)\[) + namedGroupingBracesBrackets: + name: [0-9\.a-zA-Z@\*><]+? + follow: \h|\R|\{|\[|\$|\)|\( + UnNamedGroupingBracesBrackets: + follow: \{|\[|,|&|\)|\(|\$ + arguments: + before: (?:#\d\h*;?,?\/?)+|\<.*?\> + between: _|\^|\* + trailingComments: + notPreceededBy: (?<!\\) + afterComment: .*? + modifyLineBreaks: + doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])? + comma: ',' + betterFullStop: |- + (?x) # ignore spaces in the below + (?: # + \.\) # .) + (?!\h*[a-z]) # not *followed by* a-z + ) # + | # OR + (?: # + (?<! # not *preceded by* + (?: # + (?:[eE]\.[gG]) # e.g OR E.g OR e.G OR E.G + | # + (?:[iI]\.[eE]) # i.e OR I.e OR i.E OR I.E + | # + (?:etc) # etc + | # + (?:[wW]\.[rR]\.[tT]) # w.r.t OR W.r.t OR w.R.t OR w.r.T OR W.R.t OR W.r.T OR w.R.T OR W.R.T + ) # + ) # + ) # + \. # . + (?! # not *followed by* + (?: # + [a-zA-Z0-9-~,] # + | # + \), # ), + | # + \)\. # ). + ) # + ) # diff --git a/support/latexindent/documentation/latexindent-yaml-schema.json b/support/latexindent/documentation/latexindent-yaml-schema.json index 9d44f190af..be2f6c9832 100644 --- a/support/latexindent/documentation/latexindent-yaml-schema.json +++ b/support/latexindent/documentation/latexindent-yaml-schema.json @@ -1,1329 +1,1530 @@ { - "$schema": "http://json-schema.org/schema", - "$id": "latexindent-yaml-schema.json", - "title": "latexindent.pl YAML schema", - "description": "latexindent.pl YAML schema helper, V3.23.2 2023-09-23", - "type": "object", - "properties": { - "fileExtensionPreference": { - "description": "calling latexindent.pl to operate on myfile (without extension) is fine, and in which case the file extensions from this field will be used in order", - "type": "object", - "patternProperties": { - ".*": { - "description": "integer, specifying the order in which latexindent.pl will search for myfile ending with this extension", - "type": "integer" - } + "$schema": "http://json-schema.org/schema", + "$id": "latexindent-yaml-schema.json", + "title": "latexindent.pl YAML schema", + "description": "latexindent.pl YAML schema helper, V3.23.3 2023-10-13", + "type": "object", + "properties": { + "fileExtensionPreference": { + "description": "calling latexindent.pl to operate on myfile (without extension) is fine, and in which case the file extensions from this field will be used in order", + "type": "object", + "patternProperties": { + ".*": { + "description": "integer specifying the order in which latexindent.pl will search for myfile ending with this extension", + "type": "integer" } - }, - "backupExtension": { - "description": "when the -w, --overwrite switch is active, a back-up file is created with this extension", - "type": "string" - }, - "onlyOneBackUp": { - "description": "when the -w, --overwrite switch is active, the default is to create a back-up file for each call to latexindent.pl. Changing onlyOneBackUp to 1 means that only one back-up file is created", - "type": "integer", - "enum": [0,1] - }, - "maxNumberOfBackUps": { - "description": "when the -w, --overwrite switch is active, the default is to create a back-up file for each call to latexindent.pl. This field sets the maximum number of back-up files", - "type": "integer", - "minimum": 0 - }, - "cycleThroughBackUps": { - "description": "when the -w, --overwrite switch is active, back-up files can be overwritten in order; see also maxNumberOfBackUps", - "type": "integer", - "enum": [0,1] - }, - "logFilePreferences": { - "description": "latexindent.pl will write logging information to indent.log; the appearance of some of the information can be customised", - "type": "object", - "properties": { - "showEveryYamlRead": { - "description": "0/1, binary switch to show every YAML file's settings in indent.log", - "type": "integer", - "enum": [0,1] - }, - "showAmalgamatedSettings": { - "description": "0/1, binary switch to show the overall/amalgamated settings in indent.log", - "type": "integer", - "enum": [0,1] - }, - "showDecorationStartCodeBlockTrace": { - "description": "0/1, binary switch to show decorations at *start* of code block in indent.log when -t, -tt switches active", - "type": "integer", - "enum": [0,1] - }, - "showDecorationFinishCodeBlockTrace": { - "description": "0/1, binary switch to show decorations at *finish* of code block in indent.log when -t, -tt switches active", - "type": "integer", - "enum": [0,1] - }, - "endLogFileWith": { - "description": "string decoration to finish indent.log", - "type": "string" - }, - "showGitHubInfoFooter": { - "description": "0/1, binary switch to show GitHub information in footer of indent.log", - "type": "integer", - "enum": [0,1] - }, - "Dumper": { - "description": "options to be passed to the Dumper module; most helpful when -t, -tt active.", - "type": "object", - "properties": { - "Terse":{ - "type": "integer", - "enum": [0,1] - }, - "Indent":{ - "type": "integer", - "enum": [0,1] - }, - "Useqq":{ - "type": "integer", - "enum": [0,1] - }, - "Deparse":{ - "type": "integer", - "enum": [0,1] - }, - "Quotekeys":{ - "type": "integer", - "enum": [0,1] - }, - "Sortkeys":{ - "type": "integer", - "enum": [0,1] - }, - "Pair":{ - "type": "string" - } + } + }, + "backupExtension": { + "description": "when the -w, --overwrite switch is active, a back-up file is created with this extension", + "type": "string" + }, + "onlyOneBackUp": { + "description": "when the -w, --overwrite switch is active, the default is to create a back-up file for each call to latexindent.pl. Changing onlyOneBackUp to 1 means that only one back-up file is created", + "type": "integer", + "enum": [0, 1] + }, + "maxNumberOfBackUps": { + "description": "when the -w, --overwrite switch is active, the default is to create a back-up file for each call to latexindent.pl. This field sets the maximum number of back-up files", + "type": "integer", + "minimum": 0 + }, + "cycleThroughBackUps": { + "description": "when the -w, --overwrite switch is active, back-up files can be overwritten in order; see also maxNumberOfBackUps", + "type": "integer", + "enum": [0, 1] + }, + "logFilePreferences": { + "description": "latexindent.pl will write logging information to indent.log; the appearance of some of the information can be customised", + "type": "object", + "properties": { + "showEveryYamlRead": { + "description": "0/1, binary switch to show every YAML file's settings in indent.log", + "type": "integer", + "enum": [0, 1] + }, + "showAmalgamatedSettings": { + "description": "0/1, binary switch to show the overall/amalgamated settings in indent.log", + "type": "integer", + "enum": [0, 1] + }, + "showDecorationStartCodeBlockTrace": { + "description": "0/1, binary switch to show decorations at *start* of code block in indent.log when -t, -tt switches active", + "type": "integer", + "enum": [0, 1] + }, + "showDecorationFinishCodeBlockTrace": { + "description": "0/1, binary switch to show decorations at *finish* of code block in indent.log when -t, -tt switches active", + "type": "integer", + "enum": [0, 1] + }, + "endLogFileWith": { + "description": "string decoration to finish indent.log", + "type": "string" + }, + "showGitHubInfoFooter": { + "description": "0/1, binary switch to show GitHub information in footer of indent.log", + "type": "integer", + "enum": [0, 1] + }, + "Dumper": { + "description": "options to be passed to the Dumper module; most helpful when -t, -tt active.", + "type": "object", + "properties": { + "Terse": { + "type": "integer", + "enum": [0, 1] + }, + "Indent": { + "type": "integer", + "enum": [0, 1] + }, + "Useqq": { + "type": "integer", + "enum": [0, 1] + }, + "Deparse": { + "type": "integer", + "enum": [0, 1] + }, + "Quotekeys": { + "type": "integer", + "enum": [0, 1] + }, + "Sortkeys": { + "type": "integer", + "enum": [0, 1] + }, + "Pair": { + "type": "string" } } } - }, - "verbatimEnvironments": { - "description": "specify the names of verbatim environments in this field", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for this *environment*", - "type": "integer", - "enum": [0,1] - } + } + }, + "verbatimEnvironments": { + "description": "specify the names of verbatim environments in this field", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for this *environment*", + "type": "integer", + "enum": [0, 1] } - }, - "verbatimCommands": { - "description": "specify the names of verbatim *commands* in this field", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for this *command*", - "type": "integer", - "enum": [0,1] - } + } + }, + "verbatimCommands": { + "description": "specify the names of verbatim *commands* in this field", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for this *command*", + "type": "integer", + "enum": [0, 1] } - }, - "noIndentBlock": { - "description": "specify the names of *noIndentBlock* in this field", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for this *noIndentBlock*", - "type": "integer", - "enum": [0,1] - } + } + }, + "noIndentBlock": { + "description": "specify the names of *noIndentBlock* in this field", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for this *noIndentBlock*", + "type": "integer", + "enum": [0, 1] } - }, - "fileContentsEnvironments": { - "description": "specify the names of *filecontents* in this field", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for this *filecontents* environment", - "type": "integer", - "enum": [0,1] - } + } + }, + "fileContentsEnvironments": { + "description": "specify the names of *filecontents* in this field", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for this *filecontents* environment", + "type": "integer", + "enum": [0, 1] } - }, - "indentPreamble": { - "description": "0/1, binary switch to instruct latexindent.pl to operate on preamble or not", - "type": "integer", - "enum": [0,1] - }, - "lookForPreamble": { - "description": "list of extensions detailing which files latexindent.pl should look for preamble", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch for preamble search for this file type", - "type": "integer", - "enum": [0,1] - } + } + }, + "indentPreamble": { + "description": "0/1, binary switch to instruct latexindent.pl to operate on preamble or not", + "type": "integer", + "enum": [0, 1] + }, + "lookForPreamble": { + "description": "list of extensions detailing which files latexindent.pl should look for preamble", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch for preamble search for this file type", + "type": "integer", + "enum": [0, 1] } - }, - "preambleCommandsBeforeEnvironments": { - "description": "0/1, binary switch to instruct latexindent.pl to search for commands before environments in preamble", - "type": "integer", - "enum": [0,1] - }, - "defaultIndent": { - "description": "default indentation, needs to be specified as horizontal space", - "type": "string" - }, - "removeTrailingWhitespace": { - "description": "remove horizontal space at the *end* of lines", - "type": "object", - "properties": { - "beforeProcessing": { - "description": "0/1, binary switch to remove horizontal space *before* indenting", - "type": "integer", - "enum": [0,1] - }, - "afterProcessing": { - "description": "0/1, binary switch to remove horizontal space *after* indenting", - "type": "integer", - "enum": [0,1] - } + } + }, + "preambleCommandsBeforeEnvironments": { + "description": "0/1, binary switch to instruct latexindent.pl to search for commands before environments in preamble", + "type": "integer", + "enum": [0, 1] + }, + "defaultIndent": { + "description": "default indentation, needs to be specified as horizontal space", + "type": "string" + }, + "removeTrailingWhitespace": { + "description": "remove horizontal space at the *end* of lines", + "type": "object", + "properties": { + "beforeProcessing": { + "description": "0/1, binary switch to remove horizontal space *before* indenting", + "type": "integer", + "enum": [0, 1] + }, + "afterProcessing": { + "description": "0/1, binary switch to remove horizontal space *after* indenting", + "type": "integer", + "enum": [0, 1] } - }, - "lookForAlignDelims": { - "description": "list of names of code blocks detailing that latexindent.pl should align at delimiters", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1 binary switch to detail if this code block has delimiters. Option to specify this field in 'advanced' form", - "type": ["integer","object"], - "properties": { - "delims": { - "description": "0/1, binary switch to look for delimiters", - "type": "integer", - "enum": [0,1] - }, - "alignDoubleBackSlash": { - "description": "0/1, binary switch to align the \\\\", - "type": "integer", - "enum": [0,1] - }, - "spacesBeforeDoubleBackSlash": { - "description": "integer detailing number of spaces *before* \\\\", - "type": "integer", - "minimum": 0 - }, - "multiColumnGrouping": { - "description": "0/1, binary switch to group alignment under \\multicolumn command", - "type": "integer", - "enum": [0,1] - }, - "alignRowsWithoutMaxDelims": { - "description": "0/1, binary switch to align rows without the maximum number of delimiters", - "type": "integer", - "enum": [0,1] - }, - "spacesBeforeAmpersand": { - "description": "integer detailing number of spaces *before* delimiter", - "type": "integer", - "minimum": 0 - }, - "spacesAfterAmpersand": { - "description": "integer detailing number of spaces *after* delimiter", - "type": "integer", - "minimum": 0 - }, - "justification": { - "description": "justification of cell", - "type": "string", - "enum": ["left", "right"] - }, - "alignFinalDoubleBackSlash": { - "description": "0/1, binary switch to align final \\\\", - "type": "integer", - "enum": [0,1] - }, - "dontMeasure": { - "description": "entries not to be measured in the alignment routine", - "type": ["integer","string","array"], - "items": { - "type": ["string","object"], - "description": "entry not to be measured", - "properties": { - "this": { - "type": "string", - "description": "string containing the cell *not* to be measured" - }, - "applyTo": { - "type": "string", - "enum": ["cell", "row"], - "description": "detail cell or row" - }, - "regex": { - "type": "string", - "description": "regular expression to match cell or row" - } + } + }, + "lookForAlignDelims": { + "description": "list of names of code blocks detailing that latexindent.pl should align at delimiters", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to detail if this code block has delimiters. Option to specify this field in 'advanced' form", + "type": ["integer", "object"], + "properties": { + "delims": { + "description": "0/1, binary switch to look for delimiters", + "type": "integer", + "enum": [0, 1] + }, + "alignDoubleBackSlash": { + "description": "0/1, binary switch to align the \\\\", + "type": "integer", + "enum": [0, 1] + }, + "spacesBeforeDoubleBackSlash": { + "description": "integer detailing number of spaces *before* \\\\", + "type": "integer", + "minimum": 0 + }, + "multiColumnGrouping": { + "description": "0/1, binary switch to group alignment under \\multicolumn command", + "type": "integer", + "enum": [0, 1] + }, + "alignRowsWithoutMaxDelims": { + "description": "0/1, binary switch to align rows without the maximum number of delimiters", + "type": "integer", + "enum": [0, 1] + }, + "spacesBeforeAmpersand": { + "description": "integer detailing number of spaces *before* delimiter", + "type": "integer", + "minimum": 0 + }, + "spacesAfterAmpersand": { + "description": "integer detailing number of spaces *after* delimiter", + "type": "integer", + "minimum": 0 + }, + "justification": { + "description": "justification of cell", + "type": "string", + "enum": ["left", "right"] + }, + "alignFinalDoubleBackSlash": { + "description": "0/1, binary switch to align final \\\\", + "type": "integer", + "enum": [0, 1] + }, + "dontMeasure": { + "description": "entries not to be measured in the alignment routine; can also be set to 'largest'", + "type": ["integer", "string", "array"], + "items": { + "description": "entry not to be measured", + "type": ["string", "object"], + "properties": { + "this": { + "type": "string", + "description": "string containing the cell *not* to be measured" + }, + "applyTo": { + "type": "string", + "enum": ["cell", "row"], + "description": "detail cell or row" + }, + "regex": { + "type": "string", + "description": "regular expression to match cell or row" } - } - }, - "delimiterRegEx": { - "description": "delimiter regex. NOTE: the capturing ()", - "type": "string" - }, - "delimiterJustification": { - "description": "delimiter justification", - "type": "string", - "enum": ["left", "right"] - }, - "lookForChildCodeBlocks": { - "description": "0/1. binary switch to look for child code blocks", - "type": "integer", - "enum": [0,1] + } } + }, + "delimiterRegEx": { + "description": "delimiter regex. NOTE: the capturing ()", + "type": "string" + }, + "delimiterJustification": { + "description": "delimiter justification", + "type": "string", + "enum": ["left", "right"] + }, + "lookForChildCodeBlocks": { + "description": "0/1, binary switch to look for child code blocks", + "type": "integer", + "enum": [0, 1] + }, + "alignContentAfterDoubleBackSlash": { + "description": "0/1, binary switch to align content after \\\\", + "type": "integer", + "enum": [0, 1] + }, + "spacesAfterDoubleBackSlash": { + "description": "integer detailing number of spaces to be placed *after* \\\\ when alignContentAfterDoubleBackSlash is active", + "type": "integer", + "minimum": 0 } } } - }, - "indentAfterItems": { - "description": "specify the names of environments that contain items", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for items in this environment", - "type": "integer", - "enum": [0,1] - } + } + }, + "indentAfterItems": { + "description": "specify the names of environments that contain items", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for items in this environment", + "type": "integer", + "enum": [0, 1] + } + } + }, + "itemNames": { + "description": "names of items", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean don't look for/look for items", + "type": "integer", + "enum": [0, 1] + } + } + }, + "specialBeginEnd": { + "description": "special code blocks have begin, end, and optionally 'middle' specified as regular expressions", + "type": "object", + "properties": { + "specialBeforeCommand": { + "description": "0/1, binary switch to look for commands before special code blocks", + "type": "integer", + "enum": [0, 1] } }, - "itemNames": { - "description": "names of items", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean don't look for/look for items", - "type": "integer", - "enum": [0,1] + "patternProperties": { + ".*": { + "description": "name of special code block", + "type": "object", + "properties": { + "begin": { + "type": "string", + "description": "regular expression containing the *beginning* part" + }, + "middle": { + "type": "string", + "description": "optional: regular expression containing the *middle* part" + }, + "end": { + "type": "string", + "description": "regular expression containing the *ending* part" + }, + "body": { + "type": "string", + "description": "optional: regular expression containing the body of the block" + }, + "lookForThis": { + "type": "integer", + "description": "optional: 0/1, binary switch detailing look for this or not. Default is 1 if not specified", + "enum": [0, 1] + } } } - }, - "specialBeginEnd": { - "description": "special code blocks have begin, end, and optionally 'middle' specified as regular expressions", - "type": "object", - "properties": { - "specialBeforeCommand": { - "description": "0/1, binary switch to look for commands before special code blocks", - "type": "integer", - "enum": [0,1] + } + }, + "indentAfterHeadings": { + "description": "indentation after headings", + "type": "object", + "patternProperties": { + ".*": { + "description": "name of heading", + "type": "object", + "properties": { + "indentAfterThisHeading": { + "type": "integer", + "description": "0/1, binary switch to look for heading or not", + "enum": [0, 1] + }, + "level": { + "type": "integer", + "description": "level of the heading (minimum is 1)", + "minimum": 1 + } } + } + } + }, + "maximumIndentation": { + "description": "maximum value of indentation; specify as horizontal space", + "type": ["string", "integer"] + }, + "noAdditionalIndent": { + "description": "names of code blocks to not have additional indentation", + "type": "object", + "patternProperties": { + ".*": { + "description": "0/1, binary switch to mean code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + } + } + }, + "indentRules": { + "description": "per-code block indentation rule", + "type": "object", + "patternProperties": { + ".*": { + "description": "indentation/horizontal space per-code block", + "type": "string" + } + } + }, + "noAdditionalIndentGlobal": { + "description": "*types* of code blocks to not have additional indentation", + "type": "object", + "properties": { + "environments": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "commands": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "optionalArguments": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "mandatoryArguments": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "ifElseFi": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "items": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "keyEqualsValuesBracesBrackets": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "namedGroupingBracesBrackets": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "UnNamedGroupingBracesBrackets": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "specialBeginEnd": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + }, + "afterHeading": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] }, - "patternProperties": { - ".*": { - "description": "name of special code block", - "type": "object", + "filecontents": { + "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", + "type": "integer", + "enum": [0, 1] + } + } + }, + "indentRulesGlobal": { + "description": "*types* of code blocks indentation rules", + "type": "object", + "properties": { + "environments": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "commands": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "optionalArguments": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "mandatoryArguments": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "ifElseFi": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "items": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "keyEqualsValuesBracesBrackets": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "namedGroupingBracesBrackets": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "UnNamedGroupingBracesBrackets": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "specialBeginEnd": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "afterHeading": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + }, + "filecontents": { + "description": "indentation rules per *type* of code block", + "type": ["integer", "string"] + } + } + }, + "commandCodeBlocks": { + "description": "command code blocks need some particular attention", + "type": "object", + "properties": { + "roundParenthesesAllowed": { + "description": "0/1, binary switch to not allow/allow round parenthesis () between arguments", + "type": "integer", + "enum": [0, 1] + }, + "stringsAllowedBetweenArguments": { + "description": "strings allowed between arguments", + "type": ["integer", "array"], + "items": { + "description": "entry to be allowed between arguments", + "type": ["string", "object"], "properties": { - "begin":{ - "type": "string", - "description": "regular expression containing the *beginning* part" - }, - "middle":{ - "type": "string", - "description": "optional: regular expression containing the *middle* part" - }, - "end":{ - "type": "string", - "description": "regular expression containing the *ending* part" - }, - "lookForThis":{ + "amalgamate": { + "description": "optional: 0/1, binary switch to add to/overwrite previously loaded items. Default is 1 if not specified", "type": "integer", - "description": "optional 0/1, binary switch detailing look for this or not. Default is 1 if not specified", - "enum": [0,1] + "enum": [0, 1] } } } - } - }, - "indentAfterHeadings": { - "description": "indentation after headings", - "type": "object", - "patternProperties": { - ".*": { - "description": "name of heading", - "type": "object", + }, + "commandNameSpecial": { + "description": "there are some particular commands that need individual attention", + "type": ["integer", "array"], + "items": { + "description": "entry for particular attention", + "type": ["string", "object"], "properties": { - "indentAfterThisHeading":{ + "amalgamate": { + "description": "optional: 0/1, binary switch to add to/overwrite previously loaded items. Default is 1 if not specified", "type": "integer", - "description": "0/1, binary switch to look for heading or not", - "enum": [0,1] - }, - "level":{ - "type": "integer", - "description": "level of the heading (minimum is 1)", - "minimum": 1 + "enum": [0, 1] } } } } - }, - "maximumIndentation": { - "description": "maximum value of indentation; specify as horizontal space", - "type": ["string","integer"] - }, - "noAdditionalIndent": { - "description": "names of code blocks to not have additional indentation", - "type": "object", - "patternProperties": { - ".*": { - "description": "0/1, binary switch to mean code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - } - } - }, - "indentRules": { - "description": "per-code block indentation rule", - "type": "object", - "patternProperties": { - ".*": { - "description": "indentation/horizontal space per-code block", - "type": "string" - } - } - }, - "noAdditionalIndentGlobal": { - "description": "*types* of code blocks to not have additional indentation", - "type": "object", - "properties": { - "environments": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "commands": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "optionalArguments": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "mandatoryArguments": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "ifElseFi": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "items": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "keyEqualsValuesBracesBrackets": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "namedGroupingBracesBrackets": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "UnNamedGroupingBracesBrackets": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "specialBeginEnd": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "afterHeading": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - }, - "filecontents": { - "description": "0/1, binary switch to mean *type* of code block does not have/has additional indentation", - "type": "integer", - "enum": [0,1] - } - } - }, - "indentRulesGlobal": { - "description": "*types* of code blocks indentation rules", - "type": "object", - "properties": { - "environments": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "commands": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "optionalArguments": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "mandatoryArguments": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "ifElseFi": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "items": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "keyEqualsValuesBracesBrackets": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "namedGroupingBracesBrackets": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "UnNamedGroupingBracesBrackets": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "specialBeginEnd": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "afterHeading": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - }, - "filecontents": { - "description": "indentation rules per *type* of code block", - "type": ["integer","string"] - } - } - }, - "commandCodeBlocks": { - "description": "command code blocks need some particular attention", - "type": "object", - "properties": { - "roundParenthesesAllowed": { - "description": "0/1, binary switch to not allow/allow round parenthesis () between arguments", - "type": "integer", - "enum": [0,1] - }, - "stringsAllowedBetweenArguments": { - "description": "strings allowed between arguments", - "type": ["integer","array"], - "items": { - "type": ["string" ,"object"], - "description": "entry to be allowed between arguments" - } - }, - "commandNameSpecial": { - "description": "there are some particular commands that need individual attention", - "type": ["integer","array"], - "items": { - "type": ["string" ,"object"], - "description": "entry for particular attention" + } + }, + "dos2unixlinebreaks": { + "description": "0/1, binary switch to convert dos line breaks to unix line breaks", + "type": "integer", + "enum": [0, 1] + }, + "modifyLineBreaks": { + "description": "when -m switch active, latexindent.pl has ability to modify line breaks", + "type": "object", + "properties": { + "preserveBlankLines": { + "description": "0/1, binary switch to preserve blank lines or not", + "type": "integer", + "enum": [0, 1] + }, + "condenseMultipleBlankLinesInto": { + "description": "condense multiple blank lines into this many blank lines", + "type": "integer", + "minimum": 0 + }, + "oneSentencePerLine": { + "properties": { + "manipulateSentences": { + "description": "0/1, binary switch to perform one sentence per line routine or not", + "type": "integer", + "enum": [0, 1] + }, + "removeSentenceLineBreaks": { + "description": "0/1, binary switch to remove line breaks from within sentences or not", + "type": "integer", + "enum": [0, 1] + }, + "multipleSpacesToSingle": { + "description": "0/1, binary switch to convert multiple spaces into single spaces or not", + "type": "integer", + "enum": [0, 1] + }, + "textWrapSentences": { + "description": "0/1, binary switch to text wrap sentences or not", + "type": "integer", + "enum": [0, 1] + }, + "sentenceIndent": { + "description": "horizontal space representing indentation within sentences", + "type": "string" + }, + "sentencesFollow": { + "description": "things that sentences can follow", + "properties": { + "par": { + "description": "0/1, binary switch to determine if sentences can follow \\par or not", + "type": "integer", + "enum": [0, 1] + }, + "blankLine": { + "description": "0/1, binary switch to determine if sentences can follow blank lines or not", + "type": "integer", + "enum": [0, 1] + }, + "fullStop": { + "description": "0/1, binary switch to determine if sentences can follow blank lines or not", + "type": "integer", + "enum": [0, 1] + }, + "exclamationMark": { + "description": "0/1, binary switch to determine if sentences can follow ! or not", + "type": "integer", + "enum": [0, 1] + }, + "questionMark": { + "description": "0/1, binary switch to determine if sentences can follow ? or not", + "type": "integer", + "enum": [0, 1] + }, + "rightBrace": { + "description": "0/1, binary switch to determine if sentences can follow } or not", + "type": "integer", + "enum": [0, 1] + }, + "commentOnPreviousLine": { + "description": "0/1, binary switch to determine if sentences can follow % on previous line or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what else sentences can follow", + "type": ["integer", "string"] + } + } + }, + "sentencesBeginWith": { + "description": "things that sentences can begin with", + "properties": { + "A-Z": { + "description": "0/1, binary switch to determine if sentences can begin upper case letters or not", + "type": "integer", + "enum": [0, 1] + }, + "a-z": { + "description": "0/1, binary switch to determine if sentences can begin lower case letters or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what else sentences can begin with", + "type": ["integer", "string"] + } + } + }, + "sentencesEndWith": { + "description": "things that sentences can end with", + "properties": { + "basicFullStop": { + "description": "0/1, binary switch to determine if sentences can end with basic full stop (period) or not", + "type": "integer", + "enum": [0, 1] + }, + "betterFullStop": { + "description": "0/1, binary switch to determine if sentences can end with better full stop (period) or not (RECOMMENDED)", + "type": "integer", + "enum": [0, 1] + }, + "exclamationMark": { + "description": "0/1, binary switch to determine if sentences can end with ! or not", + "type": "integer", + "enum": [0, 1] + }, + "questionMark": { + "description": "0/1, binary switch to determine if sentences can end with ? or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what else sentences can end with", + "type": ["integer", "string"] + } + } + }, + "sentencesDoNOTcontain": { + "description": "things that sentences cannot contain", + "properties": { + "other": { + "description": "regular expression detailing what sentences cannot contain. Can be turned off by setting 0", + "type": ["integer", "string"] + } + } } } - } - }, - "dos2unixlinebreaks": { - "description": "0/1, binary switch to convert dos line breaks to unix line breaks", - "type": "integer", - "enum": [0,1] - }, - "modifyLineBreaks": { - "description": "when -m switch active, latexindent.pl has ability to modify line breaks", - "type": "object", - "properties": { - "preserveBlankLines": { - "description": "0/1, binary switch to preserve blank lines or not", - "type": "integer", - "enum": [0,1] - }, - "condenseMultipleBlankLinesInto": { - "description": "condense multiple blank lines into this many blank lines", - "type": "integer", - "minimum": 0 - }, - "oneSentencePerLine": { - "properties": { - "manipulateSentences": { - "description": "0/1, binary switch to perform one sentence per line routine or not", - "type": "integer", - "enum": [0,1] - }, - "removeSentenceLineBreaks": { - "description": "0/1, binary switch to remove line breaks from within sentences or not", - "type": "integer", - "enum": [0,1] - }, - "textWrapSentences": { - "description": "0/1, binary switch to text wrap sentences or not", - "type": "integer", - "enum": [0,1] - }, - "sentenceIndent": { - "description": "horizontal space representing indentation within sentences", - "type": "string" - }, - "sentencesFollow":{ - "description": "things that sentences can follow", - "properties": { - "par": { - "description": "0/1, binary switch to determine if sentences can follow \\par or not", - "type": "integer", - "enum": [0,1] - }, - "blankLine": { - "description": "0/1, binary switch to determine if sentences can follow blank lines or not", - "type": "integer", - "enum": [0,1] - }, - "fullStop": { - "description": "0/1, binary switch to determine if sentences can follow blank lines or not", - "type": "integer", - "enum": [0,1] - }, - "exclamationMark": { - "description": "0/1, binary switch to determine if sentences can follow ! or not", - "type": "integer", - "enum": [0,1] - }, - "questionMark": { - "description": "0/1, binary switch to determine if sentences can follow ? or not", - "type": "integer", - "enum": [0,1] - }, - "rightBrace": { - "description": "0/1, binary switch to determine if sentences can follow } or not", - "type": "integer", - "enum": [0,1] - }, - "commentOnPreviousLine": { - "description": "0/1, binary switch to determine if sentences can follow % on previous line or not", - "type": "integer", - "enum": [0,1] - }, - "other": { - "description": "regular expression detailing what else sentences can follow", - "type": ["integer","string"] - } + }, + "textWrapOptions": { + "description": "options for the text wrap routine", + "type": "object", + "properties": { + "columns": { + "description": "integer > 0 sets the number of columns for the text wrap routine, or if -1 then text wrap blocks simply have line breaks removed", + "type": "integer", + "minimum": -1 + }, + "multipleSpacesToSingle": { + "description": "0/1, binary switch to determine whether text wrap should convert multiple spaces to single space", + "type": "integer", + "enum": [0, 1] + }, + "removeBlockLineBreaks": { + "description": "0/1, binary switch to determine whether text wrap should convert multiple spaces to single space", + "type": "integer", + "enum": [0, 1] + }, + "when": { + "description": "optional: string specifying whether text wrapping should be made before/after code blocks have been found. Default is 'before' if not specified", + "type": "string", + "enum": ["before", "after"] + }, + "comments": { + "description": "instructions for wrapping comments", + "type": "object", + "properties": { + "wrap": { + "description": "0/1, binary switch to determine whether comments should be combined and wrapped", + "type": "integer", + "enum": [0, 1] + }, + "inheritLeadingSpace": { + "description": "0/1, binary switch to determine whether comments should inherit leading spaces", + "type": "integer", + "enum": [0, 1] } - }, - "sentencesBeginWith":{ - "description": "things that sentences can begin with", - "properties": { - "A-Z": { - "description": "0/1, binary switch to determine if sentences can begin upper case letters or not", - "type": "integer", - "enum": [0,1] - }, - "a-z": { - "description": "0/1, binary switch to determine if sentences can begin lower case letters or not", - "type": "integer", - "enum": [0,1] - }, - "other": { - "description": "regular expression detailing what else sentences can begin with", - "type": ["integer","string"] - } + } + }, + "blocksFollow": { + "description": "field containing switches that text wrap blocks *follow*", + "type": "object", + "properties": { + "headings": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after the fields listed in indentAfterHeading (regardless of the value of indentAfterThisHeading or level) or not. The heading command can, optionally, be followed by a label command", + "type": "integer", + "enum": [0, 1] + }, + "commentOnPreviousLine": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after a comment on its own line or not", + "type": "integer", + "enum": [0, 1] + }, + "par": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after \\par or not", + "type": "integer", + "enum": [0, 1] + }, + "blankLine": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after a blank line or not", + "type": "integer", + "enum": [0, 1] + }, + "verbatim": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after a verbatim block or not", + "type": "integer", + "enum": [0, 1] + }, + "filecontents": { + "description": "0/1, binary switch to instruct latexindent to find text wrap blocks after a filecontents environment or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what text wrap blocks should follow. Can be turned off by setting 0. The default value corresponds to the end of display math or an item command", + "type": "string" } - }, - "sentencesEndWith":{ - "description": "things that sentences can end with", - "properties": { - "basicFullStop": { - "description": "0/1, binary switch to determine if sentences can end with basic full stop (period) or not", - "type": "integer", - "enum": [0,1] - }, - "betterFullStop": { - "description": "0/1, binary switch to determine if sentences can end with better full stop (period) or not (RECOMMENDED)", - "type": "integer", - "enum": [0,1] - }, - "exclamationMark": { - "description": "0/1, binary switch to determine if sentences can end with ! or not", - "type": "integer", - "enum": [0,1] - }, - "questionMark": { - "description": "0/1, binary switch to determine if sentences can end with ? or not", - "type": "integer", - "enum": [0,1] - }, - "other": { - "description": "regular expression detailing what else sentences can end with", - "type": ["integer","string"] - } + } + }, + "blocksBeginWith": { + "description": "field containing switches that text wrap blocks *begin with*", + "type": "object", + "properties": { + "A-Z": { + "description": "0/1, binary switch to determine whether text wrap block can begin with an uppercase letter or not", + "type": "integer", + "enum": [0, 1] + }, + "a-z": { + "description": "0/1, binary switch to determine whether text wrap block can begin with a lowercase letter or not", + "type": "integer", + "enum": [0, 1] + }, + "0-9": { + "description": "0/1, binary switch to determine whether text wrap block can begin with a digit or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what text wrap blocks can begin with. Can be turned off by setting 0. Default is 0 if not specified", + "type": ["integer", "string"] } } - } - }, - "textWrapOptions":{ - "description": "options for the text wrap routine", - "type":"object", - "properties": { - "columns": { - "description": "integer > 0 sets the number of columns for the text wrap routine, or if -1 then text wrap blocks simply have line breaks removed", - "type": "integer", - "minimum": -1 - }, - "huge": { - "description": "WARNING: I don't recommend changing this from overflow", - "type": "string" - }, - "separator": { - "description": "can be any string, but I haven't found a good use case to change this from ''", - "type": "string" - }, - "multipleSpacesToSingle": { - "description": "0/1, binary switch to determine if text wrap should convert multiple spaces to single space", - "type": "integer", - "enum": [0,1] - }, - "blocksFollow": { - "description": "field containing switches that text wrap blocks *follow*", - "type": ["object"] - }, - "blocksBeginWith": { - "description": "field containing switches that text wrap blocks *begin with*", - "type": ["object"] - }, - "blocksEndBefore": { - "description": "field containing switches that text wrap blocks *end before*", - "type": ["object"] + }, + "blocksEndBefore": { + "description": "field containing switches that text wrap blocks *end before*", + "type": "object", + "properties": { + "commentOnOwnLine": { + "description": "0/1, binary switch to determine whether text wrap block should end before a comment on its own line or not", + "type": "integer", + "enum": [0, 1] + }, + "verbatim": { + "description": "0/1, binary switch to determine whether text wrap block should end before a verbatim environment or not", + "type": "integer", + "enum": [0, 1] + }, + "filecontents": { + "description": "0/1, binary switch to determine whether text wrap block should end before a filecontents environment or not", + "type": "integer", + "enum": [0, 1] + }, + "other": { + "description": "regular expression detailing what text wrap blocks should end before. Can be turned off by setting 0. The default value corresponds to begin statements, display math, and end statements", + "type": "string" + } } + }, + "huge": { + "description": "WARNING: I don't recommend changing this from overflow; passed to Perl's Text::Wrap module", + "type": "string", + "enum": ["overflow", "wrap", "die"] + }, + "tabstop": { + "description": "passed to Perl's Text::Wrap module", + "type": "integer" + }, + "separator": { + "description": "passed to Perl's Text::Wrap module", + "type": "string" + }, + "separator2": { + "description": "passed to Perl's Text::Wrap module", + "type": "string" + }, + "break": { + "description": "passed to Perl's Text::Wrap module", + "type": "string" + }, + "unexpand": { + "description": "passed to Perl's Text::Wrap module", + "type": "integer", + "enum": [0, 1] + } + } + }, + "environments": { + "description": "poly-switches for environments (GLOBAL)", + "type": "object", + "properties": { + "BeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of environments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "BodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of environments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "EndStartsOnOwnLine": { + "description": "poly-switch for line break before end of environments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "EndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of environments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] } }, - "environments": { - "description": "poly-switches for environments (GLOBAL)", - "type":"object", - "properties": { - "BeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of environments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "BodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of environments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EndStartsOnOwnLine":{ - "description": "poly-switch for line break before end of environments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of environments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + "patternProperties": { + ".*": { + "description": "poly-switches for environments (PER-NAME)", + "type": "object", + "properties": { + "BeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of environments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for environments (PER-NAME)", - "type": "object", - "properties": { - "BeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of environments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "BodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of environments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EndStartsOnOwnLine":{ - "description": "poly-switch for line break before end of environments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of environments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } - } - } - } - }, - "specialBeginEnd": { - "description": "poly-switches for specialBeginEnd (GLOBAL)", - "type":"object", - "properties": { - "SpecialBeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of specialBeginEnd (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialBodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of specialBeginEnd (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialEndStartsOnOwnLine":{ - "description": "poly-switch for line break before end of specialBeginEnd (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialEndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of specialBeginEnd (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + "BodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of environments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for specialBeginEnd (PER-NAME)", - "type": "object", - "properties": { - "SpecialBeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of specialBeginEnd (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialBodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of specialBeginEnd (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialEndStartsOnOwnLine":{ - "description": "poly-switch for line break before end of specialBeginEnd (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "SpecialEndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of specialBeginEnd (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } - } + "EndStartsOnOwnLine": { + "description": "poly-switch for line break before end of environments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "EndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of environments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] } } + } + } + }, + "specialBeginEnd": { + "description": "poly-switches for specialBeginEnd (GLOBAL)", + "type": "object", + "properties": { + "SpecialBeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of specialBeginEnd (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialBodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of specialBeginEnd (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialEndStartsOnOwnLine": { + "description": "poly-switch for line break before end of specialBeginEnd (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialEndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of specialBeginEnd (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } }, - "keyEqualsValuesBracesBrackets": { - "description": "poly-switches for key equals value (GLOBAL)", - "type":"object", - "properties": { - "KeyStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of key equals value (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EqualsStartsOnOwnLine":{ - "description": "poly-switch for line break before = of key equals value (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "EqualsFinishesWithLineBreak":{ - "description": "poly-switch for line break after = of key equals value (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] + "patternProperties": { + ".*": { + "description": "poly-switches for specialBeginEnd (PER-NAME)", + "type": "object", + "properties": { + "SpecialBeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of specialBeginEnd (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialBodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of specialBeginEnd (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialEndStartsOnOwnLine": { + "description": "poly-switch for line break before end of specialBeginEnd (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "SpecialEndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of specialBeginEnd (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } } + } + } + }, + "keyEqualsValuesBracesBrackets": { + "description": "poly-switches for key equals value (GLOBAL)", + "type": "object", + "properties": { + "KeyStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of key equals value (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for key equals value (PER-NAME)", - "type": "object", - "properties": { - "KeyStartsOnOwnLine":{ + "EqualsStartsOnOwnLine": { + "description": "poly-switch for line break before = of key equals value (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "EqualsFinishesWithLineBreak": { + "description": "poly-switch for line break after = of key equals value (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } + }, + "patternProperties": { + ".*": { + "description": "poly-switches for key equals value (PER-NAME)", + "type": "object", + "properties": { + "KeyStartsOnOwnLine": { "description": "poly-switch for line break before beginning of key equals value (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "EqualsStartsOnOwnLine":{ + "EqualsStartsOnOwnLine": { "description": "poly-switch for line break before = of key equals value (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "EqualsFinishesWithLineBreak":{ + "EqualsFinishesWithLineBreak": { "description": "poly-switch for line break after = of key equals value (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] } - } } } - }, - "ifElseFi": { - "description": "poly-switches for ifElseFi (GLOBAL)", - "type":"object", - "properties": { - "IfStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "BodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "OrStartsOnOwnLine":{ - "description": "poly-switch for line break before or statement of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "OrFinishesWithLineBreak":{ - "description": "poly-switch for line break after or statement of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "ElseStartsOnOwnLine":{ - "description": "poly-switch for line break before else statement of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "ElseFinishesWithLineBreak":{ - "description": "poly-switch for line break after else statement of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "FiStartsOnOwnLine":{ - "description": "poly-switch for line break before end of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "FiFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of ifElseFi (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + } + }, + "ifElseFi": { + "description": "poly-switches for ifElseFi (GLOBAL)", + "type": "object", + "properties": { + "IfStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for ifElseFi (PER-NAME)", - "type": "object", - "properties": { - "IfStartsOnOwnLine":{ + "BodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "OrStartsOnOwnLine": { + "description": "poly-switch for line break before or statement of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "OrFinishesWithLineBreak": { + "description": "poly-switch for line break after or statement of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "ElseStartsOnOwnLine": { + "description": "poly-switch for line break before else statement of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "ElseFinishesWithLineBreak": { + "description": "poly-switch for line break after else statement of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "FiStartsOnOwnLine": { + "description": "poly-switch for line break before end of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "FiFinishesWithLineBreak": { + "description": "poly-switch for line break after end of ifElseFi (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } + }, + "patternProperties": { + ".*": { + "description": "poly-switches for ifElseFi (PER-NAME)", + "type": "object", + "properties": { + "IfStartsOnOwnLine": { "description": "poly-switch for line break before beginning of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "BodyStartsOnOwnLine":{ + "BodyStartsOnOwnLine": { "description": "poly-switch for line break before body of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "OrStartsOnOwnLine":{ + "OrStartsOnOwnLine": { "description": "poly-switch for line break before or statement of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "OrFinishesWithLineBreak":{ + "OrFinishesWithLineBreak": { "description": "poly-switch for line break after or statement of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "ElseStartsOnOwnLine":{ + "ElseStartsOnOwnLine": { "description": "poly-switch for line break before else statement of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "ElseFinishesWithLineBreak":{ + "ElseFinishesWithLineBreak": { "description": "poly-switch for line break after else statement of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "FiStartsOnOwnLine":{ + "FiStartsOnOwnLine": { "description": "poly-switch for line break before end of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "FiFinishesWithLineBreak":{ + "FiFinishesWithLineBreak": { "description": "poly-switch for line break after end of ifElseFi (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] } - } } } - }, - "commands": { - "description": "poly-switches for commands (GLOBAL)", - "type":"object", - "properties": { - "CommandStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of commands (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "CommandNameFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of commands (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + } + }, + "commands": { + "description": "poly-switches for commands (GLOBAL)", + "type": "object", + "properties": { + "CommandStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of commands (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for commands (PER-NAME)", - "type": "object", - "properties": { - "CommandStartsOnOwnLine":{ + "CommandNameFinishesWithLineBreak": { + "description": "poly-switch for line break after end of commands (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } + }, + "patternProperties": { + ".*": { + "description": "poly-switches for commands (PER-NAME)", + "type": "object", + "properties": { + "CommandStartsOnOwnLine": { "description": "poly-switch for line break before beginning of commands (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "CommandNameFinishesWithLineBreak":{ + "CommandNameFinishesWithLineBreak": { "description": "poly-switch for line break after end of commands (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] } - } } } - }, - "verbatim": { - "description": "poly-switches for verbatim (GLOBAL)", - "type":"object", - "properties": { - "VerbatimBeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of verbatim (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "VerbatimEndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of verbatim (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + } + }, + "verbatim": { + "description": "poly-switches for verbatim (GLOBAL)", + "type": "object", + "properties": { + "VerbatimBeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of verbatim (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for verbatim (PER-NAME)", - "type": "object", - "properties": { - "VerbatimBeginStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of verbatim (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "VerbatimEndFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of verbatim (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } - } - } + "VerbatimEndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of verbatim (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] } }, - "namedGroupingBracesBrackets": { - "description": "poly-switches for namedGroupingBracesBrackets (GLOBAL)", - "type":"object", - "properties": { - "NameStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of namedGroupingBracesBrackets (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "NameFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of namedGroupingBracesBrackets (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } - }, - "patternProperties": { - ".*": { - "description": "poly-switches for commands (PER-NAME)", - "type": "object", - "properties": { - "NameStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of namedGroupingBracesBrackets (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "NameFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of namedGroupingBracesBrackets (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + "patternProperties": { + ".*": { + "description": "poly-switches for verbatim (PER-NAME)", + "type": "object", + "properties": { + "VerbatimBeginStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of verbatim (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "VerbatimEndFinishesWithLineBreak": { + "description": "poly-switch for line break after end of verbatim (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] } } } + } + }, + "namedGroupingBracesBrackets": { + "description": "poly-switches for namedGroupingBracesBrackets (GLOBAL)", + "type": "object", + "properties": { + "NameStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of namedGroupingBracesBrackets (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "NameFinishesWithLineBreak": { + "description": "poly-switch for line break after end of namedGroupingBracesBrackets (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } }, - "items": { - "description": "poly-switches for items (GLOBAL)", - "type":"object", - "properties": { - "ItemStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of items (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "ItemFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of items (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] + "patternProperties": { + ".*": { + "description": "poly-switches for commands (PER-NAME)", + "type": "object", + "properties": { + "NameStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of namedGroupingBracesBrackets (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "NameFinishesWithLineBreak": { + "description": "poly-switch for line break after end of namedGroupingBracesBrackets (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } } + } + } + }, + "items": { + "description": "poly-switches for items (GLOBAL)", + "type": "object", + "properties": { + "ItemStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of items (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for items (PER-NAME)", - "type": "object", - "properties": { - "ItemStartsOnOwnLine":{ + "ItemFinishesWithLineBreak": { + "description": "poly-switch for line break after end of items (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } + }, + "patternProperties": { + ".*": { + "description": "poly-switches for items (PER-NAME)", + "type": "object", + "properties": { + "ItemStartsOnOwnLine": { "description": "poly-switch for line break before beginning of items (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "ItemFinishesWithLineBreak":{ + "ItemFinishesWithLineBreak": { "description": "poly-switch for line break after end of items (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] } - } } } - }, - "optionalArguments": { - "description": "poly-switches for optional arguments (GLOBAL)", - "type":"object", - "properties": { - "LSqBStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of optional arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "OptArgBodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of optional arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RSqBStartsOnOwnLine":{ - "description": "poly-switch for line break before end of optional arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RSqBFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of optional arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + } + }, + "optionalArguments": { + "description": "poly-switches for optional arguments (GLOBAL)", + "type": "object", + "properties": { + "LSqBStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of optional arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for optional arguments (PER-NAME)", - "type": "object", - "properties": { - "LSqBStartsOnOwnLine":{ + "OptArgBodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of optional arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RSqBStartsOnOwnLine": { + "description": "poly-switch for line break before end of optional arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RSqBFinishesWithLineBreak": { + "description": "poly-switch for line break after end of optional arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } + }, + "patternProperties": { + ".*": { + "description": "poly-switches for optional arguments (PER-NAME)", + "type": "object", + "properties": { + "LSqBStartsOnOwnLine": { "description": "poly-switch for line break before beginning of optional arguments (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "OptArgBodyStartsOnOwnLine":{ + "OptArgBodyStartsOnOwnLine": { "description": "poly-switch for line break before body of optional arguments (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "RSqBStartsOnOwnLine":{ + "RSqBStartsOnOwnLine": { "description": "poly-switch for line break before end of optional arguments (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] }, - "RSqBFinishesWithLineBreak":{ + "RSqBFinishesWithLineBreak": { "description": "poly-switch for line break after end of optional arguments (PER-NAME)", "type": "integer", - "enum": [-1,0,1,2,3,4] + "enum": [-1, 0, 1, 2, 3, 4] } - } } } + } + }, + "mandatoryArguments": { + "description": "poly-switches for mandatory arguments (GLOBAL)", + "type": "object", + "properties": { + "LCuBStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of mandatory arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "MandArgBodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of mandatory arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RCuBStartsOnOwnLine": { + "description": "poly-switch for line break before end of mandatory arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RCuBFinishesWithLineBreak": { + "description": "poly-switch for line break after end of mandatory arguments (GLOBAL)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + } }, - "mandatoryArguments": { - "description": "poly-switches for mandatory arguments (GLOBAL)", - "type":"object", - "properties": { - "LCuBStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of mandatory arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "MandArgBodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of mandatory arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RCuBStartsOnOwnLine":{ - "description": "poly-switch for line break before end of mandatory arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RCuBFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of mandatory arguments (GLOBAL)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + "patternProperties": { + ".*": { + "description": "poly-switches for mandatory arguments (PER-NAME)", + "type": "object", + "properties": { + "LCuBStartsOnOwnLine": { + "description": "poly-switch for line break before beginning of mandatory arguments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] }, - "patternProperties": { - ".*": { - "description": "poly-switches for mandatory arguments (PER-NAME)", - "type": "object", - "properties": { - "LCuBStartsOnOwnLine":{ - "description": "poly-switch for line break before beginning of mandatory arguments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "MandArgBodyStartsOnOwnLine":{ - "description": "poly-switch for line break before body of mandatory arguments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RCuBStartsOnOwnLine":{ - "description": "poly-switch for line break before end of mandatory arguments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - }, - "RCuBFinishesWithLineBreak":{ - "description": "poly-switch for line break after end of mandatory arguments (PER-NAME)", - "type": "integer", - "enum": [-1,0,1,2,3,4] - } + "MandArgBodyStartsOnOwnLine": { + "description": "poly-switch for line break before body of mandatory arguments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RCuBStartsOnOwnLine": { + "description": "poly-switch for line break before end of mandatory arguments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] + }, + "RCuBFinishesWithLineBreak": { + "description": "poly-switch for line break after end of mandatory arguments (PER-NAME)", + "type": "integer", + "enum": [-1, 0, 1, 2, 3, 4] } } } } } - }, - "replacements":{ - "description": "replacements to be made; requires -r, -rr or -rv switch", - "type": "array" - }, - "fineTuning":{ - "description": "fine tuning, proceed with caution!", - "type":"object", + } + }, + "replacements": { + "description": "replacements to be made; requires -r, -rr or -rv switch", + "type": "array", + "items": { + "description": "entry for replacement", + "type": "object", "properties": { - "environments":{ - "description": "fine tuning, for environments", - "type":"object", - "properties": { - "name":{ - "description": "regular expression for environment name", - "type": "string" - } - } + "amalgamate": { + "description": "optional: 0/1, binary switch to add to/overwrite previously loaded items. Default is 1 if not specified", + "type": "integer", + "enum": [0, 1] }, - "ifElseFi":{ - "description": "fine tuning, for ifElseFi", - "type":"object", - "properties": { - "name":{ - "description": "regular expression for ifElseFi name", - "type": "string" - } - } + "this": { + "description": "string to be replaced", + "type": "string" }, - "commands":{ - "description": "fine tuning, for commands", - "type":"object", - "properties": { - "name":{ - "description": "regular expression for commands name", - "type": "string" - } - } + "that": { + "description": "string to replace with", + "type": "string" }, - "items":{ - "description": "fine tuning, for items", - "type":"object", - "properties": { - "canBeFollowedBy":{ - "description": "regular expression for what can follow items", - "type": "string" - } - } + "lookForThis": { + "description": "optional: 0/1, binary switch detailing look for this or not. Default is 1 if not specified", + "type": "integer", + "enum": [0, 1] }, - "keyEqualsValuesBracesBrackets":{ - "description": "fine tuning, for keyEqualsValuesBracesBrackets", - "type":"object", - "properties": { - "name":{ - "description": "regular expression for key = value name", - "type": "string" - }, - "follow":{ - "description": "regular expression for what key = values follow", - "type": "string" - } - } + "when": { + "description": "optional: string specifying whether replacement should be made before/after indentation. Default is 'before' if not specified", + "type": "string", + "enum": ["before", "after"] }, - "namedGroupingBracesBrackets":{ - "description": "fine tuning, for namedGroupingBracesBrackets", - "type":"object", - "properties": { - "name":{ - "description": "regular expression for named grouping braces name", - "type": "string" - }, - "follow":{ - "description": "regular expression for what named grouping braces follow", - "type": "string" - } + "substitution": { + "description": "regular expression of the form 's/regex/replacement/modifiers; works only if 'this' is blank", + "type": "string" + } + } + } + }, + "fineTuning": { + "description": "fine tuning, proceed with caution!", + "type": "object", + "properties": { + "environments": { + "description": "fine tuning, for environments", + "type": "object", + "properties": { + "name": { + "description": "regular expression for environment name", + "type": "string" } - }, - "UnNamedGroupingBracesBrackets":{ - "description": "fine tuning, for UnNamedGroupingBracesBrackets", - "type":"object", - "properties": { - "follow":{ - "description": "regular expression for what UN named grouping braces follow", - "type": "string" - } + } + }, + "ifElseFi": { + "description": "fine tuning, for ifElseFi", + "type": "object", + "properties": { + "name": { + "description": "regular expression for ifElseFi name", + "type": "string" } - }, - "arguments":{ - "description": "fine tuning, for arguments", - "type":"object", - "properties": { - "before":{ - "description": "regular expression for what can come BEFORE arguments", - "type": "string" - }, - "between":{ - "description": "regular expression for what can come BETWEEN arguments", - "type": "string" - } + } + }, + "commands": { + "description": "fine tuning, for commands", + "type": "object", + "properties": { + "name": { + "description": "regular expression for commands name", + "type": "string" } - }, - "trailingComments":{ - "description": "fine tuning, for trailing comments", - "type":"object", - "properties": { - "notPreceededBy":{ - "description": "regular expression for what can NOT come before %, for example \\%", - "type": "string" - } + } + }, + "items": { + "description": "fine tuning, for items", + "type": "object", + "properties": { + "canBeFollowedBy": { + "description": "regular expression for what can follow items", + "type": "string" } - }, - "modifyLineBreaks":{ - "description": "fine tuning for some of the -m switch based features", - "type":"object", - "properties": { - "betterFullStop":{ - "description": "regular expression for the 'better full stop' in the one-sentence-per-line routine", - "type": "string" - }, - "doubleBackSlash":{ - "description": "regular expression for the double back slash used in the DBS poly-switches", - "type": "string" - }, - "comma":{ - "description": "regular expression for the comma used in the comma-based poly-switches", - "type": "string" - } + } + }, + "keyEqualsValuesBracesBrackets": { + "description": "fine tuning, for keyEqualsValuesBracesBrackets", + "type": "object", + "properties": { + "name": { + "description": "regular expression for key = value name", + "type": "string" + }, + "follow": { + "description": "regular expression for what key = values follow", + "type": "string" + } + } + }, + "namedGroupingBracesBrackets": { + "description": "fine tuning, for namedGroupingBracesBrackets", + "type": "object", + "properties": { + "name": { + "description": "regular expression for named grouping braces name", + "type": "string" + }, + "follow": { + "description": "regular expression for what named grouping braces follow", + "type": "string" + } + } + }, + "UnNamedGroupingBracesBrackets": { + "description": "fine tuning, for UnNamedGroupingBracesBrackets", + "type": "object", + "properties": { + "follow": { + "description": "regular expression for what UN named grouping braces follow", + "type": "string" + } + } + }, + "arguments": { + "description": "fine tuning, for arguments", + "type": "object", + "properties": { + "before": { + "description": "regular expression for what can come BEFORE arguments", + "type": "string" + }, + "between": { + "description": "regular expression for what can come BETWEEN arguments", + "type": "string" + } + } + }, + "trailingComments": { + "description": "fine tuning, for trailing comments", + "type": "object", + "properties": { + "notPreceededBy": { + "description": "regular expression for what can NOT come before %, for example \\%", + "type": "string" + }, + "afterComment": { + "description": "regular expression for what can come after %", + "type": "string" + } + } + }, + "modifyLineBreaks": { + "description": "fine tuning for some of the -m switch based features", + "type": "object", + "properties": { + "betterFullStop": { + "description": "regular expression for the 'better full stop' in the one-sentence-per-line routine", + "type": "string" + }, + "doubleBackSlash": { + "description": "regular expression for the double back slash used in the DBS poly-switches", + "type": "string" + }, + "comma": { + "description": "regular expression for the comma used in the comma-based poly-switches", + "type": "string" } } } } } } +} diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf Binary files differindex 85ac80ed9d..7793086df1 100644 --- a/support/latexindent/documentation/latexindent.pdf +++ b/support/latexindent/documentation/latexindent.pdf diff --git a/support/latexindent/documentation/latexindent.tex b/support/latexindent/documentation/latexindent.tex index ceb3675d90..87d9b7969a 100644 --- a/support/latexindent/documentation/latexindent.tex +++ b/support/latexindent/documentation/latexindent.tex @@ -367,169 +367,169 @@ \lstdefinestyle{logFilePreferences}{ style=yaml-LST, - firstnumber=91,linerange={91-105}, + firstnumber=90,linerange={90-104}, numbers=left, } \lstdefinestyle{verbatimEnvironments}{ style=yaml-LST, - firstnumber=109,linerange={109-112}, + firstnumber=108,linerange={108-111}, numbers=left, } \lstdefinestyle{verbatimCommands}{ style=yaml-LST, - firstnumber=115,linerange={115-117}, + firstnumber=114,linerange={114-116}, numbers=left, } \lstdefinestyle{noIndentBlock}{ style=yaml-LST, - firstnumber=122,linerange={122-124}, + firstnumber=121,linerange={121-123}, numbers=left, } \lstdefinestyle{removeTrailingWhitespace}{ style=yaml-LST, - firstnumber=153,linerange={153-155}, + firstnumber=152,linerange={152-154}, numbers=left, } \lstdefinestyle{fileContentsEnvironments}{ style=yaml-LST, - firstnumber=128,linerange={128-130}, + firstnumber=127,linerange={127-129}, numbers=left, } \lstdefinestyle{lookForPreamble}{ style=yaml-LST, - firstnumber=136,linerange={136-140}, + firstnumber=135,linerange={135-139}, numbers=left, } \lstdefinestyle{lookForAlignDelims}{ style=yaml-LST, - firstnumber=158,linerange={158-176}, + firstnumber=157,linerange={157-175}, numbers=left, } \lstdefinestyle{indentAfterItems}{ style=yaml-LST, - firstnumber=239,linerange={239-246}, + firstnumber=240,linerange={240-247}, numbers=left, } \lstdefinestyle{itemNames}{ style=yaml-LST, - firstnumber=252,linerange={252-254}, + firstnumber=253,linerange={253-255}, numbers=left, } \lstdefinestyle{specialBeginEnd}{ style=yaml-LST, - firstnumber=258,linerange={258-272}, + firstnumber=259,linerange={259-273}, numbers=left, } \lstdefinestyle{indentAfterHeadings}{ style=yaml-LST, - firstnumber=282,linerange={282-291}, + firstnumber=283,linerange={283-292}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobalEnv}{ style=yaml-LST, - firstnumber=340,linerange={340-341}, + firstnumber=341,linerange={341-342}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobal}{ style=yaml-LST, - firstnumber=340,linerange={340-352}, + firstnumber=341,linerange={341-353}, numbers=left, } \lstdefinestyle{indentRulesGlobalEnv}{ style=yaml-LST, - firstnumber=356,linerange={356-357}, + firstnumber=357,linerange={357-358}, numbers=left, } \lstdefinestyle{indentRulesGlobal}{ style=yaml-LST, - firstnumber=356,linerange={356-368}, + firstnumber=357,linerange={357-369}, numbers=left, } \lstdefinestyle{commandCodeBlocks}{ style=yaml-LST, - firstnumber=371,linerange={371-386}, + firstnumber=372,linerange={372-387}, numbers=left, } \lstdefinestyle{modifylinebreaks}{ style=yaml-LST, - firstnumber=501,linerange={501-503}, + firstnumber=500,linerange={500-502}, numbers=left, } \lstdefinestyle{textWrapOptions}{ style=yaml-LST, - firstnumber=531,linerange={531-532}, + firstnumber=530,linerange={530-531}, numbers=left, } \lstdefinestyle{textWrapOptionsAll}{ style=yaml-LST, - firstnumber=531,linerange={531-558}, + firstnumber=530,linerange={530-557}, numbers=left, } \lstdefinestyle{oneSentencePerLine}{ style=yaml-LST, - firstnumber=504,linerange={504-530}, + firstnumber=503,linerange={503-529}, numbers=left, } \lstdefinestyle{sentencesFollow}{ style=yaml-LST, - firstnumber=510,linerange={510-518}, + firstnumber=509,linerange={509-517}, numbers=left, } \lstdefinestyle{sentencesBeginWith}{ style=yaml-LST, - firstnumber=519,linerange={519-522}, + firstnumber=518,linerange={518-521}, numbers=left, } \lstdefinestyle{sentencesEndWith}{ style=yaml-LST, - firstnumber=523,linerange={523-528}, + firstnumber=522,linerange={522-527}, numbers=left, } \lstdefinestyle{sentencesDoNOTcontain}{ style=yaml-LST, - firstnumber=529,linerange={529-530}, + firstnumber=528,linerange={528-529}, numbers=left, } \lstdefinestyle{modifylinebreaksEnv}{ style=yaml-LST, - firstnumber=560,linerange={560-569}, + firstnumber=559,linerange={559-568}, numbers=left, } \lstdefinestyle{replacements}{ style=yaml-LST, - firstnumber=621,linerange={621-629}, + firstnumber=620,linerange={620-625}, numbers=left, } \lstdefinestyle{fineTuning}{ style=yaml-LST, - firstnumber=632,linerange={632-687}, + firstnumber=629,linerange={629-684}, numbers=left, } @@ -3330,10 +3330,10 @@ latexindent.pl special-align.tex -l edge-node2.yaml -o=+-mod2 \announce{2021-06-19}*{lookForThis optional for specialBeginEnd} by default, it is assumed to be 1, which is demonstrated in \cref{lst:edge-node2}.% - Referencing \vref{lst:specialBeginEnd} we see that - \announce*{2023-09-23}{specialBeginEnd body field} each of the \texttt{specialBeginEnd} - fields can \emph{optionally} accept the \texttt{body} field. If the \texttt{body} field - is omitted, then \texttt{latexindent.pl} uses a value that means + Referencing \vref{lst:specialBeginEnd} we see that \announce{2023-09-23}{specialBeginEnd + body field} each of the \texttt{specialBeginEnd} fields can \emph{optionally} accept the + \texttt{body} field. If the \texttt{body} field is omitted, then \texttt{latexindent.pl} + uses a value that means \begin{quote} anything except one of the begin statements from \texttt{specialBeginEnd}. \end{quote} @@ -3344,7 +3344,7 @@ latexindent.pl special-align.tex -l edge-node2.yaml -o=+-mod2 \begin{example} We begin with the example in \cref{lst:special-body} - \cmhlistingsfromfile*{demonstrations/special-body.tex}{\texttt{special-body.tex}}{lst:special-body} + \cmhlistingsfromfile{demonstrations/special-body.tex}{\texttt{special-body.tex}}{lst:special-body} Using the settings in \cref{lst:special-body1} and running the command @@ -3355,8 +3355,8 @@ latexindent.pl special-body.tex -l=special-body1.yaml gives the output in \cref{lst:special-body-mod1}. \begin{cmhtcbraster}[ raster left skip=-3.5cm,] - \cmhlistingsfromfile*{demonstrations/special-body-mod1.tex}{\texttt{special-body.tex} using \cref{lst:special-body1}}{lst:special-body-mod1} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/special-body1.yaml}[yaml-TCB]{\texttt{special-body1.yaml}}{lst:special-body1} + \cmhlistingsfromfile{demonstrations/special-body-mod1.tex}{\texttt{special-body.tex} using \cref{lst:special-body1}}{lst:special-body-mod1} + \cmhlistingsfromfile[style=yaml-LST]{demonstrations/special-body1.yaml}[yaml-TCB]{\texttt{special-body1.yaml}}{lst:special-body1} \end{cmhtcbraster} We note that the output in \cref{lst:special-body-mod1} is as we would expect, even \emph{without} the \texttt{body} field specified. @@ -3364,7 +3364,7 @@ latexindent.pl special-body.tex -l=special-body1.yaml Another option (purely for reference) that leaves the output in \cref{lst:special-body-mod1} unchanged is shown in \cref{lst:special-body2}. - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/special-body2.yaml}[yaml-TCB]{\texttt{special-body2.yaml}}{lst:special-body2} + \cmhlistingsfromfile[style=yaml-LST]{demonstrations/special-body2.yaml}[yaml-TCB]{\texttt{special-body2.yaml}}{lst:special-body2} The \texttt{body} field in \cref{lst:special-body2} means \emph{anything except ( or )}. \end{example} @@ -7478,7 +7478,7 @@ latexindent.pl -r colsep.tex -l=colsep.yaml then we achieve the output in \cref{lst:colsep-mod0}. \begin{cmhtcbraster} - \cmhlistingsfromfile{demonstrations/colsep-mod0.tex}{\texttt{colsep.tex} using \cref{lst:colsep}}{lst:colsep-mod0} + \cmhlistingsfromfile{demonstrations/colsep-mod0.tex}{\texttt{colsep.tex} using \cref{lst:colsep-yaml}}{lst:colsep-mod0} \cmhlistingsfromfile[style=yaml-LST]{demonstrations/colsep.yaml}[replace-TCB]{\texttt{colsep.yaml}}{lst:colsep-yaml} \end{cmhtcbraster} Note that in \cref{lst:colsep-yaml}, we have specified \emph{two} separate fields, each @@ -8385,6 +8385,42 @@ latexindent.pl finetuning5.tex -l=fine-tuning3.yaml the \texttt{end} part. The trailing comments \texttt{123} and \texttt{456} are still treated as trailing comments. \end{example} + + \begin{example} + We can use the \texttt{fineTuning} settings to tweak how \texttt{latexindent.pl} finds + environments. + + We begin with the file in \cref{lst:finetuning6}.\announce*{2023-10-13}{fineTuning + environments} + + \cmhlistingsfromfile*{demonstrations/finetuning6.tex}{\texttt{finetuning6.tex}}{lst:finetuning6} + + Using the settings in \cref{lst:fine-tuning4} and running the command + + \begin{commandshell} +latexindent.pl finetuning6.tex -m -l=fine-tuning4.yaml +\end{commandshell} + + gives the output in \cref{lst:finetuning6-mod1}. + + \begin{cmhtcbraster}[raster column skip=.01\linewidth, + raster left skip=-3.5cm, + raster force size=false, + raster column 1/.style={add to width=-.1\textwidth}, + raster column 2/.style={add to width=-.3\textwidth}, + ] + \cmhlistingsfromfile*{demonstrations/finetuning6-mod1.tex}{\texttt{finetuning6-mod1.tex}}{lst:finetuning6-mod1} + \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/fine-tuning4.yaml}[MLB-TCB]{\texttt{fine-tuning4.yaml}}{lst:fine-tuning4} + \end{cmhtcbraster} + + By using the settings in \cref{lst:fine-tuning4} it means that the default poly-switch + location of \texttt{BodyStartsOnOwnLine} for environments (denoted + $\BodyStartsOnOwnLine$ in \cref{tab:poly-switch-mapping}) has been overwritten so that + it is \emph{after} the \texttt{label} command. + + Referencing \cref{lst:fine-tuning4}, unless both \texttt{begin} and \texttt{end} are + specified, then the default value of \texttt{name} will be used. + \end{example} % arara: pdflatex: { files: [latexindent]} \section{Conclusions and known limitations}\label{sec:knownlimitations} There are a number of known limitations of the script, and almost certainly quite a few diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl index f8bcf3503e..1e9d486075 100755 --- a/support/latexindent/latexindent.pl +++ b/support/latexindent/latexindent.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# latexindent.pl, version 3.23.2, 2023-09-23 +# latexindent.pl, version 3.23.3, 2023-10-13 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |