Re: [sphinx-users] How to use type annotation as return type for property on a class with Napolean

2018-08-21 Thread Komiya Takeshi
Hi,

AFAIK, napoleon extension does not support type annotations.
I agree it is much useful!

Thanks,
Takeshi KOMIYA

2018年8月19日(日) 7:06 Clint Valentine :

> I have the following property:
>
> ```
> def Something(object):
>
> @property
> def experimental_design(self) -> Any:
> """Return a markdown summary of the samples on this sample sheet.
>
> This property supports displaying rendered markdown only when
> running
> within an IPython interpreter. If we are not running in an IPython
> interpreter, then print out a nicely formatted ASCII table.
>
> Returns:
> markdown: A visual table of IDs and names for all samples.
>
> """
> if not self.samples:
> raise ValueError('No samples in sample sheet')
>
> markdown = tabulate(
> [[getattr(s, h, '') for h in DESIGN_HEADER] for s in
> self.samples],
> headers=DESIGN_HEADER,
> tablefmt='pipe',
> )
>
> return maybe_render_markdown(markdown)
> ```
>
> When I set `napoleon_use_rtype` to `False` I get the following:
>
> [image: 1.png]
>
> When I set `napoleon_use_rtype` to `True` I get the following:
>
> [image: 2.png]
>
>
>
> What I *really* want is for Sphinx to recognize the return type of `Any`
> and list that as the type. This works well for functions:
>
>
> ```
>
> def add_section(self, section_name: str) -> None:
>
> """Add a section to the :class:`SampleSheet`."""
>
> section_name = self._whitespace_re.sub('_', section_name)
>
> self._sections.append(section_name)
>
> setattr(self, section_name, Section())
>
> ```
>
>
> Rendering as:
>
>
> [image: 3.png]
>
>
> Anyone know a way to help? Are return types on properties from type
> annotations supported or am I required to just use plaintext in the
> docstring?
>
>
> If you want to explore my configuration I have the project here:
>
>
> https://github.com/clintval/sample-sheet
>
>
> With docs here:
>
>
> https://sample-sheet.readthedocs.io/
>
>
>
> Thanks!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sphinx-users+unsubscr...@googlegroups.com.
> To post to this group, send email to sphinx-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] 2 questions

2018-08-21 Thread Komiya Takeshi
> 1. I was told that the built-in search indexes the source files, which means 
> search results often include RST markup. Is this still true?

Yes. At present, we are using source files to show search result.

Note: we have plan to fix it. It might be implemented in 2.0:
https://github.com/sphinx-doc/sphinx/issues/1618

> 2.  I was told that it's not possible with ReStructured Text markup to 
> include links in code listings. Is this true?

You can do it with parsed-literal directive. Please take a look for
the document of docutils.
(Unfortunately I can't tell you the URL because it is under maintenance now...)

Thanks,
Takeshi KOMIYA

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Headings don't translate properly with recommonmark and Sphinx >=1.5.2

2018-08-21 Thread Komiya Takeshi
As I commented to the commit, this should be fixed on recommonmark side.
As a workaround, I made a simple code. Please check it.

Thanks,
Takeshi KOMIYA
2018年8月21日(火) 23:21 lei hu :
>
> An example using recommonmark's own docs:
>
> git clone 'g...@github.com:rtfd/recommonmark.git'
> python setup.py develop
> cd docs
>
> pip install Sphinx==1.5.1
> make gettext
> cat _build/locale/index.pot | grep 'Getting Started'
> # output is `msgid "Getting Started"`, as expected
>
> rm -r _build
> pip install Sphinx==1.5.2
> make gettext
> cat _build/locale/index.pot | grep 'Getting Started'
> # no output!
>
> rm -r _build
> pip install Sphinx==1.6.2
> make gettext
> cat _build/locale/index.pot | grep 'Getting Started'
> # no output!
>
> Running a git bisect suggests this commit is to blame:  
> sphinx-doc/sphinx@4d6d8ae
>
>
> The question seems to be related to docutils. Is there any way to repair the 
> translation?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sphinx-users+unsubscr...@googlegroups.com.
> To post to this group, send email to sphinx-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Sphinx-1.8.0b1 released.

2018-08-21 Thread Komiya Takeshi
Hi Jan,

It seems debian does not provide the xidny package for stretch.
But it is provided for wheezy, buster and sid.
https://packages.debian.org/buster/xindy

I don't know why it was dropped temporarily.

Note: You can disable it with latex_use_xindy = False.
It is only used to create index for the combination of multibyte
languages and xelatex or lualatex.

Thanks,
Takeshi KOMIYA

2018年8月21日(火) 23:21 Jan Ulrich Hasecke :
>
> Hi all,
>
> while 1.8.0b1 runs some of my projects without problems I cannot build a
> pdf because xindy is missing on debian stretch.
>
> Does anyone know how to install xindy on debian stretch?
>
> juh
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sphinx-users+unsubscr...@googlegroups.com.
> To post to this group, send email to sphinx-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


[sphinx-users] Headings don't translate properly with recommonmark and Sphinx >=1.5.2

2018-08-21 Thread lei hu


An example using recommonmark's own docs:

git clone 'g...@github.com:rtfd/recommonmark.git'
python setup.py develop
cd docs

pip install Sphinx==1.5.1
make gettext
cat _build/locale/index.pot | grep 'Getting Started'
# output is `msgid "Getting Started"`, as expected

rm -r _build
pip install Sphinx==1.5.2
make gettext
cat _build/locale/index.pot | grep 'Getting Started'
# no output!

rm -r _build
pip install Sphinx==1.6.2
make gettext
cat _build/locale/index.pot | grep 'Getting Started'
# no output!

Running a git bisect suggests this commit is to blame:  
sphinx-doc/sphinx@4d6d8ae 



The question seems to be related to docutils. Is there any way to repair 
the translation?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Sphinx-1.8.0b1 released.

2018-08-21 Thread Jan Ulrich Hasecke
Hi all,

while 1.8.0b1 runs some of my projects without problems I cannot build a
pdf because xindy is missing on debian stretch.

Does anyone know how to install xindy on debian stretch?

juh

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Sphinx-1.8.0b1 released.

2018-08-21 Thread Luc Saffre
Maybe not intended, but it is correct behaviour. My code was "wrong"
because it started a parser without giving a source.
Yes, the code of the graphviz extension could check wether
current_source is given before accessing it, that would make it more
fool-proof.
Luc

On 21/08/18 15:57, Komiya Takeshi wrote:
> Hi Luc,
>
> Thank you for very detailed report!
> About state.document.current_source is not intended change. So I'll
> check it later.
>
> Thanks,
> 2018年8月21日(火) 17:23 Luc Saffre :
>> I ran the new version on all my projects without problems (except some 
>> changes in my own code, details in my blog).
>> Thanks for your  work on maintaining Sphinx!
>> Luc
>>
>> On 20/08/18 19:36, Komiya Takeshi wrote:
>>
>> Hi all,
>>
>> We just released 1.8.0b1.
>> It includes much of improvements. And we believe it will help you.
>>
>> In detail, please see CHANGES:
>> https://github.com/sphinx-doc/sphinx/blob/1.8.0b1/CHANGES
>>
>> You can use it with: pip install --pre Sphinx
>>
>> Since this is a beta release, we expect that you may encounter bugs.
>> If you find a bug, please report it on github issues:
>> https://github.com/sphinx-doc/sphinx/issues
>>
>> Thanks,
>> Takeshi KOMIYA
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Sphinx-1.8.0b1 released.

2018-08-21 Thread Komiya Takeshi
Hi Luc,

Thank you for very detailed report!
About state.document.current_source is not intended change. So I'll
check it later.

Thanks,
2018年8月21日(火) 17:23 Luc Saffre :
>
> I ran the new version on all my projects without problems (except some 
> changes in my own code, details in my blog).
> Thanks for your  work on maintaining Sphinx!
> Luc
>
> On 20/08/18 19:36, Komiya Takeshi wrote:
>
> Hi all,
>
> We just released 1.8.0b1.
> It includes much of improvements. And we believe it will help you.
>
> In detail, please see CHANGES:
> https://github.com/sphinx-doc/sphinx/blob/1.8.0b1/CHANGES
>
> You can use it with: pip install --pre Sphinx
>
> Since this is a beta release, we expect that you may encounter bugs.
> If you find a bug, please report it on github issues:
> https://github.com/sphinx-doc/sphinx/issues
>
> Thanks,
> Takeshi KOMIYA
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


[sphinx-users] Re: Sphinx-1.8.0b1 released.

2018-08-21 Thread jfbu

Le 21/08/2018 à 10:23, Luc Saffre a écrit :

I ran the new version on all my projects without problems (except some changes in my 
own code, details in my blog 
).
Thanks for your  work on maintaining Sphinx!
Luc



Thanks Luc,

correcting the link from Takeshi KOMIYA's announcement:

https://github.com/sphinx-doc/sphinx/blob/v1.8.0b1/CHANGES

Best,

Jean-François


On 20/08/18 19:36, Komiya Takeshi wrote:

Hi all,

We just released 1.8.0b1.
It includes much of improvements. And we believe it will help you.

In detail, please see CHANGES:
https://github.com/sphinx-doc/sphinx/blob/1.8.0b1/CHANGES

You can use it with: pip install --pre Sphinx

Since this is a beta release, we expect that you may encounter bugs.
If you find a bug, please report it on github issues:
https://github.com/sphinx-doc/sphinx/issues

Thanks,
Takeshi KOMIYA



--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 
sphinx-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to sphinx-users@googlegroups.com 
.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.


Re: [sphinx-users] Sphinx-1.8.0b1 released.

2018-08-21 Thread Luc Saffre
I ran the new version on all my projects without problems (except some
changes in my own code, details in my blog
).
Thanks for your  work on maintaining Sphinx!
Luc

On 20/08/18 19:36, Komiya Takeshi wrote:
> Hi all,
>
> We just released 1.8.0b1.
> It includes much of improvements. And we believe it will help you.
>
> In detail, please see CHANGES:
> https://github.com/sphinx-doc/sphinx/blob/1.8.0b1/CHANGES
>
> You can use it with: pip install --pre Sphinx
>
> Since this is a beta release, we expect that you may encounter bugs.
> If you find a bug, please report it on github issues:
> https://github.com/sphinx-doc/sphinx/issues
>
> Thanks,
> Takeshi KOMIYA
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.