Hi Robert.

Thanks for the advice about groups -- I apologize for not realizing that 
extension questions should actually go into sphinx-users.

To answer your question about why do I want to override a default builder; 
really, for two reasons:

- Because I want _nearly_ all the functionality in the HTML builder, but I 
want to make one tiny change, because of the way our local docs source 
works.

 

- Because we don't ever really want to build HTML stuff that does not use 
this tiny change, and our workflow scripts that do publishing of our docs 
know where the output for a build actually goes (into an "html" directory 
-- they would have to change if we had a different builder name; not a big 
change at all, but still, a change in the overall workflow).


It turns out that I do have access to the app's registry; it was my build 
environment that was using an older version of Sphinx despite the fact that 
I thought I had the newer one in the documentation chain's load path.

It turns out, if I just do this, it works (I understand that it's not 
exactly wanting to be *supported* this way; it's hackery):

class MyHtmlBuilder(StandaloneHtmlBuilder):
   name = 'html'

   # override get_doc_context
   def get_doc_context(self, docname, body, metatags):
       # local adjustments to the doc context for our own purposes

def setup(app):
   app.registry.builders['html'] = MyHtmlBuilder 

 



On Tuesday, 2 May 2017 11:13:13 UTC-4, Robert Lehmann wrote:
>
> 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? :-)
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to