# HG changeset patch
# User Will Maier <[email protected]>
# Date 1231506558 21600
# Node ID 85f7c25d934573cc8f36fc5d86782dedfc34acc6
# Parent 9aa614aa95b5ae0d9f577cc9d880f9d2b6bb9abd
Provide StandaloneHTMLBuilder.get_outfilename().
This will allow subclasses to do handy things like compile foo.rst ->
foo/index.html (see sphinx.ext.prettyhtml.
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -452,6 +452,9 @@
if self.indexer is not None and title:
self.indexer.feed(pagename, title, doctree)
+ def get_outfilename(self, pagename):
+ return path.join(self.outdir, os_path(pagename) + self.out_suffix)
+
# --------- these are overwritten by the serialization builder
def get_target_uri(self, docname, typ=None):
@@ -477,7 +480,7 @@
output = self.templates.render(templatename, ctx)
if not outfilename:
- outfilename = path.join(self.outdir, os_path(pagename) +
self.out_suffix)
+ outfilename = self.get_outfilename(pagename)
ensuredir(path.dirname(outfilename)) # normally different from
self.outdir
try:
f = codecs.open(outfilename, 'w', 'utf-8')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---