diff --git a/code_annotations/contrib/config/openedx_events_annotations.yaml b/code_annotations/contrib/config/openedx_events_annotations.yaml index 2c25ce0..af47b2c 100644 --- a/code_annotations/contrib/config/openedx_events_annotations.yaml +++ b/code_annotations/contrib/config/openedx_events_annotations.yaml @@ -12,6 +12,7 @@ annotations: - ".. 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: