Add zuul-sphinx as a requirement
This renames the internal sphinx domain from zuul to zuuldoc. This is a temporary measure to avoid colliding with the domain defined in zuul-sphinx (because of the initial data required, it's not easy for us to simply add new directives/roles without at least porting *some* of the framework into zuul-sphinx). I expect to do that when this has stabilized. Change-Id: I26be542a6d4f6266f7843ada5939172656b8b847 Depends-On: I8a1534f7c2614ee11411cf228de38931257fc970
This commit is contained in:
parent
7f98f3132c
commit
bbaf222aa4
@ -30,13 +30,14 @@ extensions = [
|
||||
'sphinx.ext.graphviz',
|
||||
'sphinxcontrib.blockdiag',
|
||||
'sphinxcontrib.programoutput',
|
||||
'zuul_sphinx',
|
||||
'zuul.sphinx.ansible',
|
||||
'zuul.sphinx.zuul',
|
||||
]
|
||||
#extensions = ['sphinx.ext.intersphinx']
|
||||
#intersphinx_mapping = {'python': ('http://docs.python.org/2.7', None)}
|
||||
|
||||
primary_domain = 'zuul'
|
||||
primary_domain = 'zuuldoc'
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
@ -14,3 +14,4 @@ sphinxcontrib-programoutput
|
||||
mock
|
||||
PyMySQL
|
||||
mypy
|
||||
zuul-sphinx
|
||||
|
@ -29,10 +29,10 @@ class ZuulConfigObject(ObjectDescription):
|
||||
}
|
||||
|
||||
def get_path(self):
|
||||
return self.env.ref_context.get('zuul:attr_path', [])
|
||||
return self.env.ref_context.get('zuuldoc:attr_path', [])
|
||||
|
||||
def get_display_path(self):
|
||||
return self.env.ref_context.get('zuul:display_attr_path', [])
|
||||
return self.env.ref_context.get('zuuldoc:display_attr_path', [])
|
||||
|
||||
@property
|
||||
def parent_pathname(self):
|
||||
@ -50,7 +50,7 @@ class ZuulConfigObject(ObjectDescription):
|
||||
signode['ids'].append(targetname)
|
||||
signode['first'] = (not self.names)
|
||||
self.state.document.note_explicit_target(signode)
|
||||
objects = self.env.domaindata['zuul']['objects']
|
||||
objects = self.env.domaindata['zuuldoc']['objects']
|
||||
if targetname in objects:
|
||||
self.state_machine.reporter.warning(
|
||||
'duplicate object description of %s, ' % targetname +
|
||||
@ -80,16 +80,16 @@ class ZuulAttrDirective(ZuulConfigObject):
|
||||
}
|
||||
|
||||
def before_content(self):
|
||||
path = self.env.ref_context.setdefault('zuul:attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:attr_path', [])
|
||||
path.append(self.names[-1])
|
||||
path = self.env.ref_context.setdefault('zuul:display_attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:display_attr_path', [])
|
||||
path.append(self.names[-1])
|
||||
|
||||
def after_content(self):
|
||||
path = self.env.ref_context.get('zuul:attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
path = self.env.ref_context.get('zuul:display_attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:display_attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
|
||||
@ -141,18 +141,18 @@ class ZuulVarDirective(ZuulConfigObject):
|
||||
return ''
|
||||
|
||||
def before_content(self):
|
||||
path = self.env.ref_context.setdefault('zuul:attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:attr_path', [])
|
||||
element = self.names[-1]
|
||||
path.append(element)
|
||||
path = self.env.ref_context.setdefault('zuul:display_attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:display_attr_path', [])
|
||||
element = self.names[-1] + self.get_type_str()
|
||||
path.append(element)
|
||||
|
||||
def after_content(self):
|
||||
path = self.env.ref_context.get('zuul:attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
path = self.env.ref_context.get('zuul:display_attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:display_attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
|
||||
@ -176,18 +176,18 @@ class ZuulStatDirective(ZuulConfigObject):
|
||||
}
|
||||
|
||||
def before_content(self):
|
||||
path = self.env.ref_context.setdefault('zuul:attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:attr_path', [])
|
||||
element = self.names[-1]
|
||||
path.append(element)
|
||||
path = self.env.ref_context.setdefault('zuul:display_attr_path', [])
|
||||
path = self.env.ref_context.setdefault('zuuldoc:display_attr_path', [])
|
||||
element = self.names[-1]
|
||||
path.append(element)
|
||||
|
||||
def after_content(self):
|
||||
path = self.env.ref_context.get('zuul:attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
path = self.env.ref_context.get('zuul:display_attr_path')
|
||||
path = self.env.ref_context.get('zuuldoc:display_attr_path')
|
||||
if path:
|
||||
path.pop()
|
||||
|
||||
@ -216,7 +216,7 @@ class ZuulAbbreviatedXRefRole(XRefRole):
|
||||
|
||||
|
||||
class ZuulDomain(Domain):
|
||||
name = 'zuul'
|
||||
name = 'zuuldoc'
|
||||
label = 'Zuul'
|
||||
|
||||
directives = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user