[sphinx-dev to bcc] Hi Viktor,
This mailing list (sphinx-dev) is for the *development of* Sphinx, not so much for using/extending it. sphinx-users@ <https://groups.google.com/d/forum/sphinx-users> is the higher-traffic list where you have much higher chances of somebody from outside the core team replying. Looking at the blame view for application.py <https://github.com/sphinx-doc/sphinx/blame/master/sphinx/application.py>, it seems sphinx.Sphinx just recently <https://github.com/sphinx-doc/sphinx/commit/72f267c6ae27144b46a23725b6634cc35f03fb50> (9d ago) grew the registry attribute. Why do you have to override the default builder in the first place? Why not just add a new one? :-) Hope this helps, Robert On Tue, Apr 25, 2017 at 7:28 PM, Viktor Haag <viktor.h...@gmail.com> wrote: > Starting to look at updating to the upcoming Sphinx v1.6, and I have a > question about using a custom builder. > > We have a builder that is, effectively, a simple wrapper around the basic > HTML builder. It would be nice to have the ability to provide this custom > builder as an override to the built-in HTML builder. Is there a way in 1.6 > to allow one to overload a built-in builder? > > I can do this: > > class MyBuilder(StandaloneHtmlBuilder): > > name = 'mybuilder' > > ## the stuff I'm overriding on the standalone html builder > > > def setup(app): > > app.add_builder(MyBuilder) > > > > But I thought I could have done something like this, but Sphinx complains > that the app 'Sphinx' has no registry attribute (which seems odd to me): > > class MyBuilder(StandaloneHtmlBuilder): > > name = 'html' > > ## the stuff I'm overriding on the standalone html builder > > > def setup(app): > > app.registry.builder['html'] = MyBuilder > > > Is there a reasonable way to override a built-in builder that re-uses the > builder name, but uses the inheriting local class as the builder class? > (The reason I'd like to re-use the builder name is that the Makefile > support for sphinx understands the default builder names and makes > decisions about where to put the output directory and so on, based on the > builder name.) > > > -- > Viktor Haag > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sphinx-dev+unsubscr...@googlegroups.com. > 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.