diff -r 92e33e6b9e92 -r 2e1ed76f3c7d src/source/howto-renderer.rst --- a/src/source/howto-renderer.rst Wed May 23 14:24:30 2018 +0200 +++ b/src/source/howto-renderer.rst Fri May 25 09:47:12 2018 +0200 @@ -43,13 +43,12 @@ In the previous point, we did not change the settings interface of the renderer. However, we can define a new settings interface for the new renderer, for that we start by creating an interface -a) Create interface -""""""""""""""""""" +a) Create setting interface +""""""""""""""""""""""""""" .. code-block:: python - class ICustomRendererSettings(Interface): """Custom renderer settings interface""" @@ -68,8 +67,8 @@ -b) Implement interface -"""""""""""""""""""""" +b) Create an implemantation of the interface +"""""""""""""""""""""""""""""""""""""""""""" .. code-block:: python @@ -90,8 +89,10 @@ -c) Create the adapter -""""""""""""""""""""" +c) Create an adapter for the render setting interface +""""""""""""""""""""""""""""""""""""""""""""""""""""" + +With the wrapper :py:func:`@adapter_config()` we declare a new adapter. .. code-block:: python @@ -103,12 +104,18 @@ return get_annotation_adapter(context, CUSTOM_RENDERER_SETTINGS_KEY, CustomRendererSettings) +In this example the settings interface adapter is defined with `IContactParagraph` as context +and provide `ICustomRendererSettings`. d) Add settings interface renderer """""""""""""""""""""""""""""""""" +In the renderer definition: + .. code-block:: python settings_interface = ICustomRendererSettings -By linking a setting_interface with renderer you can use directly in the template, setting attributs +.. tip:: + When a setting_interface is associated to a renderer, you can acces to `settings` attributs through the template +