|
|
|
@ -462,10 +462,9 @@ function execute_notebook(nb) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function fixlinks(content; branch = "gh-pages", commit = "master") |
|
|
|
function fixlinks(content; branch = "gh-pages", commit = "master") |
|
|
|
if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true" |
|
|
|
travis_repo_slug = get(ENV, "TRAVIS_REPO_SLUG", "TRAVIS_REPO_SLUG") |
|
|
|
travis_repo_slug = get(ENV, "TRAVIS_REPO_SLUG", "") |
|
|
|
|
|
|
|
# use same logic as Documenter to figure out the deploy folder |
|
|
|
# use same logic as Documenter to figure out the deploy folder |
|
|
|
travis_tag = get(ENV, "TRAVIS_TAG", "") |
|
|
|
travis_tag = get(ENV, "TRAVIS_TAG", "TRAVIS_TAG") |
|
|
|
if isempty(travis_tag) |
|
|
|
if isempty(travis_tag) |
|
|
|
folder = "latest" |
|
|
|
folder = "latest" |
|
|
|
else |
|
|
|
else |
|
|
|
@ -479,8 +478,9 @@ function fixlinks(content; branch = "gh-pages", commit = "master") |
|
|
|
# replace @__NBVIEWER_ROOT_URL__ to latest or version directory |
|
|
|
# replace @__NBVIEWER_ROOT_URL__ to latest or version directory |
|
|
|
nbviewer_root_url = "https://nbviewer.jupyter.org/github/$(travis_repo_slug)/blob/$(branch)/$(folder)/" |
|
|
|
nbviewer_root_url = "https://nbviewer.jupyter.org/github/$(travis_repo_slug)/blob/$(branch)/$(folder)/" |
|
|
|
content = replace(content, "@__NBVIEWER_ROOT_URL__" => nbviewer_root_url) |
|
|
|
content = replace(content, "@__NBVIEWER_ROOT_URL__" => nbviewer_root_url) |
|
|
|
else |
|
|
|
|
|
|
|
@info "not running on Travis, skipping link-fix." |
|
|
|
if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") != "true" |
|
|
|
|
|
|
|
@info "not running on Travis, skipping links will not be correct." |
|
|
|
end |
|
|
|
end |
|
|
|
return content |
|
|
|
return content |
|
|
|
end |
|
|
|
end |
|
|
|
|