Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Add versions and use pydata theme #173

Merged
merged 18 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Get TAG
run: echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV

- name: Get DOC_DIR
run: |
DOC_DIR="$(cut -d '.' -f 1,2 <<< "$TAG")"
echo "DOC_DIR=${DOC_DIR:1}".x >> $GITHUB_ENV
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't figure out how to make this a one liner, suggestions welcome. Works as is and outputs e.g., "0.1.x"


- name: Set up Qt
uses: tlambert03/setup-qt-libs@v1

Expand Down Expand Up @@ -49,11 +57,22 @@ jobs:
working-directory: doc
run: make html

- name: Deploy docs 🚀
- name: Deploy dev docs 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: doc/_build/html
target-folder: dev
clean: true

- name: Deploy stable docs 🚀
uses: JamesIves/[email protected]
if: startsWith(env.TAG, 'v')
with:
branch: gh-pages
folder: doc/_build/html
target-folder: ${{ env.DOC_DIR }}
clean: true

- name: Cache
uses: actions/cache@v2
Expand Down
34 changes: 34 additions & 0 deletions doc/_static/version_switcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"version": "0.1.x",
"url": "https://jni.github.io/skan/0.1.x"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how the url's work so not sure if this works, pydata docs didn't expand. @jni can you explain..?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably can replace this with skeleton-analysis.org instead of jni.github.io/skan. But I think both will work, because jni.github.io/skan/whatever.html automatically resolves to skeleton-analysis.org/whatever.html. In fact what you've got is probably the optimum choice because it'll be stable even if the domain lapses.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each of these we need to go back and build the old docs though, and the early versions are pointless. I would say let's go back to 0.7.x and no more, as that is the version matching the paper.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept jni.github.io/skan because that is what is used everywhere else in the config file. So keep as is then?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup!

},
{
"version": "0.3.x",
"url": "https://jni.github.io/skan/0.3.x"
},
{
"version": "0.5.x",
"url": "https://jni.github.io/skan/0.5.x"
},
{
"version": "0.6.x",
"url": "https://jni.github.io/skan/0.6.x"
},
{
"version": "0.7.x",
"url": "https://jni.github.io/skan/0.7.x"
},
{
"version": "0.8.x",
"url": "https://jni.github.io/skan/0.8.x"
},
{
"version": "0.9.x",
"url": "https://jni.github.io/skan/0.9.x"
},
{
"version": "0.10.x",
"url": "https://jni.github.io/skan/0.10.x"
}
]
11 changes: 8 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,25 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'sphinx_material'
html_theme = 'pydata_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#

html_theme = 'sphinx_material'
version = skan.__version__.replace('dev0', '')

# Material theme options (see theme.conf for more information)
html_theme_options = {
# Set the name of the project to appear in the navigation.
'nav_title': 'Skan 🦴📏',

# pydata theme version switcher config
'navbar_end': ['version-switcher', 'navbar-icon-links'],
'switcher': {
'json_url': 'https://jni.github.io/skan/dev/_static/version_switcher.json',
'version_match': version,
},
# Set you GA account ID to enable tracking
# 'google_analytics_account': 'UA-XXXXX',

Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ tqdm>=4.11
nb2plots>=0.5
sphinxcontrib-bibtex
sphinx<2
sphinx_rtd_theme
pydata-sphinx-theme>=0.8.1
lucyleeow marked this conversation as resolved.
Show resolved Hide resolved
seaborn>=0.9