From 2b28c088e5b44558a390ef58ab976ba4b81e5f44 Mon Sep 17 00:00:00 2001 From: zerolab Date: Thu, 11 Jun 2026 16:40:56 +0200 Subject: [PATCH 1/6] Rename the module to wagtail_polymath --- .github/workflows/ruff.yml | 2 +- README.md | 13 +++++++------ pyproject.toml | 6 +++--- src/{wagtailmath => wagtail_polymath}/__init__.py | 0 src/wagtail_polymath/apps.py | 5 +++++ src/{wagtailmath => wagtail_polymath}/blocks.py | 0 .../js/wagtail_polymath-mathjax-controller.js} | 0 .../static/wagtail_polymath/js/wagtail_polymath.js} | 0 .../templates/wagtail_polymath}/mathjaxwidget.html | 0 .../templatetags/__init__.py | 0 .../templatetags/wagtail_polymath.py} | 2 +- src/{wagtailmath => wagtail_polymath}/widgets.py | 8 +++++--- src/wagtailmath/apps.py | 5 ----- tests/testapp/migrations/0001_initial.py | 5 +++-- tests/testapp/models.py | 3 ++- tests/testproject/settings.py | 2 +- 16 files changed, 28 insertions(+), 23 deletions(-) rename src/{wagtailmath => wagtail_polymath}/__init__.py (100%) create mode 100644 src/wagtail_polymath/apps.py rename src/{wagtailmath => wagtail_polymath}/blocks.py (100%) rename src/{wagtailmath/static/wagtailmath/js/wagtailmath-mathjax-controller.js => wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath-mathjax-controller.js} (100%) rename src/{wagtailmath/static/wagtailmath/js/wagtailmath.js => wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath.js} (100%) rename src/{wagtailmath/templates/wagtailmath => wagtail_polymath/templates/wagtail_polymath}/mathjaxwidget.html (100%) rename src/{wagtailmath => wagtail_polymath}/templatetags/__init__.py (100%) rename src/{wagtailmath/templatetags/wagtailmath.py => wagtail_polymath/templatetags/wagtail_polymath.py} (81%) rename src/{wagtailmath => wagtail_polymath}/widgets.py (67%) delete mode 100644 src/wagtailmath/apps.py diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 3731ee6..f0fd45d 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -34,4 +34,4 @@ jobs: - name: Run ruff working-directory: ./src - run: ruff check --output-format=github wagtailmath + run: ruff check --output-format=github wagtail_polymath diff --git a/README.md b/README.md index a4f35ab..c4bc2ef 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD--3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![PyPI version](https://img.shields.io/pypi/v/wagtailmath.svg?style=flat)](https://pypi.org/project/wagtailmath) +[![PyPI version](https://img.shields.io/pypi/v/wagtailmath.svg?style=flat)](https://pypi.org/project/wagtail-polymath) [![Build status](https://img.shields.io/github/actions/workflow/status/wagtail-nest/wagtail-polymath/test.yml?branch=main)](https://github.com/wagtail-nest/wagtail-polymath/actions) ## Links @@ -41,9 +41,9 @@ the markup language-specific documentation (e.g. https://en.wikibooks.org/wiki/L ## Quickstart -Install wagtailmath: +Install wagtail_polymath: - pip install wagtailmath + pip install wagtail_polymath Add it to your `INSTALLED_APPS`: @@ -52,7 +52,7 @@ Add it to your `INSTALLED_APPS`: INSTALLED_APPS = ( # ... - "wagtailmath", + "wagtail_polymath", # ... ) ``` @@ -60,7 +60,8 @@ INSTALLED_APPS = ( Use `MathBlock` in your `StreamField` content: ```python -from wagtailmath.blocks import MathBlock +from wagtail_polymath.blocks import MathBlock + class MyPage(Page): body = StreamField([ @@ -74,7 +75,7 @@ Use the `mathjax` template tag in your front end template to load the MathJax library: ```django+html -{% load wagtailmath %} +{% load wagtail_polymath %} ... diff --git a/pyproject.toml b/pyproject.toml index 9cf63bf..54ac6e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,14 +3,14 @@ requires = ["flit_core >=3.2,<4"] build-backend = "flit_core.buildapi" [project] -name = "wagtailmath" +name = "wagtail-polymath" authors = [{name = "James Ramm", email = "jamessramm@gmail.com"}] maintainers = [{name = "Wagtail Nest team", email = "hello@wagtail.org"}] description = "Wagtail StreamField block for rendering mathematical equations" readme = "README.md" license = {file = "LICENSE"} classifiers = [ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", @@ -53,7 +53,7 @@ Changelog = "https://github.com/wagtail-nest/wagtail-polymath/blob/main/CHANGELO Documentation = "https://github.com/wagtail-nest/wagtail-polymath/blob/main/docs/" [tool.flit.module] -name = "wagtailmath" +name = "wagtail_polymath" [tool.flit.sdist] exclude = [ diff --git a/src/wagtailmath/__init__.py b/src/wagtail_polymath/__init__.py similarity index 100% rename from src/wagtailmath/__init__.py rename to src/wagtail_polymath/__init__.py diff --git a/src/wagtail_polymath/apps.py b/src/wagtail_polymath/apps.py new file mode 100644 index 0000000..04fdb97 --- /dev/null +++ b/src/wagtail_polymath/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class WagtailPolymathConfig(AppConfig): + name = "wagtail_polymath" diff --git a/src/wagtailmath/blocks.py b/src/wagtail_polymath/blocks.py similarity index 100% rename from src/wagtailmath/blocks.py rename to src/wagtail_polymath/blocks.py diff --git a/src/wagtailmath/static/wagtailmath/js/wagtailmath-mathjax-controller.js b/src/wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath-mathjax-controller.js similarity index 100% rename from src/wagtailmath/static/wagtailmath/js/wagtailmath-mathjax-controller.js rename to src/wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath-mathjax-controller.js diff --git a/src/wagtailmath/static/wagtailmath/js/wagtailmath.js b/src/wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath.js similarity index 100% rename from src/wagtailmath/static/wagtailmath/js/wagtailmath.js rename to src/wagtail_polymath/static/wagtail_polymath/js/wagtail_polymath.js diff --git a/src/wagtailmath/templates/wagtailmath/mathjaxwidget.html b/src/wagtail_polymath/templates/wagtail_polymath/mathjaxwidget.html similarity index 100% rename from src/wagtailmath/templates/wagtailmath/mathjaxwidget.html rename to src/wagtail_polymath/templates/wagtail_polymath/mathjaxwidget.html diff --git a/src/wagtailmath/templatetags/__init__.py b/src/wagtail_polymath/templatetags/__init__.py similarity index 100% rename from src/wagtailmath/templatetags/__init__.py rename to src/wagtail_polymath/templatetags/__init__.py diff --git a/src/wagtailmath/templatetags/wagtailmath.py b/src/wagtail_polymath/templatetags/wagtail_polymath.py similarity index 81% rename from src/wagtailmath/templatetags/wagtailmath.py rename to src/wagtail_polymath/templatetags/wagtail_polymath.py index 19e4ac3..7f73605 100644 --- a/src/wagtailmath/templatetags/wagtailmath.py +++ b/src/wagtail_polymath/templatetags/wagtail_polymath.py @@ -1,6 +1,6 @@ from django import template -from wagtailmath.widgets import MATHJAX_VERSION +from wagtail_polymath.widgets import MATHJAX_VERSION register = template.Library() diff --git a/src/wagtailmath/widgets.py b/src/wagtail_polymath/widgets.py similarity index 67% rename from src/wagtailmath/widgets.py rename to src/wagtail_polymath/widgets.py index a3ce5f6..8de0a38 100644 --- a/src/wagtailmath/widgets.py +++ b/src/wagtail_polymath/widgets.py @@ -6,7 +6,7 @@ class MathJaxWidget(forms.Textarea): - template_name = "wagtailmath/mathjaxwidget.html" + template_name = "wagtail_polymath/mathjaxwidget.html" def build_attrs(self, *args, **kwargs): attrs = super().build_attrs(*args, **kwargs) @@ -19,7 +19,9 @@ def media(self): return forms.Media( js=( f"https://cdnjs.cloudflare.com/ajax/libs/mathjax/{MATHJAX_VERSION}/MathJax.js?config=TeX-MML-AM_HTMLorMML", - versioned_static("wagtailmath/js/wagtailmath.js"), - versioned_static("wagtailmath/js/wagtailmath-mathjax-controller.js"), + versioned_static("wagtail_polymath/js/wagtail_polymath.js"), + versioned_static( + "wagtail_polymath/js/wagtail_polymath-mathjax-controller.js" + ), ) ) diff --git a/src/wagtailmath/apps.py b/src/wagtailmath/apps.py deleted file mode 100644 index e379a2f..0000000 --- a/src/wagtailmath/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class WagtailMathConfig(AppConfig): - name = "wagtailmath" diff --git a/tests/testapp/migrations/0001_initial.py b/tests/testapp/migrations/0001_initial.py index dc963d5..78e2407 100644 --- a/tests/testapp/migrations/0001_initial.py +++ b/tests/testapp/migrations/0001_initial.py @@ -3,10 +3,11 @@ import django.db.models.deletion import wagtail.blocks import wagtail.fields -import wagtailmath.blocks from django.db import migrations, models +import wagtail_polymath.blocks + class Migration(migrations.Migration): initial = True @@ -39,7 +40,7 @@ class Migration(migrations.Migration): wagtail.blocks.CharBlock(form_classname="full title"), ), ("paragraph", wagtail.blocks.RichTextBlock()), - ("equation", wagtailmath.blocks.MathBlock()), + ("equation", wagtail_polymath.blocks.MathBlock()), ], use_json_field=True, ), diff --git a/tests/testapp/models.py b/tests/testapp/models.py index 1168315..217067f 100644 --- a/tests/testapp/models.py +++ b/tests/testapp/models.py @@ -2,7 +2,8 @@ from wagtail.admin.panels import FieldPanel from wagtail.fields import StreamField from wagtail.models import Page -from wagtailmath.blocks import MathBlock + +from wagtail_polymath.blocks import MathBlock class MathPage(Page): diff --git a/tests/testproject/settings.py b/tests/testproject/settings.py index 5ba0dea..bd5c41f 100644 --- a/tests/testproject/settings.py +++ b/tests/testproject/settings.py @@ -33,7 +33,7 @@ # Application definition INSTALLED_APPS = [ - "wagtailmath", + "wagtail_polymath", "testapp", "wagtail.users", "wagtail.snippets", From b93c6d45411a3c0e4327998fa787c4c13858b085 Mon Sep 17 00:00:00 2001 From: zerolab Date: Thu, 11 Jun 2026 16:44:03 +0200 Subject: [PATCH 2/6] Bump version to 2.0.0 - dev Renaming is a big change --- src/wagtail_polymath/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wagtail_polymath/__init__.py b/src/wagtail_polymath/__init__.py index 9c73af2..27916c7 100644 --- a/src/wagtail_polymath/__init__.py +++ b/src/wagtail_polymath/__init__.py @@ -1 +1 @@ -__version__ = "1.3.1" +__version__ = "2.0.0.dev1" From fefe103f800b02c5477b16f86f6eb066392f7f28 Mon Sep 17 00:00:00 2001 From: zerolab Date: Wed, 17 Jun 2026 16:12:56 +0100 Subject: [PATCH 3/6] Add changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ed943..1b5cd65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +## 2.0.0.dev1 (2026-06-17) + +- The project namespace has changed from wagtailmath to wagtail_polymath. + Example: `from wagtailmath.blocks import MathBlock` → `from wagtail_polymath.blocks import MathBlock` + ## 1.3.0 (2024-07-04) - Updated project tooling: From a50bb47cf9c7e6a44145b0e5cb022b0ad8ff759b Mon Sep 17 00:00:00 2001 From: zerolab Date: Thu, 18 Jun 2026 11:10:26 +0100 Subject: [PATCH 4/6] Tidy ups --- README.md | 6 +++--- tests/testapp/templates/testapp/math_page.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4bc2ef..45e17f0 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,6 @@ All contributions are welcome! See [CONTRIBUTING.md](https://github.com/wagtail- Supported versions: -- Python 3.8, 3.9, 3.10, 3.11, 3.12 -- Django 4.2, 5.0 -- Wagtail 5.2 (LTS), 6.0, 6.1 +- Python 3.10-3.14 +- Django 5.2, 6.0 +- Wagtail 7.0 (LTS), 7.3, 7.4 (LTS) diff --git a/tests/testapp/templates/testapp/math_page.html b/tests/testapp/templates/testapp/math_page.html index b463d18..5bdfa92 100644 --- a/tests/testapp/templates/testapp/math_page.html +++ b/tests/testapp/templates/testapp/math_page.html @@ -1,4 +1,4 @@ -{% load wagtailmath %} +{% load wagtail_polymath %} From fc4ea8880c6c99c721132c058b962d1d1a115702 Mon Sep 17 00:00:00 2001 From: zerolab Date: Thu, 18 Jun 2026 17:15:09 +0100 Subject: [PATCH 5/6] Update 2.0.0dev1 release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b5cd65..db1db62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -## 2.0.0.dev1 (2026-06-17) +## 2.0.0.dev1 (2026-06-18) - The project namespace has changed from wagtailmath to wagtail_polymath. Example: `from wagtailmath.blocks import MathBlock` → `from wagtail_polymath.blocks import MathBlock` From 3955a18009176acb0b7a55557996bc952a9a01cb Mon Sep 17 00:00:00 2001 From: zerolab Date: Thu, 18 Jun 2026 17:16:25 +0100 Subject: [PATCH 6/6] Add missing 1.3.1 changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db1db62..81bfcfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - The project namespace has changed from wagtailmath to wagtail_polymath. Example: `from wagtailmath.blocks import MathBlock` → `from wagtail_polymath.blocks import MathBlock` +## 1.3.1 (2024-10-30) + +- Fixed preview initialisation issue (#17) @MadScrewdriver + ## 1.3.0 (2024-07-04) - Updated project tooling: