Code Monkey home page Code Monkey logo

Comments (3)

lesteve avatar lesteve commented on June 12, 2024

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.

Titan-C avatar Titan-C commented on June 12, 2024

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.

agramfort avatar agramfort commented on June 12, 2024

+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 like

example_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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.