Skip to content

Commit 47be943

Browse files
markmcdcopybara-github
authored andcommitted
Add support for a base_url flag in nblint
This will allow the tool to be used for non-TF.org sites. Written to support Py3.8, which IIUC is all we support right now. PiperOrigin-RevId: 534855223
1 parent 13e9340 commit 47be943

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/tensorflow_docs/tools/nblint/style/tensorflow.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ def button_website(args):
259259
if "r1" in rel_path.parts:
260260
return True # No website button for TF 1.x docs.
261261

262-
if str(docs_dir) == "site/zh-cn" or str(docs_dir) == "site/zh-tw":
262+
user_url = args["user"].get("base_url")
263+
if user_url:
264+
base_url = user_url
265+
elif str(docs_dir) == "site/zh-cn" or str(docs_dir) == "site/zh-tw":
263266
base_url = "https://tensorflow.google.cn/"
264267
else:
265268
base_url = "https://www.tensorflow.org/"

0 commit comments

Comments
 (0)