Skip to content

Commit 77e928e

Browse files
authored
Use absolute import in Spoiler example, add markdown syntax
Examples are more helpful if they contain absolute imports, so I can copy/paste them in my own project. An example of how to use the spoiler tag is also nice to understand the mechanism. This is available in the general sense in https://mistune.readthedocs.io/en/latest/directives.html, but an explicit example here would make it more understandable.
1 parent 13b84cb commit 77e928e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/advanced.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,15 @@ the directives part of the documentation. These are defined in the
123123

124124
Let's try to write a "spoiler" directive, which takes a hint::
125125

126-
from .base import Directive
126+
.. spoiler: SPOILER
127+
128+
Spoilers in the information age are typically listed with a SPOILER! heading.
129+
130+
131+
132+
The `Spoiler` directive::
133+
134+
from mistune.directives import Directive
127135

128136

129137
class Spoiler(Directive):

0 commit comments

Comments
 (0)