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)
| 97 | |
| 98 | |
| 99 | def 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 | |
| 127 | def _get_raw_docstring(py_object): |
no test coverage detected