Skip to content

Commit 37fb1be

Browse files
authored
Update build_docs.py (#18)
Add required code url prefix argument
1 parent b47b039 commit 37fb1be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/build_docs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
"site_path", "/api/python", "Path prefix in the _toc.yaml"
120120
)
121121

122+
_CODE_URL_PREFIX = flags.DEFINE_string(
123+
'code_url_prefix", "https://github.com/google/generative-ai-python/blob/master/google/generativeai",
124+
"where to find the project code")
122125

123126
class MyFilter:
124127
def __init__(self, base_dirs):
@@ -183,7 +186,7 @@ def gen_api_docs():
183186
pathlib.Path(google.generativeai.__file__).parent,
184187
pathlib.Path(google.ai.generativelanguage.__file__).parent.parent,
185188
),
186-
code_url_prefix=('https://github.com/google/generative-ai-python/blob/master/google/generativeai',
189+
code_url_prefix=(_CODE_URL_PREFIX.value,
187190
'https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ai-generativelanguage/google/ai'),
188191
search_hints=_SEARCH_HINTS.value,
189192
site_path=_SITE_PATH.value,

0 commit comments

Comments
 (0)