Skip to content

feat: upgrade to Wagtail 7.x support#307

Open
hoheinzollern wants to merge 1 commit into
APSL:masterfrom
hoheinzollern:wagtail-7-support
Open

feat: upgrade to Wagtail 7.x support#307
hoheinzollern wants to merge 1 commit into
APSL:masterfrom
hoheinzollern:wagtail-7-support

Conversation

@hoheinzollern

Copy link
Copy Markdown
  • Update Wagtail dependency to support versions 5.2 through 7.x
  • Update django-el-pagination, django-taggit, and wagtail-markdown dependencies
  • Remove deprecated wagtail_hooks.py (Draftail customizations)
  • Add Python 3.12 and Wagtail 7 framework classifiers
  • Bump version to 2.3.0

Rationale for wagtail_hooks.py removal:
The Draftail rich text editor was replaced in Wagtail 5.0+. The blockquote and code features previously added via hooks are now built-in to Wagtail and can be enabled via WAGTAILADMIN_RICH_TEXT_EDITORS configuration.

See Wagtail documentation:

Users can enable these features in settings.py using e.g.:

WAGTAILADMIN_RICH_TEXT_EDITORS = {
    "default": {
        "WIDGET": "wagtail.admin.rich_text.DraftailRichTextArea",
        "OPTIONS": {
            "features": [
                "h2",
                "h3",
                "h4",
                "bold",
                "italic",
                "ol",
                "ul",
                "hr",
                "link",
                "document-link",
                "image",
                "embed",
                "blockquote",
                "code",
            ]
        },
    }
}

This change maintains all functionality while aligning with modern Wagtail best practices and removing deprecated code.

Co-Authored-By: @therefromhere

@hoheinzollern

Copy link
Copy Markdown
Author

@therefromhere reopened, thanks for suggesting the configuration :)

@hoheinzollern

Copy link
Copy Markdown
Author

Replaces #304 and fixes #303 ( note it would be nice to also have a new release of wagtail-markdown with port to nh3 torchbox/wagtail-markdown#163 )

- Update Wagtail dependency to support versions 5.2 through 7.x
- Update django-el-pagination, django-taggit, and wagtail-markdown dependencies
- Remove deprecated wagtail_hooks.py (Draftail customizations)
- Add Python 3.12 and Wagtail 7 framework classifiers
- Bump version to 2.3.0

Rationale for wagtail_hooks.py removal:
The Draftail rich text editor was replaced in Wagtail 5.0+. The blockquote and
code features previously added via hooks are now built-in to Wagtail and can be
enabled via WAGTAILADMIN_RICH_TEXT_EDITORS configuration.

See Wagtail documentation:
- https://docs.wagtail.org/en/stable/extending/rich_text_internals.html
- https://docs.wagtail.org/en/stable/extending/extending_draftail.html

Users can enable these features in settings.py using e.g.:

```
WAGTAILADMIN_RICH_TEXT_EDITORS = {
    "default": {
        "WIDGET": "wagtail.admin.rich_text.DraftailRichTextArea",
        "OPTIONS": {
            "features": [
                "h2",
                "h3",
                "h4",
                "bold",
                "italic",
                "ol",
                "ul",
                "hr",
                "link",
                "document-link",
                "image",
                "embed",
                "blockquote",
                "code",
            ]
        },
    }
}
```

This change maintains all functionality while aligning with modern Wagtail
best practices and removing deprecated code.

Co-Authored-By: @therefromhere
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant