mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
add pygments CSS block in browsable API views (#5584)
This commit is contained in:
parent
8d7ce3726d
commit
57ad208dc6
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user