Skip to content

Commit

Permalink
Add simple gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Nov 18, 2024
1 parent 8ae174f commit 430a8cc
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Special for this repo
nogit/
docs/gallery/
docs/sg_execution_times.rst

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
4 changes: 4 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean :
-rm -r _build
-rm -r gallery

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
Expand Down
29 changes: 28 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx_rtd_theme",
"sphinx_gallery.gen_gallery",
]

intersphinx_mapping = {
Expand All @@ -63,6 +64,31 @@
master_doc = "index"


# -- Sphinx Gallery -----------------------------------------------------

# Suppress "cannot cache unpickable configuration value" for sphinx_gallery_conf
# See https://github.com/sphinx-doc/sphinx/issues/12300
suppress_warnings = ["config.cache"]

# The gallery conf. See https://sphinx-gallery.github.io/stable/configuration.html
sphinx_gallery_conf = {
"gallery_dirs": "gallery",
"backreferences_dir": "gallery/backreferences",
"doc_module": ("rendercanvas",),
# "image_scrapers": (),,
"remove_config_comments": True,
# Define order of appearance of the examples
# "subsection_order": ExplicitOrder(
# [
# "../examples/introductory",
# "../examples/feature_demo",
# "../examples/validation",
# "../examples/other",
# ]
# ),
"examples_dirs": "../examples/",
}

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -73,4 +99,5 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
html_static_path = ["static"]
html_css_files = ["custom.css"]
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Welcome to the rendercanvas docs!
api
backends
utils
Gallery <gallery/index.rst>
advanced


Expand Down
4 changes: 4 additions & 0 deletions docs/static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
div.sphx-glr-download,
div.sphx-glr-download-link-note {
display: none;
}
2 changes: 2 additions & 0 deletions examples/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RenderCanvas examples
=====================
3 changes: 3 additions & 0 deletions examples/cube_auto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Cube auto
---------
Run a wgpu example on an automatically selected backend.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/cube_glfw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Cube glfw
---------
Run a wgpu example on the glfw backend.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/cube_offscreen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Cube offscreen
--------------
Render a wgpu example offscreen, and display as an image.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/cube_qt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Cube qt
-------
Run a wgpu example on the Qt backend.
Works with either PySide6, PyQt6, PyQt5 or PySide2.
Expand Down
3 changes: 3 additions & 0 deletions examples/cube_wx.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Cube wx
-------
Run a wgpu example on the wx backend.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/demo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Demo
----
An example that uses events to trigger some canvas functionality.
A nice demo, and very convenient to test the different backends.
Expand Down
3 changes: 3 additions & 0 deletions examples/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Events
------
A simple example to demonstrate events.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/multiple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Multiple
--------
Run cube example in two canvases.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/noise.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Noise
-----
Simple example that uses the bitmap-context to show images of noise.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/offsceen_threaded.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Offscreen threaded
------------------
Example that renders frames in a separate thread.
This uses an offscreen canvas, the result is only used to print the
Expand Down
3 changes: 3 additions & 0 deletions examples/qt_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Qt app
------
An example demonstrating a qt app with a wgpu viz inside.
If needed, change the PySide6 import to e.g. PyQt6, PyQt5, or PySide2.
Expand Down
3 changes: 3 additions & 0 deletions examples/qt_app_asyncio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Qt app with asyncio
-------------------
An example demonstrating a qt app with a wgpu viz inside.
This is the same as the ``qt_app.py`` example, except this uses
Expand Down
3 changes: 3 additions & 0 deletions examples/snake.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
Snake game
----------
Simple snake game based on bitmap rendering. Work in progress.
"""

Expand Down
3 changes: 3 additions & 0 deletions examples/wx_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
wx app
------
An example demonstrating a wx app with a wgpu viz inside.
"""

Expand Down

0 comments on commit 430a8cc

Please sign in to comment.