Kainaat Singh
Kainaat Singh

Reputation: 31

How to create custom admonitions in custom directive sphinx?

I have created a custom directive 'limitation' in Sphinx which mentions "Limitation" of a certain product. I want that the limitation be written within a colored box that is similar to 'note' or 'warning' directives with 'limitation' written as the title instead of 'note' or 'warning'. I want this to be handled by my custom directive 'limitation' itself.

Is there any way to do this?

Upvotes: 3

Views: 1661

Answers (1)

Yao Yue
Yao Yue

Reputation: 41

You can use admonition directly from Docutils:

 .. admonition:: Limitation

    Description of the limitations ...

Check http://docutils.sourceforge.net/docs/ref/rst/directives.html for more information.

Upvotes: 4

Related Questions