MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / documentation_path

Function documentation_path

tensorflow/tools/docs/parser.py:99–124  ·  view source on GitHub ↗

Returns the file path for the documentation for the given API symbol. Given the fully qualified name of a library symbol, compute the path to which to write the documentation for that symbol (relative to a base directory). Documentation files are organized into directories that mirror the pyt

(full_name, is_fragment=False)

Source from the content-addressed store, hash-verified

97
98
99def documentation_path(full_name, is_fragment=False):
100 """Returns the file path for the documentation for the given API symbol.
101
102 Given the fully qualified name of a library symbol, compute the path to which
103 to write the documentation for that symbol (relative to a base directory).
104 Documentation files are organized into directories that mirror the python
105 module/class structure.
106
107 Args:
108 full_name: Fully qualified name of a library symbol.
109 is_fragment: If `False` produce a direct markdown link (`tf.a.b.c` -->
110 `tf/a/b/c.md`). If `True` produce fragment link, `tf.a.b.c` -->
111 `tf/a/b.md#c`
112 Returns:
113 The file path to which to write the documentation for `full_name`.
114 """
115 parts = full_name.split('.')
116 if is_fragment:
117 parts, fragment = parts[:-1], parts[-1]
118
119 result = os.path.join(*parts) + '.md'
120
121 if is_fragment:
122 result = result + '#' + fragment
123
124 return result
125
126
127def _get_raw_docstring(py_object):

Callers 4

reference_to_urlMethod · 0.85
docs_for_objectFunction · 0.85

Calls 2

splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected