From 57ad208dc61bb62a6ece0b696cd5ff0cb6e75460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 10 Nov 2017 03:42:21 -0500 Subject: [PATCH] add pygments CSS block in browsable API views (#5584) --- rest_framework/renderers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index c63170158..3298294ce 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -383,6 +383,7 @@ class BrowsableAPIRenderer(BaseRenderer): format = 'api' template = 'rest_framework/api.html' filter_template = 'rest_framework/filters/base.html' + code_style = 'emacs' charset = 'utf-8' form_renderer_class = HTMLFormRenderer @@ -672,6 +673,7 @@ class BrowsableAPIRenderer(BaseRenderer): context = { 'content': self.get_content(renderer, data, accepted_media_type, renderer_context), + 'code_style': pygments_css(self.code_style), 'view': view, 'request': request, 'response': response,