Skip to content

Commit 1b0230e

Browse files
committed
Enable/Disable Option for packaged semantic version
1 parent e07ef33 commit 1b0230e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

martor/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
'living': 'false', # to enable/disable live updates in preview
1212
'spellcheck': 'false', # to enable/disable spellcheck in form textareas
1313
'hljs': 'true', # to enable/disable hljs highlighting in preview
14+
'semantic': 'true', # to enable/disable using packaged semantic version
1415
}
1516
)
1617

martor/widgets.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ class Media:
5454
css = {
5555
'all': (
5656
'plugins/css/ace.min.css',
57-
'plugins/css/semantic.min.css',
5857
'plugins/css/resizable.min.css',
5958
'martor/css/martor.min.css',
6059
'martor/css/martor-admin.min.css'
6160
)
6261
}
6362
js = (
6463
'plugins/js/ace.js',
65-
'plugins/js/semantic.min.js',
6664
'plugins/js/mode-markdown.js',
6765
'plugins/js/ext-language_tools.js',
6866
'plugins/js/theme-github.js',
@@ -72,6 +70,11 @@ class Media:
7270
'martor/js/martor.min.js',
7371
)
7472

73+
if MARTOR_ENABLE_CONFIGS.get('semantic') == 'true':
74+
# Allows to disable the included semantic version if a custom themed semantic version shouldn't be overriden
75+
css["all"] = ('plugins/css/semantic.min.css',).__add__(css.get('all'))
76+
js = ('plugins/js/semantic.min.js',).__add__(js)
77+
7578
if MARTOR_ENABLE_CONFIGS.get('spellcheck') == 'true':
7679
# Adding the following scripts to the end of the tuple in case it affects behaviour
7780
js = ('plugins/js/typo.js', 'plugins/js/spellcheck.js').__add__(js)

0 commit comments

Comments
 (0)