mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Refactored; Initialize imagedir at init() method
This commit is contained in:
parent
0853176305
commit
8c38327f0e
@ -44,10 +44,6 @@ class Builder(object):
|
||||
versioning_method = 'none'
|
||||
# allow parallel write_doc() calls
|
||||
allow_parallel = False
|
||||
# basename of images directory
|
||||
imagedir = ""
|
||||
# relative path to image directory from current docname (used at writing docs)
|
||||
imgpath = ""
|
||||
|
||||
def __init__(self, app):
|
||||
self.env = app.env
|
||||
@ -74,6 +70,10 @@ class Builder(object):
|
||||
|
||||
# images that need to be copied over (source -> dest)
|
||||
self.images = {}
|
||||
# basename of images directory
|
||||
imagedir = ""
|
||||
# relative path to image directory from current docname (used at writing docs)
|
||||
imgpath = ""
|
||||
|
||||
# these get set later
|
||||
self.parallel_ok = False
|
||||
|
@ -73,7 +73,6 @@ class StandaloneHTMLBuilder(Builder):
|
||||
link_suffix = '.html' # defaults to matching out_suffix
|
||||
indexer_format = js_index
|
||||
indexer_dumps_unicode = True
|
||||
imagedir = '_images'
|
||||
supported_image_types = ['image/svg+xml', 'image/png',
|
||||
'image/gif', 'image/jpeg']
|
||||
searchindex_filename = 'searchindex.js'
|
||||
@ -96,6 +95,8 @@ class StandaloneHTMLBuilder(Builder):
|
||||
# a hash of all config values that, if changed, cause a full rebuild
|
||||
self.config_hash = ''
|
||||
self.tags_hash = ''
|
||||
# basename of images directory
|
||||
self.imagedir = '_images'
|
||||
# section numbers for headings in the currently visited document
|
||||
self.secnumbers = {}
|
||||
# currently written docname
|
||||
@ -1030,6 +1031,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
|
||||
def init(self):
|
||||
self.config_hash = ''
|
||||
self.tags_hash = ''
|
||||
self.imagedir = '_images'
|
||||
self.theme = None # no theme necessary
|
||||
self.templates = None # no template bridge necessary
|
||||
self.init_translator_class()
|
||||
|
Loading…
Reference in New Issue
Block a user