Name | wagtail-cblocks JSON |
Version |
0.4.0
JSON |
| download |
home_page | |
Summary | Collection of StreamField blocks for Wagtail |
upload_time | 2023-04-02 17:20:34 |
maintainer | |
docs_url | None |
author | Cliss XXI |
requires_python | <4,>=3.7 |
license | AGPLv3+ |
keywords |
wagtail
blocks
streamfield
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# wagtail-cblocks
A collection of StreamField blocks to use in Wagtail CMS.
**Warning!** This project is still early on in its development lifecycle. It is
possible for breaking changes to occur between versions until reaching a stable
1.0. Feedback and pull requests are welcome.
## Requirements
wagtail-cblocks requires the following:
- **Wagtail** (4.1 LTS, 4.2)
- **Django** (3.2, 4.0, 4.1)
- **Python 3** (3.7, 3.8, 3.9, 3.10)
## Installation
1. Install using ``pip``:
```shell
$ pip install wagtail-cblocks
```
2. Add ``wagtail_cblocks`` to your ``INSTALLED_APPS`` setting:
```python
INSTALLED_APPS = [
# ...
'wagtail_cblocks',
# ...
]
```
## Usage
Each block comes with a template made for Bootstrap 5 which is not shipped by
this plugin. If you plan to use them as is, you must have at least the Bootstrap
stylesheet loaded in your base template - refer as needed to the
[Bootstrap documentation](https://getbootstrap.com/).
In waiting for the documentation, here is a sample usage:
```python
from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail.blocks import StreamBlock
from wagtail.fields import StreamField
from wagtail.models import Page
from wagtail_cblocks.blocks import (
ButtonBlock,
ColumnsBlock,
HeadingBlock,
ImageBlock,
ParagraphBlock,
)
class BaseBlock(StreamBlock):
title_block = HeadingBlock()
paragraph_block = ParagraphBlock()
button_block = ButtonBlock()
image_block = ImageBlock()
class BodyBlock(BaseBlock):
columns_block = ColumnsBlock(BaseBlock())
class StandardPage(Page):
body = StreamField(BodyBlock())
content_panels = Page.content_panels + [
StreamFieldPanel('body'),
]
```
Factories are also provided for some of the blocks to ease tests - see
[`wagtail_cblocks/factories.py`](wagtail_cblocks/factories.py). To make use of
them, install the extra *factories* requirements:
```shell
$ pip install wagtail-cblocks[factories]
```
## Development
### Quick start
To set up a development environment, ensure that Python 3 is installed on your
system. Then:
1. Clone this repository
2. Create a virtual environment and activate it:
```shell
$ python3 -m venv venv
$ source venv/bin/activate
```
3. Install this package and its requirements:
```shell
(venv)$ pip install -r requirements-dev.txt
```
Finally, if you want to run the test application to preview the blocks, you will
have to create the database before running a development server:
```shell
(venv)$ ./tests/manage.py migrate
(venv)$ ./tests/manage.py runserver
```
### Contributing
The tests are written with [pytest] and code coverage is measured with [coverage].
You can use the following commands while developing:
- ``make test``: run the tests and output a quick report of code coverage
- ``make test-wip``: only run the tests marked as 'wip'
- ``make test-all``: run the tests on all supported versions of Django and
Wagtail with [nox]
The Python code is formatted and linted thanks to [flake8], [isort] and [black].
All of these tools are configured in [pre-commit] and you should consider to
install its git hook scripts by running:
```shell
(venv)$ pre-commit install
```
When submitting a pull-request, please ensure that the code is well formatted
and covered, and that all the tests pass.
[pytest]: https://docs.pytest.org/
[coverage]: https://coverage.readthedocs.io/
[nox]: https://nox.thea.codes/
[flake8]: https://flake8.pycqa.org/
[isort]: https://pycqa.github.io/isort/
[black]: https://black.readthedocs.io/
[pre-commit]: https://pre-commit.com/
## License
This extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and
licensed under the [AGPLv3+](LICENSE). Any contribution is welcome!
Raw data
{
"_id": null,
"home_page": "",
"name": "wagtail-cblocks",
"maintainer": "",
"docs_url": null,
"requires_python": "<4,>=3.7",
"maintainer_email": "",
"keywords": "wagtail,blocks,streamfield",
"author": "Cliss XXI",
"author_email": "contact@cliss21.com",
"download_url": "https://files.pythonhosted.org/packages/18/3a/b0cf47c938e489796c09fad63c1f6025bacd7c69510497226d479be6f441/wagtail_cblocks-0.4.0.tar.gz",
"platform": null,
"description": "# wagtail-cblocks\n\nA collection of StreamField blocks to use in Wagtail CMS.\n\n**Warning!** This project is still early on in its development lifecycle. It is\npossible for breaking changes to occur between versions until reaching a stable\n1.0. Feedback and pull requests are welcome.\n\n## Requirements\n\nwagtail-cblocks requires the following:\n- **Wagtail** (4.1 LTS, 4.2)\n- **Django** (3.2, 4.0, 4.1)\n- **Python 3** (3.7, 3.8, 3.9, 3.10)\n\n## Installation\n\n1. Install using ``pip``:\n ```shell\n $ pip install wagtail-cblocks\n ```\n2. Add ``wagtail_cblocks`` to your ``INSTALLED_APPS`` setting:\n ```python\n INSTALLED_APPS = [\n # ...\n 'wagtail_cblocks',\n # ...\n ]\n ```\n\n## Usage\n\nEach block comes with a template made for Bootstrap 5 which is not shipped by\nthis plugin. If you plan to use them as is, you must have at least the Bootstrap\nstylesheet loaded in your base template - refer as needed to the\n[Bootstrap documentation](https://getbootstrap.com/).\n\nIn waiting for the documentation, here is a sample usage:\n\n```python\nfrom wagtail.admin.edit_handlers import StreamFieldPanel\nfrom wagtail.blocks import StreamBlock\nfrom wagtail.fields import StreamField\nfrom wagtail.models import Page\n\nfrom wagtail_cblocks.blocks import (\n ButtonBlock,\n ColumnsBlock,\n HeadingBlock,\n ImageBlock,\n ParagraphBlock,\n)\n\n\nclass BaseBlock(StreamBlock):\n title_block = HeadingBlock()\n paragraph_block = ParagraphBlock()\n button_block = ButtonBlock()\n image_block = ImageBlock()\n\n\nclass BodyBlock(BaseBlock):\n columns_block = ColumnsBlock(BaseBlock())\n\n\nclass StandardPage(Page):\n body = StreamField(BodyBlock())\n\n content_panels = Page.content_panels + [\n StreamFieldPanel('body'),\n ]\n```\n\nFactories are also provided for some of the blocks to ease tests - see\n[`wagtail_cblocks/factories.py`](wagtail_cblocks/factories.py). To make use of\nthem, install the extra *factories* requirements:\n\n```shell\n$ pip install wagtail-cblocks[factories]\n```\n\n## Development\n### Quick start\n\nTo set up a development environment, ensure that Python 3 is installed on your\nsystem. Then:\n\n1. Clone this repository\n2. Create a virtual environment and activate it:\n ```shell\n $ python3 -m venv venv\n $ source venv/bin/activate\n ```\n3. Install this package and its requirements:\n ```shell\n (venv)$ pip install -r requirements-dev.txt\n ```\n\nFinally, if you want to run the test application to preview the blocks, you will\nhave to create the database before running a development server:\n```shell\n(venv)$ ./tests/manage.py migrate\n(venv)$ ./tests/manage.py runserver\n```\n\n### Contributing\n\nThe tests are written with [pytest] and code coverage is measured with [coverage].\nYou can use the following commands while developing:\n- ``make test``: run the tests and output a quick report of code coverage\n- ``make test-wip``: only run the tests marked as 'wip'\n- ``make test-all``: run the tests on all supported versions of Django and\n Wagtail with [nox]\n\nThe Python code is formatted and linted thanks to [flake8], [isort] and [black].\nAll of these tools are configured in [pre-commit] and you should consider to\ninstall its git hook scripts by running:\n```shell\n(venv)$ pre-commit install\n```\n\nWhen submitting a pull-request, please ensure that the code is well formatted\nand covered, and that all the tests pass.\n\n[pytest]: https://docs.pytest.org/\n[coverage]: https://coverage.readthedocs.io/\n[nox]: https://nox.thea.codes/\n[flake8]: https://flake8.pycqa.org/\n[isort]: https://pycqa.github.io/isort/\n[black]: https://black.readthedocs.io/\n[pre-commit]: https://pre-commit.com/\n\n## License\n\nThis extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and\nlicensed under the [AGPLv3+](LICENSE). Any contribution is welcome!\n",
"bugtrack_url": null,
"license": "AGPLv3+",
"summary": "Collection of StreamField blocks for Wagtail",
"version": "0.4.0",
"split_keywords": [
"wagtail",
"blocks",
"streamfield"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0f71a7ae5c0c512d7524b9f6ab69971cab93c6483808d70fb011028589379765",
"md5": "bd9f0f45d711394285a913b8edccaf53",
"sha256": "cc7fe30fe44e561e631b975c51a3c024aad6e289804d78ee272939997b212bab"
},
"downloads": -1,
"filename": "wagtail_cblocks-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bd9f0f45d711394285a913b8edccaf53",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.7",
"size": 23594,
"upload_time": "2023-04-02T17:20:31",
"upload_time_iso_8601": "2023-04-02T17:20:31.836400Z",
"url": "https://files.pythonhosted.org/packages/0f/71/a7ae5c0c512d7524b9f6ab69971cab93c6483808d70fb011028589379765/wagtail_cblocks-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "183ab0cf47c938e489796c09fad63c1f6025bacd7c69510497226d479be6f441",
"md5": "922cf3b8e57360da5bc3b514795b34ac",
"sha256": "776c32bac690f7477bac276ba3e9505ce262716780d9773d9dd62f47175e4957"
},
"downloads": -1,
"filename": "wagtail_cblocks-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "922cf3b8e57360da5bc3b514795b34ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.7",
"size": 35934,
"upload_time": "2023-04-02T17:20:34",
"upload_time_iso_8601": "2023-04-02T17:20:34.318539Z",
"url": "https://files.pythonhosted.org/packages/18/3a/b0cf47c938e489796c09fad63c1f6025bacd7c69510497226d479be6f441/wagtail_cblocks-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-02 17:20:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "wagtail-cblocks"
}