File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,14 @@ function convert_qmd_to_ipynb(in_qmd_path::String, out_ipynb_path::String)
147147end
148148
149149function add_ipynb_link_to_html (html_path:: String , ipynb_path:: String )
150- PATH_PREFIX = get (ENV , " PATH_PREFIX" , " " )
151- COLAB_URL = " https://colab.research.google.com/github/TuringLang/docs/blob/gh-pages$PATH_PREFIX /$ipynb_path "
150+ # this would look like "getting-started.ipynb" and is used when downloading a notebook
152151 SUGGESTED_FILENAME = basename (dirname (ipynb_path)) * " .ipynb"
152+ # The Colab URL needs to look like
153+ # https://colab.research.google.com/github/TuringLang/docs/blob/gh-pages/path/to/notebook.ipynb
154+ # Because ipynb_path has `_site/` prefix, we need to strip that off.
155+ ipynb_path_no_site = replace (ipynb_path, r" ^_site/" => " " )
156+ PATH_PREFIX = get (ENV , " PATH_PREFIX" , " " )
157+ COLAB_URL = " https://colab.research.google.com/github/TuringLang/docs/blob/gh-pages$PATH_PREFIX /$ipynb_path_no_site "
153158 @info " adding link to ipynb notebook in $html_path ... with PATH_PREFIX='$PATH_PREFIX '"
154159 if ! isfile (html_path)
155160 @info " - HTML file $html_path does not exist; skipping"
You can’t perform that action at this time.
0 commit comments