Skip to content

Commit

Permalink
feat: Add autodoc for event annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Feb 20, 2024
1 parent 6427965 commit 4296cc2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'sphinx_copybutton',
'sphinx.ext.graphviz',
'sphinxcontrib.mermaid',
'code_annotations.contrib.sphinx.extensions.openedx_events',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -103,4 +104,4 @@
html_static_path = ['_static']


# -- Extension configuration -------------------------------------------------
# -- Extension configuration -------------------------------------------------
9 changes: 9 additions & 0 deletions docs/reference/events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Events
======

This is the list of Open edX events found in this repository.

.. note::
Events can be create in other projects and plugins as well, but these default events are guaranteed to exist.

.. openedxevents::
1 change: 1 addition & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ References
:maxdepth: 1
:caption: Contents:

events
oeps
architecture-subdomains
5 changes: 5 additions & 0 deletions openedx_events/content_authoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

# .. event_type: org.openedx.content_authoring.xblock.created.v1
# .. event_name: XBLOCK_CREATED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is created.
# .. event_data: XBlockData
XBLOCK_CREATED = OpenEdxPublicSignal(
Expand All @@ -42,6 +43,7 @@

# .. event_type: org.openedx.content_authoring.xblock.updated.v1
# .. event_name: XBLOCK_UPDATED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is updated.
# .. event_data: XBlockData
XBLOCK_UPDATED = OpenEdxPublicSignal(
Expand All @@ -53,6 +55,7 @@

# .. event_type: org.openedx.content_authoring.xblock.published.v1
# .. event_name: XBLOCK_PUBLISHED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is published. If a parent block
# with changes in one or more child blocks is published, only a single
# XBLOCK_PUBLISHED event is fired with parent block details.
Expand All @@ -70,6 +73,7 @@

# .. event_type: org.openedx.content_authoring.xblock.deleted.v1
# .. event_name: XBLOCK_DELETED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is deleted.
# .. event_data: XBlockData
XBLOCK_DELETED = OpenEdxPublicSignal(
Expand All @@ -82,6 +86,7 @@

# .. event_type: org.openedx.content_authoring.xblock.duplicated.v1
# .. event_name: XBLOCK_DUPLICATED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is duplicated in Studio.
# .. event_data: DuplicatedXBlockData
XBLOCK_DUPLICATED = OpenEdxPublicSignal(
Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ click==8.1.7
# -r requirements/test.txt
# code-annotations
# edx-django-utils
code-annotations==1.6.0
git+https://github.com/openedx/code-annotations.git@bmtcril/add_openedx_events
# via -r requirements/test.txt
colorama==0.4.6
# via sphinx-autobuild
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
ddt # A library to multiply test cases
pytest-cov # pytest extension for code coverage statistics
pytest-django # pytest extension for better Django support
code-annotations # provides commands used by the pii_check make target.
https://github.com/openedx/code-annotations.git@bmtcril/add_openedx_events
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ click==8.1.7
# -r requirements/base.txt
# code-annotations
# edx-django-utils
code-annotations==1.6.0
git+https://github.com/openedx/code-annotations.git@bmtcril/add_openedx_events
# via -r requirements/test.in
coverage[toml]==7.4.1
# via pytest-cov
Expand Down

0 comments on commit 4296cc2

Please sign in to comment.