Browse Source

Helpful addition to Developer Docs on Extending Draftail (#11057)

Ensure hooks imports are added to the code snippets
Temidayo 1 year ago
parent
commit
69d30e2749
1 changed files with 3 additions and 0 deletions
  1. 3 0
      docs/extending/extending_draftail.md

+ 3 - 0
docs/extending/extending_draftail.md

@@ -83,6 +83,7 @@ Blocks are nearly as simple as inline styles:
 ```python
 import wagtail.admin.rich_text.editors.draftail.features as draftail_features
 from wagtail.admin.rich_text.converters.html_to_contentstate import BlockElementHandler
+from wagtail import hooks
 
 @hooks.register('register_rich_text_features')
 def register_help_text_feature(features):
@@ -352,6 +353,7 @@ Here is an example with a simple sentence counter – first, registering the edi
 
 ```python
 from wagtail.admin.rich_text.editors.draftail.features import ControlFeature
+from wagtail import hooks
 
 
 @hooks.register('register_rich_text_features')
@@ -422,6 +424,7 @@ Here is an example with highlighting of problematic punctuation – first, regis
 
 ```python
 from wagtail.admin.rich_text.editors.draftail.features import DecoratorFeature
+from wagtail import hooks
 
 
 @hooks.register('register_rich_text_features')