Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain how to add new examples to the gallery #137

Merged
merged 5 commits into from Apr 25, 2023

Conversation

melissawm
Copy link
Member

Description

Adds some explanation on how to add new examples to the gallery.

Type of change

  • Fixes or improves existing content
  • Adds new content page(s)
  • Fixes or improves workflow, documentation build or deployment

References

Closes #92

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have added alt text to new images included in this PR

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 12, 2023
Copy link
Member

@psobolewskiPhD psobolewskiPhD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Copy link
Member

@jni jni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melissawm super great, thank you! 😊

Do you think we should also point out that napari.run() needs to be under a __main__ guard or things won't work? That won't be obvious to most users.

comma.

Note that the examples are the `.py` source files, and any outputs and images
will be autogenerated when the documentation site is built.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also want to add a note that napari.run() has to be under the __main__ guard?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. That's a good point I think. For people who use mostly notebooks and interactive environments the __main__ and napari.run() could be a bit of a mystery?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I will explain that.

@melissawm
Copy link
Member Author

@Czaki Czaki added this to the 0.5.0 milestone Apr 24, 2023
@psobolewskiPhD
Copy link
Member

psobolewskiPhD commented Apr 24, 2023

Just to be clear: when contributing an example, for the example to be in our gallery though, the main is required, right?
It's definitely required to be able to do python example.py

Also, I think ipython behaves same as jupiter, so copy paste the code just works, without the main

@melissawm
Copy link
Member Author

@psobolewskiPhD you are of course right - let me know if this rephrasing reads better?

@psobolewskiPhD
Copy link
Member

@melissawm I made some small suggestions, based on my understanding.

Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
@psobolewskiPhD psobolewskiPhD merged commit f9d6ec8 into napari:main Apr 25, 2023
4 checks passed
melissawm added a commit to melissawm/napari-docs that referenced this pull request Apr 26, 2023
# Description
Adds some explanation on how to add new examples to the gallery.

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Fixes or improves existing content

# References
Closes napari#92

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
---------

Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
@Czaki Czaki modified the milestones: 0.5.0, 0.4.19 Oct 31, 2023
@melissawm melissawm deleted the examples-instructions branch January 9, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add instructions on how to include new gallery examples
4 participants