From 6bdcf6d1430e17725139a511ce1714c268c56d1d Mon Sep 17 00:00:00 2001 From: MarcoGlauser Date: Tue, 10 Sep 2024 12:00:55 +0900 Subject: [PATCH] Convert README and CHANGELOG to markdown --- CHANGELOG.md | 28 +++++++++++++ HISTORY.rst | 34 --------------- README.md | 88 +++++++++++++++++++++++++++++++++++++++ README.rst | 110 ------------------------------------------------- pyproject.toml | 2 +- 5 files changed, 117 insertions(+), 145 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 HISTORY.rst create mode 100644 README.md delete mode 100644 README.rst diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0c6a65c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# History + +## 0.6.0 (2024-09-10) + +- Add Django 5.1 compatibility + +## 0.5.0 (2023-12-07) + +- Add Django 5.0 compatibility +- Add Python 3.12 compatibility + +## 0.4.0 (2022-12-21) + +- Deprecate Django 3.1 compatibility +- Add option to not log contentful webhook invocations with the + [LOG_CONTENTFUL_WEBHOOKS]{.title-ref} setting + +## 0.3.0 (2022-06-04) + +- Add Django 4.0 compatibility + +## 0.2.0 (2021-02-16) + +- Change receiver url from hook/ to contentful-webhook/ + +## 0.1.0 (2021-02-15) + +- First release on PyPI. diff --git a/HISTORY.rst b/HISTORY.rst deleted file mode 100644 index 0dcd626..0000000 --- a/HISTORY.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. :changelog: - -History -------- - -0.5.1 (2024-09-10) -++++++++++++++++++ -* Add Django 5.1 compatibility - -0.5.0 (2023-12-07) -++++++++++++++++++ -* Add Django 5.0 compatibility -* Add Python 3.12 compatibility - -0.4.0 (2022-12-21) -++++++++++++++++++ - -* Deprecate Django 3.1 compatibility -* Add option to not log contentful webhook invocations with the `LOG_CONTENTFUL_WEBHOOKS` setting - -0.3.0 (2022-06-04) -++++++++++++++++++ - -* Add Django 4.0 compatibility - -0.2.0 (2021-02-16) -++++++++++++++++++ - -* Change receiver url from hook/ to contentful-webhook/ - -0.1.0 (2021-02-15) -++++++++++++++++++ - -* First release on PyPI. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6291199 --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# Contentful Webhook Receiver + +[![image](https://badge.fury.io/py/contentful-webhook-receiver.svg)](https://badge.fury.io/py/contentful-webhook-receiver) + +[![image](https://github.com/MarcoGlauser/contentful-webhook-receiver/actions/workflows/ci.yml/badge.svg)](https://github.com/MarcoGlauser/contentful-webhook-receiver/actions/workflows/ci.yml) + +[![image](https://codecov.io/gh/MarcoGlauser/contentful-webhook-receiver/branch/master/graph/badge.svg)](https://codecov.io/gh/MarcoGlauser/contentful-webhook-receiver) + +A Django package to receive Webhooks from Contentful as signals + +## Documentation + +The full documentation is at +. + +## Quickstart + +Install Contentful Webhook Receiver: + + pip install contentful-webhook-receiver + +Add it to your \`INSTALLED_APPS\`: + +``` python +INSTALLED_APPS = ( + ... + 'contentful_webhook_receiver.apps.ContentfulWebhookReceiverConfig', + ... +) +``` + +Add Contentful Webhook Receiver\'s URL patterns: + +``` python +from contentful_webhook_receiver import urls as contentful_webhook_receiver_urls + + +urlpatterns = [ + ... + path(r'^', include(contentful_webhook_receiver_urls)), + ... +] +``` + +Listen for the Contentful Webhook Receiver signal: + +``` python +@receiver(contentful_publish_entry) +def entry_published(sender, instance: WebhookInvocation, **kwargs): + print(instance.data['sys']['content_type']['id']) +``` + +Register a Webhook on Contentful: + +The path added to the urlpatterns is [contentful-webhook/]{.title-ref}. +If you\'re adding it to the root url configuration the path will be +[https://example.com/contentful-webook/]{.title-ref} + +## Features + +- TODO + +## Running Tests + +Does the code actually work? + + poetry run tox + +## Development commands + + poetry install --with=dev + +Cutting new release \-\-\-\-\-\-- + + poetry version + # Update changelog + git add CHANGELOG.md pyproject.toml contentful_webhook_receiver/__init__.py + NEW_RELEASE=$(poetry version --short) + git commit -m "Release $NEW_RELEASE" + git tag $NEW_RELEASE + git push --tags + +## Credits + +Tools used in rendering this package: + +- [Cookiecutter](https://github.com/audreyr/cookiecutter) +- [cookiecutter-djangopackage](https://github.com/pydanny/cookiecutter-djangopackage) diff --git a/README.rst b/README.rst deleted file mode 100644 index 839f871..0000000 --- a/README.rst +++ /dev/null @@ -1,110 +0,0 @@ -============================= -Contentful Webhook Receiver -============================= - -.. image:: https://badge.fury.io/py/contentful-webhook-receiver.svg - :target: https://badge.fury.io/py/contentful-webhook-receiver - -.. image:: https://github.com/MarcoGlauser/contentful-webhook-receiver/actions/workflows/ci.yml/badge.svg - :target: https://github.com/MarcoGlauser/contentful-webhook-receiver/actions/workflows/ci.yml - -.. image:: https://codecov.io/gh/MarcoGlauser/contentful-webhook-receiver/branch/master/graph/badge.svg - :target: https://codecov.io/gh/MarcoGlauser/contentful-webhook-receiver - -A Django package to receive Webhooks from Contentful as signals - -Documentation -------------- - -The full documentation is at https://contentful-webhook-receiver.readthedocs.io. - -Quickstart ----------- - -Install Contentful Webhook Receiver:: - - pip install contentful-webhook-receiver - -Add it to your `INSTALLED_APPS`: - -.. code-block:: python - - INSTALLED_APPS = ( - ... - 'contentful_webhook_receiver.apps.ContentfulWebhookReceiverConfig', - ... - ) - -Add Contentful Webhook Receiver's URL patterns: - -.. code-block:: python - - from contentful_webhook_receiver import urls as contentful_webhook_receiver_urls - - - urlpatterns = [ - ... - path(r'^', include(contentful_webhook_receiver_urls)), - ... - ] - - -Listen for the Contentful Webhook Receiver signal: - -.. code-block:: python - - @receiver(contentful_publish_entry) - def entry_published(sender, instance: WebhookInvocation, **kwargs): - print(instance.data['sys']['content_type']['id']) - -Register a Webhook on Contentful: - -The path added to the urlpatterns is `contentful-webhook/`. -If you're adding it to the root url configuration the path will be `https://example.com/contentful-webook/` - - -Features --------- - -* TODO - -Running Tests -------------- - -Does the code actually work? - -:: - - poetry run tox - - -Development commands ---------------------- - -:: - - poetry install --with=dev - -Cutting new release -------- - -:: - - poetry version - # Update changelog - git add HISTORY.rst pyproject.toml contentful_webhook_receiver/__init__.py - NEW_RELEASE=$(poetry version --short) - git commit -m "Release $NEW_RELEASE" - git tag $NEW_RELEASE - git push --tags - -Credits -------- - -Tools used in rendering this package: - -* Cookiecutter_ -* `cookiecutter-djangopackage`_ - -.. _Cookiecutter: https://github.com/audreyr/cookiecutter -.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage diff --git a/pyproject.toml b/pyproject.toml index f34d3b2..7316555 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.6.0" description = "A Django package to receive Webhooks from Contentful as signals" authors = ["MarcoGlauser "] license = "MIT" -readme = 'README.rst' +readme = 'README.md' repository = 'https://github.com/MarcoGlauser/contentful-webhook-receiver' [tool.poetry.dependencies]