Merge "Docs: change default title for value xref" into feature/zuulv3

This commit is contained in:
Jenkins 2017-08-04 23:17:07 +00:00 committed by Gerrit Code Review
commit 0fb72dce11
1 changed files with 14 additions and 2 deletions

View File

@ -204,6 +204,17 @@ class ZuulStatDirective(ZuulConfigObject):
return sig
class ZuulAbbreviatedXRefRole(XRefRole):
def process_link(self, env, refnode, has_explicit_title, title,
target):
title, target = super(ZuulAbbreviatedXRefRole, self).process_link(
env, refnode, has_explicit_title, title, target)
if not has_explicit_title:
title = title.split('.')[-1]
return title, target
class ZuulDomain(Domain):
name = 'zuul'
label = 'Zuul'
@ -218,8 +229,9 @@ class ZuulDomain(Domain):
roles = {
'attr': XRefRole(innernodeclass=nodes.inline, # type: ignore
warn_dangling=True),
'value': XRefRole(innernodeclass=nodes.inline, # type: ignore
warn_dangling=True),
'value': ZuulAbbreviatedXRefRole(
innernodeclass=nodes.inline, # type: ignore
warn_dangling=True),
'var': XRefRole(innernodeclass=nodes.inline, # type: ignore
warn_dangling=True),
'stat': XRefRole(innernodeclass=nodes.inline, # type: ignore