|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 | # ============================================================================== |
15 | | -""" Modified from the tfdocs example api reference docs generation script. |
| 15 | +"""Modified from the tfdocs example api reference docs generation script. |
16 | 16 |
|
17 | 17 | This script generates API reference docs. |
18 | 18 |
|
|
37 | 37 |
|
38 | 38 | PROJECT_SHORT_NAME = 'tfaddons' |
39 | 39 | PROJECT_FULL_NAME = 'TensorFlow Addons' |
40 | | -CODE_URL_PREFIX = 'https://github.com/tensorflow/addons/tree/master/tensorflow_addons' |
41 | 40 |
|
42 | 41 | FLAGS = flags.FLAGS |
43 | 42 |
|
| 43 | +flags.DEFINE_string( |
| 44 | + 'git_branch', |
| 45 | + default='master', |
| 46 | + help='The name of the corresponding branch on github.') |
| 47 | + |
44 | 48 | flags.DEFINE_string( |
45 | 49 | 'output_dir', |
46 | | - default='/addons/docs/api_docs/python/', |
| 50 | + default='docs/api_docs/python/', |
47 | 51 | help='Where to write the resulting docs to.') |
48 | 52 |
|
49 | 53 |
|
50 | 54 | def main(argv): |
51 | 55 | if argv[1:]: |
52 | 56 | raise ValueError('Unrecognized arguments: {}'.format(argv[1:])) |
53 | 57 |
|
| 58 | + code_url_prefix = ('https://github.com/tensorflow/addons/tree/' |
| 59 | + '{git_branch}/tensorflow_addons'.format( |
| 60 | + git_branch=FLAGS.git_branch)) |
| 61 | + |
54 | 62 | doc_generator = generate_lib.DocGenerator( |
55 | 63 | root_title=PROJECT_FULL_NAME, |
56 | 64 | # Replace `tensorflow_docs` with your module, here. |
57 | 65 | py_modules=[(PROJECT_SHORT_NAME, tensorflow_addons)], |
58 | | - code_url_prefix=CODE_URL_PREFIX, |
| 66 | + code_url_prefix=code_url_prefix, |
59 | 67 | # This callback cleans up a lot of aliases caused by internal imports. |
60 | 68 | callbacks=[public_api.local_definitions_filter]) |
61 | 69 |
|
|
0 commit comments