Skip to content

Commit

Permalink
Merge pull request #323 from openzim/fix_mathjax
Browse files Browse the repository at this point in the history
Properly apply MathJax configuration
  • Loading branch information
benoit74 authored Oct 29, 2024
2 parents da6514a + 4e16a79 commit 278ee55
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Fixed

- Fix Mathjax equations not displayed properly (#283)

## [2.1.2] - 2024-05-13

## Fixed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM redis:6.2.4-buster AS redis

FROM python:3.8-slim-buster
FROM python:3.8-buster

RUN groupadd -r -g 999 redis && useradd -r -g redis -u 999 redis
COPY --from=redis /usr/local/bin/redis-server /usr/local/bin/redis-server
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It is based on Stack Exchange's Data Dumps hosted by [The Internet
Archive](https://archive.org/download/stackexchange/).

[![CodeFactor](https://www.codefactor.io/repository/github/openzim/sotoki/badge)](https://www.codefactor.io/repository/github/openzim/sotoki)
[![Docker](https://ghcr-badge.deta.dev/openzim/sotoki/latest_tag?label=docker)](https://ghcr.io/openzim/sotoki)
[![Docker](https://ghcr-badge.egpl.dev/openzim/sotoki/latest_tag?label=docker)](https://ghcr.io/openzim/sotoki)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![PyPI version shields.io](https://img.shields.io/pypi/v/sotoki.svg)](https://pypi.org/project/sotoki/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sotoki.svg)](https://pypi.org/project/sotoki)
Expand Down
11 changes: 0 additions & 11 deletions src/sotoki/assets/static/js/mathjax-config.js

This file was deleted.

14 changes: 13 additions & 1 deletion src/sotoki/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@
<script src="{{ to_root }}static/js/hljs-trigger.js"></script>
{% endif %}
{% if site_mathjax %}
<script type="text/x-mathjax-config" src="{{ to_root }}static/js/mathjax-config.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },
tex2jax: { inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], processEscapes: true, ignoreClass: "tex2jax_ignore|dno" },
TeX: {
extensions: ["begingroup.js"],
noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
Macros: { href: "{}" }
},
messageStyle: "none",
styles: { ".MathJax_Display, .MathJax_Preview, .MathJax_Preview > *": { "background": "inherit" } },
SEEditor: "mathjaxEditing"
});
</script>
<script src="{{ to_root }}static/js/MathJax.js?config=TeX-AMS_HTML-full"></script>
{% endif %}
</head>
Expand Down

0 comments on commit 278ee55

Please sign in to comment.