question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to link the gallery

See original GitHub issue

Hello. I’m fairly new to sphinx-gallery and sphinx in general, and here is my problem.

I created a plot_example.py script and placed it in my examples_dirs folder. As a result, I do see it copied in the gallery_dirs folder, that is, I get the file auto_examples/plot_example.py. Then, to include a link to the gallery in my main documentation page (index.rst), I have the line :doc:`Gallery <auto_examples/index>` However, when building the doc, I get: WARNING: undefined label: sphx_glr_auto_examples_plot_example.py (if the link has no caption the label must precede a section header) and indeed the link to this example is broken. What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Titan-Ccommented, May 29, 2018

Exactly what I imagined. In your example plot_example.py when you write the docstring you need to make the title a heading. Using rst syntax is just underlining it with something. That solves the problem.

 Circle plot.
+============
 
 Uses a function to plot a circle.

Now, I wonder why no exception is raised in this case.

0reactions
GkAntoniuscommented, May 29, 2018

That’s it! Thank you Titan-C. Looking back at the sphinx-gallery documentation, the instructions were unequivocal:

The structure follows a leading docstring that must follow reStructuredText syntax and a header. Then the executable code of your script.

Yet, an example would have been helpful for sphinx newbies. Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wix Pro Gallery: Adding a Link to a Gallery Item | Help Center
First, add a link to the gallery item. Then you can choose to set your gallery items to open a link when clicked....
Read more >
How to Add Custom Links to Gallery Images in ... - WPBeginner
Simply go to a post or page and create a new gallery. You will see the custom link meta fields for individual images...
Read more >
Share photos & videos - Android - Google Photos Help
Send a link or share to other apps · On your mobile device, open the Google Photos app Photos . · Select a...
Read more >
How Do I Link a Gallery to a Page in Squarespace?
You can add a gallery to a page, but the only way to link to it is by using the gallery's URL. This...
Read more >
How to Add Custom Hyperlinks to Your WordPress Gallery ...
Adding Custom Links to Individual Images · Select an image from your gallery · Enter the custom Link URL from the Attachment Details...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found