Conversation
|
|
||
| {% block page_content %} | ||
| {% extends "base.html" %} {% block title %}Sirius - Admin{% endblock %} {% block | ||
| page_content %} |
There was a problem hiding this comment.
This formatting looks a little broken to me.... does Jinja allow a line break in a directive? Also, it would be much preferred to put the extends directive on a new line, if at all possible
There was a problem hiding this comment.
Jinja allows the line breaks, but Prettier is only parsing/formatting it as HTML. There's a(n open) ticket for Jinja support (prettier/prettier#5754), and a link to a Nunchuks based plugin (which is incomplete).
From what I can tell, any of the Python specific formatters (black, autopep8, yapf) won't touch the HTML part of Jinja, and Prettier won't do much to consider the Python parts (just format them as blobs). Given that there's more HTML than Python here, I'm more inclined to favour getting the HTML readable.
We could manually format the Jinja specific lines and throw in <!-- prettier-ignore -->, but that might just be more trouble than it's worth?
I'll take a look at the Nunchucks plugin - it might have enough of the simple functionality to at least format the Jinja blocks sequentially, instead of a single line.











The ongoing modernisation of the project continues!
In order to bump some of the designs, I figured it made sense to bump us to the latest Bootstrap. Because of Computers™, that means swapping
Flask-Bootstrapfrombootstrap-flask, and migrating a bunch of styles.I added prettier support for the HTML, though some of the support is a little quirky, because it's Jinja, not HTML. There's an open issue for full support, but I don't think it's a showstopper for now. I'll take "consistent and pretty good" over "perfect" formatting.
I also removed the "face" support in the preview screen since it wasn't actually being used.