Extraneous indentation on some pages
Gama11 opened this issue · 5 comments
Many pages have have unnecessary indentation / whitespace in code snippets:
https://haxe.org/manual/lf-pattern-matching-variable-capture.html
https://haxe.org/manual/lf-pattern-matching-enums.html
https://haxe.org/manual/lf-pattern-matching-guards.html
etc
These all use the \haxe
command to extract a range of lines from a particular file:
https://github.com/HaxeFoundation/HaxeManual/blob/master/HaxeManual/06-language-features.tex#L392
Possible solutions:
- add an optional argument to
\haxe
to adjust the indentation level on an excerpt - some LaTeX programming necessary, but shouldn't be too bad? - separate the files into individual snippets - the individual files still have to compile, so they would have to include
class Main
etc, which would clutter the code examples a lot
the individual files still have to compile, so they would have to include
class Main
CI at least supports expression-level snippets:
https://github.com/HaxeFoundation/HaxeManual/blob/master/tests/RunTravis.hx#L109
Oh, you're right. However the pattern matching examples still need the enum Tree
:)
I guess I basically wrote some kind of build system when I set up the CI here... :D