Skip to content

Commit ca2035c

Browse files
MarkDaoustcopybara-github
authored andcommitted
Move ReferenceResolver out of parser.py
Pure refactor, no behavior changes. PiperOrigin-RevId: 419644893
1 parent 96a0845 commit ca2035c

File tree

8 files changed

+655
-585
lines changed

8 files changed

+655
-585
lines changed

tools/tensorflow_docs/api_generator/generate_lib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from tensorflow_docs.api_generator import parser
3232
from tensorflow_docs.api_generator import pretty_docs
3333
from tensorflow_docs.api_generator import public_api
34+
from tensorflow_docs.api_generator import reference_resolver as reference_resolver_lib
3435
from tensorflow_docs.api_generator import signature
3536
from tensorflow_docs.api_generator import traverse
3637
from tensorflow_docs.api_generator.report import utils
@@ -804,7 +805,7 @@ def __init__(
804805
self._extra_docs = extra_docs
805806

806807
def make_reference_resolver(self, visitor):
807-
return parser.ReferenceResolver.from_visitor(
808+
return reference_resolver_lib.ReferenceResolver.from_visitor(
808809
visitor, py_module_names=[self._short_name])
809810

810811
def make_parser_config(self, visitor, reference_resolver):

tools/tensorflow_docs/api_generator/generate_lib_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from tensorflow_docs.api_generator import doc_controls
2929
from tensorflow_docs.api_generator import generate_lib
3030
from tensorflow_docs.api_generator import parser
31+
from tensorflow_docs.api_generator import reference_resolver as reference_resolver_lib
3132

3233
import yaml
3334

@@ -115,7 +116,7 @@ def get_test_objects(self):
115116

116117
visitor = DummyVisitor(index, duplicate_of)
117118

118-
reference_resolver = parser.ReferenceResolver.from_visitor(
119+
reference_resolver = reference_resolver_lib.ReferenceResolver.from_visitor(
119120
visitor=visitor, py_module_names=['tf'], link_prefix='api_docs/python')
120121

121122
parser_config = config.ParserConfig(

0 commit comments

Comments
 (0)