Closed ksurya closed 10 years ago
While removing usage of Pygments
, I see the following use it apart from create_or_edit_submission_revision()
in scipy_central.submission.views
module.
get_display()
show_file()
(view)From what I understand the show_file()
view corresponding to the URL configuration r'^(?P<item_id>\d+)/(?P<rev_id>\d+)/show/(?P<filename>.*?)$'
is not mentioned anywhere in front-end.
A quick test on what it does tells me that the view returns data of files (snippets or images) used inside a submission. This probably intended to give access to raw data (snippets or images) for users. However, the view when serving snippet file doesn't generate raw data but highlighted HTML code.
submission.models.DisplayFile
is used here (and nowhere else) to help easy access of data instead of reading it every time from filesystem.
I think we can deprecate (or remove) this view and the supported function, model used in it. The below are the following reasons:
Pygments
and only technically using plain-text
snippet data, this is possible. However, we can have a separate view that does the job of serving raw snippet data but it may only bring load to the server which can be avoided. It is also to be noted that there another view that lets people download snippets.@pv If there is no problem with deprecating the above mentioned & the new features, I will go ahead.
ACE editor website: http://ace.c9.io/ Use ACE - JavaScript based editor for writing new submissions, view snippets when viewing submissions
Changes
Pygments
syntax highlightersubmission.models.Revision.item_highlighted_code
fieldsubmission.models.DisplayFile
,submission.views.get_display
,submission.views.show_file
Notes
Pygments
package is no longer used for syntax highlighting code snippets.Revision
modelsubmission.views.show_file
and its related methods, models appears to be broken and not used anywhere. This is discussed in the below commentsPreview
Snippet view
Submission editor