Closed cmhughes closed 2 years ago
Json scheme to be updated
For anyone following this issue, I am progressing it. It's a massive piece of work, so is taking a long time.
Commits should start to flow... Soon, hopefully.
I'm looking forward to text wrapping being more straight forward and robust.
multipleSpacesToSingle: 1
for one sentence per line as well.
As of https://github.com/cmhughes/latexindent.pl/commit/462ed6d5a710f14b9108494df43fda37cfda86ac this over haul is implemented and fully documented.
modifyLineBreaks:
textWrapOptions:
columns: 0
multipleSpacesToSingle: 1
blocksFollow:
headings: 1
commentOnPreviousLine: 1
par: 1
blankLine: 1
verbatim: 1
filecontents: 1
other: '\\\]|\\item(?:\h|\[)' # regex
blocksBeginWith:
A-Z: 1
a-z: 1
0-9: 0
other: 0 # regex
blocksEndBefore:
commentOnOwnLine: 1
verbatim: 1
filecontents: 1
other: '\\begin\{|\\\[|\\end\{' # regex
huge: overflow # forbid mid-word line breaks
separator: ""
see documentation for full details and examples.
Implemented as of https://github.com/cmhughes/latexindent.pl/releases/tag/V3.16
background
The
textWrap
routine is a jumbled mess; it attempts to do its work both before the code blocks have been found, and then during the finding of code blocks. It's a mess, and there are issues associated with it (https://github.com/cmhughes/latexindent.pl/issues/337, https://github.com/cmhughes/latexindent.pl/issues/341, https://github.com/cmhughes/latexindent.pl/issues/344).good things about the
oneSentencePerLine
routineThe
oneSentencePerLine
does its job well, and relatively simply. It does its work after verbatim code blocks have been found, but before finding other code blocks. I think this needs to be the approach for text wrapping.possible interface
The current YAML interface needs overhauling; I think something like the following would be a good starting point:
This would remove the need for
removeParagraphLineBreaks
, and would not happen on a per-code-block basis. It would be done immediately before or after theoneSentencePerLine
routine.testing
In addition to the 1000s of test cases that I use before each commit, I need to ensure that https://github.com/cmhughes/latexindent.pl/issues/337, https://github.com/cmhughes/latexindent.pl/issues/341, https://github.com/cmhughes/latexindent.pl/issues/344 are resolved.
time frame
Development and testing is slow at the moment. I'm not sure how or when I'll get to this, but the above ideas are helpful to me.