Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #31 from yannanwang1/master
Browse files Browse the repository at this point in the history
Fix Bug #1001850: Link UserMinibatchSource not clickable
  • Loading branch information
bianliu1013 committed May 27, 2017
2 parents 45dd526 + c48abe3 commit 6ec9151
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docfx_yaml/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class bcolors:
CLASS = 'class'
EXCEPTION = 'exception'
ATTRIBUTE = 'attribute'
REFMETHOD = 'meth'
REFFUNCTION = 'func'


def build_init(app):
Expand Down Expand Up @@ -467,10 +469,24 @@ def find_node_in_toc_tree(toc_yaml, to_add_node):
def missing_reference(app, env, node, contnode):
reftarget = ''
refdoc = ''
reftype = ''
module = ''
if 'refdomain' in node.attributes and node.attributes['refdomain'] == 'py':
reftarget = node['reftarget']
reftype = node['reftype']
if 'refdoc' in node:
refdoc = node['refdoc']
if 'py:module' in node:
module = node['py:module']

#Refactor reftarget to fullname if it is a short name
if reftype in [CLASS, REFFUNCTION, REFMETHOD] and not reftarget.startswith(module.split('.')[0]):
if reftype in [CLASS, REFFUNCTION]:
fields = (module, reftarget)
else:
fields = (module, node['py:class'], reftarget)
reftarget = '.'.join(fields)

return make_refnode(app.builder, refdoc, reftarget, '', contnode)


Expand Down

0 comments on commit 6ec9151

Please sign in to comment.