On Wednesday, 11 February 2015 23:48:12 UTC-4, Steven Silvester wrote:
>
> Enrico,
>
> I updated the Pull Request to allow the triggering of docstrings at the 
> module level.  They must include triple quotes to be rendered.
> I looked at how to handle images, but I don't see how it is possible with 
> the current way the rst->html conversion works,
>

If one includes the rst directive:

.. image:: filename

in the docstring, it does appear as though an image would be inserted there 
(based on the display in the object inspector).  However it does not seem 
to work as I get a fake image with a question mark appearing.  This suggest 
that the required code for handling images in docstrings and have them 
visible in the object inspector is partly there.

André

 

> see 
> https://bitbucket.org/spyder-ide/spyderlib/src/3962fb711df42f317a0187d046445e78908826d0/spyderlib/utils/inspector/sphinxify.py?at=default#cl-139
> .
>
>
> Regards,
>
> Steve
>
> On Tuesday, February 10, 2015 at 6:22:11 PM UTC-6, Enrico Giampieri wrote:
>>
>> Hello everyone,
>>
>> I started using again spyder after a long interval of using the ipython 
>> notebook, and I found that the improvement are incredible since the last 
>> time I used it.
>> The cell block feature (not sure if it is new or I simply didn't noticed 
>> it at first) is especially nice, and is one of the things that persuaded me 
>> to insert spyder again in my workflow.
>>
>> The only thing that I find missing is the possibility of the object 
>> inspector to understand that a string can be a docstring even outside the 
>> definition of a class or a function.
>> A prime example is the documentation of modules, that right now is not 
>> visualized correctly (or at least I didn't found how to visualize it 
>> properly).
>>
>> One thought lead to another, and I started wondering how hard would it be 
>> for the object inspector to understand a docstring for each cell block.
>> That would allow to express the comments for each code in a very 
>> expressive way, that could compete with the expressivity of an ipython 
>> notebook,
>> while maintaining a normal plain format (the friction of doing version 
>> control with a notebook is what lead me to try again spyder in the first 
>> place).
>>
>> In short, given a code as:
>>
>> #%%
>> """
>> some very cool docstring in here
>> """
>>
>> myvariable = 42
>>
>>
>>
>>
>> the object inspector could recognize the block documentation as valid and 
>> show it properly.
>> Would it be possible to include also images? in the restructured text is 
>> formally possible, but I couldn't manage to do it,
>> and I'm not sure if it's a limit of the inspector or of my ability.
>>
>> I tried to take a look at the inspector to understand what was going on 
>> and implement it myself, but I got lost and gave up...
>>
>> thank you very much for your work, I hope to be able to contribute soon 
>> with something!
>> Enrico
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to