Add a {% code_block %} template tag.

Review Request #11905 — Created Jan. 4, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

This is a block tag that runs the nested content through Pygments, using
the provided lexer name. This makes it easier to include code samples in
templates without hard-coding Pygments span tags.

Unit tests pass in Python 2 and 3.

Tested this with a template being written for another change. Verified that
the rendering used the correct lexers.

Changes between revision 1 and 2

orig
1
2
3

Commits

Summary ID Author
Add a {% code_block %} template tag.
This is a block tag that runs the nested content through Pygments, using the provided lexer name. This makes it easier to include code samples in templates without hard-coding Pygments `span` tags.
2dfa31555dfd5b481ca4645dc85f35a404200451 Christian Hammond
Add a {% code_block %} template tag.
This is a block tag that runs the nested content through Pygments, using the provided lexer name. This makes it easier to include code samples in templates without hard-coding Pygments `span` tags.
2e116c69b999fe41d03cf771736c17e11b133197 Christian Hammond
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/reviews/tests/test_reviewtags.py
Loading...