Closed mathiasertl closed 2 years ago
the feature looks great, but I would prefer if you add a test for it. I also have to make sure the CI runs on PR... your last PR actually did brake the CI :)
I also have to make sure the CI runs on PR...
Yes I was wondering about that because...
your last PR actually did brake the CI :)
:-).
your last PR actually did brake the CI :)
https://github.com/mathiasertl/django-ca/blob/master/.github/workflows/tests.yml#L2-L5
Here's what I use. Once you have that (or similar) in, I'll of course push a fix for the tests for my last PR as well.
cool. tests passes. but we need new tests for this new feature. :)
but we need new tests for this new feature.
I completely agree. on it.
Here you go with some nice test cases ;-)
cool tests! I'd appreciate a squash of those messy commits and we're good to go! ;)
force-pushed this into one. (edit: update missing file)
thanks a bunch!
Add the
header_update_levels
option to let templates behave like theinclude
directive when it comes to headers. This makes it easier to include whole chapters in similar documents via templates, similar to what theinclude
directive is often used for.Assume you have this file that we use as include or template:
and using this source document:
... the header included via
include
will show at the same level asSecond in source
. In the first jinja template directive, the header (and all other headers) will be in the levels below the active level of the caller, so a level three header in this case. The header in the second jinja template directive will behave the same way as theinclude
directive.See also the docstring for nested_parse_with_titles, which states the function is useful for "when the parsed content comes from a completely different context, such as docstrings." The behavior for the option I have adapted here is from the original include directive (yes, docutils appears to be actually using SVN).
PS: I couldn't think of the perfect option name yet -.-. If you have a better suggestion...