jinja icon indicating copy to clipboard operation
jinja copied to clipboard

Start adding indent_blocks to the lexer

Open GergelyKalmar opened this issue 4 years ago • 2 comments

We're adding a new indent_blocks environment parameter which automatically indents/dedents block contents. This allows us to add indentation to code block contents (which helps readability) while making sure that the output is also indented nicely.

  • fixes #178

Checklist:

  • [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • [x] Add or update relevant docs, in the docs folder and in code.
  • [x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • [x] Add .. versionchanged:: entries in any relevant code docs.
  • [x] Run pre-commit hooks and fix any issues.
  • [ ] Run pytest and tox, no tests failed.

GergelyKalmar avatar May 30 '21 18:05 GergelyKalmar

@davidism I've given a stab at https://github.com/pallets/jinja/issues/178, although I got a little stuck at some more complex nested / inline templates. It would be great if you could let me know if you agree with the direction in general (in which case I'd be happy to continue working on this)! Also, if you have any ideas how to proceed with fixing the failing nested test, let me know.

Thank you!

GergelyKalmar avatar May 30 '21 19:05 GergelyKalmar

@davidism Any chance to get some feedback on this PR? I'd still be up for continuing the work on it if that's desirable.

GergelyKalmar avatar Aug 11 '21 09:08 GergelyKalmar