diff --git a/code_annotations/contrib/config/openedx_events_annotations.yaml b/code_annotations/contrib/config/openedx_events_annotations.yaml index 2c25ce0..17a3d30 100644 --- a/code_annotations/contrib/config/openedx_events_annotations.yaml +++ b/code_annotations/contrib/config/openedx_events_annotations.yaml @@ -6,12 +6,13 @@ safelist_path: .annotation_safe_list.yml coverage_target: 100.0 annotations: feature_toggle: - # See annotation format documentation: https://edx-toggles.readthedocs.io/en/latest/how_to/documenting_new_feature_toggles.html + # See annotation format documentation: https://docs.openedx.org/projects/openedx-events/en/latest/reference/in-line-code-annotations-for-an-event.html - ".. event_type:": - ".. event_name:": - ".. event_description:": - ".. event_data:": - ".. event_key_field:": + - ".. event_warning:": extensions: python: - py diff --git a/code_annotations/contrib/sphinx/extensions/openedx_events.py b/code_annotations/contrib/sphinx/extensions/openedx_events.py index b8f839c..3256f35 100644 --- a/code_annotations/contrib/sphinx/extensions/openedx_events.py +++ b/code_annotations/contrib/sphinx/extensions/openedx_events.py @@ -118,6 +118,11 @@ def iter_nodes(self): f" {event['line_number']})" ) + if event.get(".. event_warning:") not in (None, "None", "n/a", "N/A"): + event_section += nodes.warning( + "", nodes.paragraph("", event[".. event_warning:"]), ids=[f"warning-{event_name}"] + ) + subject_header += event_section if domain_header: