|
Add a setting for mapping file extensions to syntax highlighters for
diffs
Adds a default mapping of file extensions to pygments lexers, which
administrators may modify to define their own custom mapping. If a
mapping is not defined for a certain file extension, we revert to
the old behaviour of guessing which lexer to use given the filename
and file contents.
|
3e4ddeda899f0e5d97f02ed070d7525662ee33c5 |
Michelle |
|
Uses for else clause and .items() instead of .keys() for searching the
mapping
|
97a6bd3547ff2c3af0708640538d75ef4a55f1c8 |
Michelle |
|
Logs an error if a mapped lexer does not exist in Pygments
|
13f279fa09f30803a02621e13192942b95e80460 |
Michelle |
|
Removed trailing whitespace
|
d27cc3d581a53a7fd414db5efc820cba92ba9fb3 |
Michelle |
|
Properly imports mapping from settings.py
|
8eb445508de1a38aae178bc59477b585f681bbd6 |
Michelle |
|
fixed string formatting for logged error
|
dafacdae4c204636121480ab9b3821ffec9ff889 |
Michelle |
|
Made CUSTOM_PYGMENTS_LEXERS a class attribute (this makes it easier
to modify during testing)
|
45754bd19bf4ae4ae6f9582e725557ddf0e3c976 |
Michelle |
|
took out print statement from testing
|
5fb349b3f4d0adb8a4f0c0b25d3df3611a446220 |
Michelle |
|
Added unit tests for apply_pygment, testing that default
custom mapping works and that mapping to a non existant class
logs an error
|
c29591ba2ab98206ea65f12b248826d2e5ad5eac |
Michelle |
|
Modified doc formatting and changed default test to instead
test if using a custom mapping overrides the guessing
function to determine a lexer
|
f853203d6bcadd51d4e9dcfe9561607034023ab7 |
Michelle |
|
fixed flake8 issues
|
f734b34e8ddc5eca2a3000f71feab356c0541cfd |
Michelle |
|
fixed one last flake8 indent issue
|
d3dd8e59f73f2c246e6f04ab57c4b2dbfaa87f4b |
Michelle |
|
better logging message, fixed formatting issues, removed mapping attribute an...
|
5e248bac7d732347961213f7a83934a07c604426 |
Michelle |
|
fixed a couple flake8 issues
|
d1a3b05fd934f96b700bb87b60e2613e89df833f |
Michelle |
|
moved mapping to siteconfig instead of settings.py
|
02756419d83742c1b0181d806bdb57b3cd6661aa |
Michelle |
|
initial form for mapping in diff viewer settings
|
fbd7700720326e780e696c44181650451beaad95 |
Michelle |
|
added test for empty mapping
|
faa04403111580a7b8494fc726904764887bac9a |
Michelle |
|
create LexersMappingWidget and using in diff_settings.py for now to test
|
48047abe632054dd35db53369725cb063e7f3ff4 |
Michelle |