Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installation and configuration

To install django-mathjax you can use pip::

pip install Django-MathJax
pip install django-mathjax

Then you have to add :code:`django_mathjax` app to your :code:`INSTALLED_APPS`
and add a :code:`MATHJAX_ENABLED=True` to your settings file.
Expand Down Expand Up @@ -41,7 +41,9 @@ Settings parameters
MATHJAX_ENABLED
~~~~~~~~~~~~~~~

Allow to enable/disable the mathjax app.
Allow to enable/disable the mathjax app. Example:

:code:`MATHJAX_ENABLED = True # to enable mathjax on your django project`

MATHJAX_LOCAL_PATH
~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 5 additions & 0 deletions django_mathjax/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Django-Mathjax
"""

__version__ = "0.0.9"
6 changes: 3 additions & 3 deletions django_mathjax/templatetags/mathjax.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def mathjax_scripts():
if mathjax_local_path:
mathjax_js_url = static('%s/MathJax.js' % mathjax_local_path)
else:
mathjax_js_url = '//cdn.mathjax.org/mathjax/latest/MathJax.js'
mathjax_js_url = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js' # updated the CDN

mathjax_config_file = getattr(settings, 'MATHJAX_CONFIG_FILE', "TeX-AMS-MML_HTMLorMML")
url = "%s?config=%s" % (mathjax_js_url, mathjax_config_file)
Expand All @@ -26,10 +26,10 @@ def mathjax_scripts():
mathjax_config_data = getattr(settings, 'MATHJAX_CONFIG_DATA', None)
config_script_tag = ''
if mathjax_config_data:
config_script_tag = '<script type="text/javascript">'
config_script_tag = '<script type="text/x-mathjax-config">'
config_script_tag += 'MathJax.Hub.Config('
config_script_tag += json.dumps(mathjax_config_data)
config_script_tag += ');'
config_script_tag += '</script>'

return mark_safe(load_script_tag + config_script_tag)
return mark_safe(config_script_tag + load_script_tag)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = 'django-mathjax',
version = "0.0.8",
version = "0.0.9",
description = "MathJax easy integration with django",
long_description = "",
keywords = 'django, mathjax',
Expand Down