Sphinx-2.1.0 released

64 views
Skip to first unread message

Komiya Takeshi

unread,
Jun 2, 2019, 8:29:44 AM6/2/19
to sphinx...@googlegroups.com, sphin...@googlegroups.com, python-ann...@python.org
Hi all,

I'm delighted to announce the release of Sphinx 2.1.0 final, now available on
the Python package index at <https://pypi.org/project/Sphinx/>.

It includes about 25 new features, 21 bug fixes and 5 incompatible
changes. Especially, autodoc and autosummary are much improved.

For the full changelog, go to
<http://www.sphinx-doc.org/en/master/changes.html>.
Thanks to all collaborators and contributers!

What is it?
===========

Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of
multiple reStructuredText source files).

Website: http://sphinx-doc.org/
IRC: #sphinx-doc on irc.freenode.net

Enjoy!

Takeshi KOMIYA: i.tk...@gmail.com
`patreon <https://www.patreon.com/tk0miya>`_

Vinay Sajip

unread,
Jun 2, 2019, 3:27:52 PM6/2/19
to sphinx-users
Thank you for this release. I wondered about this incompatible change:

"Sphinx.add_lexer() now takes a Lexer class instead of instance. An instance of lexers are still supported until Sphinx-3.x."

What's the rationale for taking a class rather than an instance? It seems that one might have a lexer class with options and one might want to instantiate it with specific options before handing it to Sphinx. From 3.0, that would not be possible and you would need to create a subclass which embodies the specific options you want. Or have I misunderstood what you are saying?

Regards,

Vinay Sajip

Komiya Takeshi

unread,
Jun 3, 2019, 12:40:49 PM6/3/19
to sphinx...@googlegroups.com
Hi,

Thank you for comment.

> What's the rationale for taking a class rather than an instance?

Since 2.1, we added `:force:` option to some directives for
code-blocks. As a result, we need to control the option of lexers for
each code-block.
It is hard to control for already instantiated lexers. So they don't
use the option.
This is why I need the not instantiated lexers.

Note: I though the support will be dropped since 4.0, not 3.0. (Is my
English in changes correct?)

>It seems that one might have a lexer class with options and one might want to instantiate it with specific options before handing it to Sphinx.

Could you let me know what option do you pass to lexers? I will
reconsider how to incorporate it to sphinx-core.

Thanks,
Takeshi KOMIYA

Jeff McKenna

unread,
Jun 15, 2019, 4:31:41 PM6/15/19
to sphinx...@googlegroups.com
In our case, we extend the lexers dictionary (this has worked since around 2008) such as:

  def setup(app):
      from sphinx.highlighting import lexers
      lexers['myalias'] = MyLexer()

which since the 2.1.0 release causes these warnings and doesn't trigger the highlighting:

  WARNING: Could not lex literal_block as "myalias".  Highlighting skipped.


-jeff




--
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...@googlegroups.com.
To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFmkQAP0czmSD2UNM6P50--jSHtYbujgh%2BK%2BcPfN%2BDQd4ZmpKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Komiya Takeshi

unread,
Jun 15, 2019, 10:44:34 PM6/15/19
to sphinx...@googlegroups.com
Hi jeff,

Thank you for letting me know. That is not intentional change. Could
you file an issue to github please?
I'll fix it soon.


FYI: We've provided `app.add_lexer()` API since v0.6. It would be
better to use it on install a lexer.

Thank,
Takeshi KOMIYA

2019年6月16日(日) 5:31 Jeff McKenna <jeffm...@gmail.com>:
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAPGmwqD%2BkiSbem6yGBaqb6VDTwwnSU%3DR6sP4Ub3sZAkaZ2LJwQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages