File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11from pathlib import Path
22from typing import Any , Dict , Optional
3+ from urllib .parse import urlencode
34
45from docutils .nodes import document
56from sphinx .application import Sphinx
@@ -118,10 +119,13 @@ def add_launch_buttons(
118119 )
119120
120121 if jupyterhub_url :
121- url = (
122- f"{ jupyterhub_url } /hub/user-redirect/git-pull?"
123- f"repo={ repo_url } &urlpath={ ui_pre } /{ repo } /{ path_rel_repo } &branch={ branch } "
122+ url_params = urlencode (
123+ dict (
124+ repo = repo_url , urlpath = f"{ ui_pre } /{ repo } /{ path_rel_repo } " , branch = branch
125+ ),
126+ safe = "/" ,
124127 )
128+ url = f"{ jupyterhub_url } /hub/user-redirect/git-pull?{ url_params } "
125129 launch_buttons_list .append (
126130 {
127131 "type" : "link" ,
Original file line number Diff line number Diff line change 2727 </ a >
2828 </ li >
2929 < li >
30- < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https: //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
30+ < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
3131 < span class ="headerbtn__icon-container ">
3232 < img src ="../_static/images/logo_jupyterhub.svg "/>
3333 </ span >
Original file line number Diff line number Diff line change 1616 </ a >
1717 </ li >
1818 < li >
19- < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https: //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
19+ < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
2020 < span class ="headerbtn__icon-container ">
2121 < img src ="../_static/images/logo_jupyterhub.svg "/>
2222 </ span >
Original file line number Diff line number Diff line change 1616 </ a >
1717 </ li >
1818 < li >
19- < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https: //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
19+ < a class ="headerbtn " data-placement ="left " data-toggle ="tooltip " href ="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A //github.com/executablebooks/sphinx-book-theme&urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&branch=master " title ="Launch on JupyterHub ">
2020 < span class ="headerbtn__icon-container ">
2121 < img src ="../_static/images/logo_jupyterhub.svg "/>
2222 </ span >
You can’t perform that action at this time.
0 commit comments