Skip to content

Commit

Permalink
Add support for important directive
Browse files Browse the repository at this point in the history
Signed-off-by: Liran Funaro <[email protected]>
  • Loading branch information
liran-funaro committed Sep 2, 2024
1 parent 89ee37a commit f11af7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sphinx_markdown_builder/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ def unknown_visit(self, node):
# visit/depart handlers
################################################################################

@pushing_context
def visit_important(self, _node):
"""Sphinx important directive."""
self._push_box("IMPORTANT")

@pushing_context
def visit_warning(self, _node):
"""Sphinx warning directive."""
Expand Down
3 changes: 3 additions & 0 deletions tests/expected/ExampleRSTFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ other sources or editors.
Boldface is used for labels that are visible in the user interface. The UI
text is surrounded by double asterisks. For example, **bold**.

#### IMPORTANT
This is an important message.

Italics are rarely used. Text surrounded by single asterisks is rendered in
*italics*.

Expand Down
3 changes: 3 additions & 0 deletions tests/source/ExampleRSTFile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ own line number for commenting in reviews.
Boldface is used for labels that are visible in the user interface. The UI
text is surrounded by double asterisks. For example, **bold**.

.. important::
This is an important message.

Italics are rarely used. Text surrounded by single asterisks is rendered in
*italics*.

Expand Down

0 comments on commit f11af7b

Please sign in to comment.