Comments (3)
I can reproduce this. It seems this is __builtin__.__doc__
somehow making its way in the output of the script rather than the module __doc__
, probably because of the way we exec the script.
Also I seem to remember that there was some code in the scikit-learn gen_rst.py to strip the module __doc__
from the script output since the reST docstring was already inside the html but I couldn't find it in sphinx-gallery.
from sphinx-gallery.
So this one is a bit tricky.
Now that we slice the script by blocks the docstring is just absent when running the script. So you get something from automatic generation.
I guess your use case is the reason for this
https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/gen_rst.py#L867-L872
Which was unclear and unnecessary to me when refactoring.
My quick fix would be to change
https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinxgallery/gen_rst.py#L478
into something like
example_globals = {'__doc__': ''}
I have not tested.
But this would be too specific to usecase
from sphinx-gallery.
+1 for globals trick
On 17 août 2015, at 15:44, Óscar Nájera [email protected] wrote:
So this one is a bit tricky.
Now that we slice the script by blocks the docstring is just absent when running the script. So you get something from automatic generation.
I guess your use case is the reason for this
https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/gen_rst.py#L867-L872
Which was unclear and unnecessary to me when refactoring.
My quick fix would be to change
https://github.com/sphinx-gallery/sphinx-gallery/blob/master/sphinxgallery/gen_rst.py#L478
into something likeexample_globals = {'doc': ''}
I have not tested.
But this would be too specific to usecase—
Reply to this email directly or view it on GitHub.
from sphinx-gallery.
Related Issues (20)
- "Broken" gallery examples should still link to the code HOT 2
- Add option to set thumbnails for expected failing examples HOT 2
- Define CSS variables when `html[data-theme]` does not exist HOT 6
- Doc: document testing HOT 4
- [Maint] Add HTML parsing library as a testing dependency HOT 2
- Online documentation not deployed HOT 1
- Thumbnail generation is not working for plotly plots HOT 1
- ENH: remove file calling mini-gallery from mini-gallery
- Support for async code
- Missing full stop in download note.
- FEA Integrate download links and binder/juputerlite buttons with `pydata-sphinx-theme` secondary sidebar HOT 2
- `minigallery` with multiple files: deduplicate and should not start new rows HOT 5
- How many sublevels are supported? HOT 10
- Sub-folder gallery TOC header missing in PST theme HOT 6
- Get access to comment-based configuration in the scraper HOT 3
- Scrapper for Sympy output HOT 6
- Ease running on just one file HOT 3
- Feature: Per-code-block options HOT 7
- Build error for epub HOT 5
- Allow configuration of sort orders in a way that does not mess with the sphinx cache HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-gallery.