Add a {% code_block %} template tag.

Review Request #11905 — Created Jan. 4, 2022 and updated

chipx86
Review Board
release-4.0.x
11906
reviewboard

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.

Summary
Add a {% code_block %} template tag.
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...