Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`:

Expand All @@ -52,15 +52,16 @@ Add it to your `INSTALLED_APPS`:

INSTALLED_APPS = (
# ...
"wagtailmath",
"wagtail_polymath",
# ...
)
```

Use `MathBlock` in your `StreamField` content:

```python
from wagtailmath.blocks import MathBlock
from wagtail_polymath.blocks import MathBlock


class MyPage(Page):
body = StreamField([
Expand All @@ -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 %}
...

<script src="{% mathjax %}"></script>
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions src/wagtail_polymath/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.0.0.dev1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought: we should consider automatically determining the version through setuptools-scm or similar.

5 changes: 5 additions & 0 deletions src/wagtail_polymath/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class WagtailPolymathConfig(AppConfig):
name = "wagtail_polymath"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import template

from wagtailmath.widgets import MATHJAX_VERSION
from wagtail_polymath.widgets import MATHJAX_VERSION


register = template.Library()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
),
)
)
1 change: 0 additions & 1 deletion src/wagtailmath/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/wagtailmath/apps.py

This file was deleted.

5 changes: 3 additions & 2 deletions tests/testapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
),
Expand Down
3 changes: 2 additions & 1 deletion tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/testproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Application definition

INSTALLED_APPS = [
"wagtailmath",
"wagtail_polymath",
"testapp",
"wagtail.users",
"wagtail.snippets",
Expand Down