Skip to content

docs: bare >>> examples get an Examples heading, code-block and plot - #306

Open
petercorke wants to merge 15 commits into
mainfrom
docs/bare-example-blocks
Open

petercorke wants to merge 15 commits into
mainfrom
docs/bare-example-blocks

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Example blocks that began with a bare >>> (no directive) rendered as plain doctest blocks, with no heading and no figure. This reviews each of the 22 by hand.

  • Examples now sit under .. rubric:: Examples, with the code in .. code-block:: pycon (or python) and, where the example draws something, a matching .. plot:: block.
  • Added plots for Blobs.plot*, shadow_invariant, mkcube, Random and the point-feature examples (SIFT, ORB, BRISK, AKAZE, Harris).
  • Sources.tensor and TensorStack examples use the real video file and its real shape.
  • One Examples heading per docstring; removed an empty heading from the private _loaddata.
  • Fixed indentation of code blocks under prose, and extra blank lines after them.

Documentation only; no behavior changes. I built the docs earlier in this work with only the known baseline warnings, but have not rebuilt after the last small edits.

An AI assistant (Claude Code) wrote this change.

🤖 Generated with Claude Code

petercorke and others added 15 commits November 26, 2026 06:15
…ant and mkcube get plots

The ten Blobs plot examples (plot_box, plot_labelbox and the others) repeat their
code in a .. plot:: section, so the >>> lines are now a .. code-block:: pycon above
it.  shadow_invariant shows its input and result, and its example reads the image
as iread returns it.  mkcube(edge=True) gets a plot, its MATLAB-like block is
indented to the level of the text above it, and it uses add_subplot because
gca(projection=) was removed from Matplotlib.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The plot sections of plot_centroid, plot_perimeter, plot_ellipse, plot_axes,
plot_aligned_box, plot_MEC and plot_MER now include the call for all blobs, as
the code above them does.  The empty >>> line becomes >>> #, plot_perimeter had
blob for blobs, and plot_MER's comment said MEC.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Random, draw_circle and Tensor get a rubric heading.  draw_circle's code block was
indented under the wrong level, its loop lost the continuation prompts, and its
code and plot used numpy without importing it.  The code blocks of tensor and
TensorStack are indented under their directive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each example now ends with a plot of the eiffel-1.png image with its features
drawn on it.  SURF has none, because it is left out of standard OpenCV builds
and the docs build could not run it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…l shape

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…code goes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop repeated and empty Examples headings, unindent the second VideoFile
example, and remove extra blank lines after the ROSTopic.publish examples.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ept lines

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant