Skip to content

Commit

Permalink
DOC Add cross references to widget contributions (#331)
Browse files Browse the repository at this point in the history
Depends on napari/docs#286 

Adds references to new 'creating widgets' section and gallery and
cookiecutter to widget contributions page.

---------

Co-authored-by: Nathan Clack <[email protected]>
Co-authored-by: Peter Sobolewski <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent 2622e1c commit 636969a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions _docs/templates/_npe2_widgets_guide.md.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
(widgets-contribution-guide)=
## Widgets

Widget plugins allow developers to contribute novel graphical
elements (aka "widgets") to the user interface. These widgets can request
Widget plugin contributions allow developers to add novel graphical
elements (aka "widgets") to the user interface. For a full introduction to
creating `napari` widgets see [](creating-widgets).

Widgets can request
access to the viewer instance in which they are docked, enabling a broad
range of functionality: essentially, anything that can be done with the
napari `Viewer` and `Layer` APIs can be accomplished with widgets.
Expand Down Expand Up @@ -58,6 +61,12 @@ specification:
hook specification. In the new `npe2` pattern, one uses the `autogenerate`
field in the [WidgetContribution](contributions-widgets).

For more examples see [](creating-widgets) and
[GUI gallery examples](https://napari.org/stable/_tags/gui.html) (only a subset
involve widgets). Additionally,
[cookiecutter-napari-plugin](https://github.com/napari/cookiecutter-napari-plugin)
has more robust widget examples that you can adapt to your needs.

```{note}
Notice that `napari` type annotations are strings and not imported. This is to
avoid including `napari` as a plugin dependency when not strictly required.
Expand Down

0 comments on commit 636969a

Please sign in to comment.