-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Added Sphinx Multiversioning utilising JamesIves/github-deploy-action's feature of saving commit history on gh-pages branch. You can see a working example here: https://zerglev.github.io/chatsky/master/index.html. Use the version switcher button in the top-right to switch between versions. (It's switched off right now, but it should work in this repo) Major changes: - Can build and deploy documentation for any pre-configured branch or tag. We can build docs for versions up to v0.8.0; versions before that are too different. (due to renaming 'DFF' -> 'Chatsky') - Has a version switcher button. (in top right corner) It only shows `master` (as 'latest'), `dev` and all tags like `v0.9.0` from a specified 'start_version'. - Documentation for different versions is saved in separate folders, and you can conveniently switch the folder to view the same file for a different version (if it exists) Minor details: - In case there is no version selected for docs, say, someone used an old link, like `https://deeppavlov.github.io/chatsky/index.html`, the website will redirect them to `master` by default. - In case someone makes a mistake and types `/latest/` within their docs link, it will redirect them to `/master/`. - All relevant links are version-dependent. # Checklist - [x] Made a working example with master and dev built separately - [x] Version switcher works correctly - [x] Using tags to create docs for different versions - [x] Pull Requests build docs correctly - [x] Deleting old builds before deploying new builds - [x] Made all relevant links version-dependent - [x] Redirects work now - [x] I have performed a self-review of the changes - [x] Receive a review and do the required changes # To Consider - We could redirect people to `chatsky` in case someone types `dialog_flow_framework`, it's very easy to do. - Testing Github Pages deployment from main Chatsky repo. - Testing documentation building from Chatsky repo. - SEO optimization (old links will show the wrong website, even though they will get redirected now) (just need to add a few lines into index.html if we want to do that) - Finding a better place/design for the version switcher button. (It's maybe okay now, actually) - Update CONTRIBUTING.md (if devel workflow is changed) - Update `.ignore` files, scripts (such as `lint`), distribution manifest (if files are added/deleted) Notes: - "git stash" and "git checkout" are used during the Github Workflow. I'm not sure if that poses a problem, but everything is returned to it's place in the end, and I don't really know how to do things otherwise. It might just be required. If other workflows just wait for this one, then there can't be a problem, I think. Or if they don't run at the same time. - We're always using old conf.py files, meaning the docs will be exactly the same way, they were before - all brand names, pictures, website designs might be outdated. --------- Co-authored-by: Roman Zlobin <RLKRo@proton.me>
- Loading branch information
Showing
56 changed files
with
343 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: generate_version_switcher | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["build_and_publish_docs"] | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish: | ||
name: generate and update version switcher's json file | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: install GitPython | ||
run: python -m pip install GitPython | ||
|
||
- name: generate version switcher | ||
env: | ||
VERSION_SWITCHER_STARTING_TAG: ${{ vars.VERSION_SWITCHER_STARTING_TAG }} | ||
VERSION_SWITCHER_TAG_BLACKLIST: ${{ vars.VERSION_SWITCHER_TAG_BLACKLIST }} | ||
VERSION_SWITCHER_TAG_WHITELIST: ${{ vars.VERSION_SWITCHER_TAG_WHITELIST }} | ||
run: | | ||
python ./scripts/switcher_gen.py | ||
- name: copy version switcher for updating it | ||
run: | | ||
mkdir docs/source/switcher/ | ||
cp docs/source/_static/switcher.json docs/source/switcher/switcher.json | ||
- name: update version switcher | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/source/switcher/ | ||
clean: False |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from utils.generate_tutorials import generate_tutorial_links_for_notebook_creation # noqa: E402 | ||
from utils.link_misc_files import link_misc_files # noqa: E402 | ||
from utils.regenerate_apiref import regenerate_apiref # noqa: E402 | ||
|
||
|
||
def setup(): | ||
link_misc_files( | ||
[ | ||
"utils/db_benchmark/benchmark_schema.json", | ||
"utils/db_benchmark/benchmark_streamlit.py", | ||
] | ||
) | ||
generate_tutorial_links_for_notebook_creation( | ||
[ | ||
("tutorials.context_storages", "Context Storages"), | ||
( | ||
"tutorials.messengers", | ||
"Interfaces", | ||
[ | ||
("telegram", "Telegram"), | ||
("web_api_interface", "Web API"), | ||
], | ||
), | ||
("tutorials.service", "Service"), | ||
( | ||
"tutorials.script", | ||
"Script", | ||
[ | ||
("core", "Core"), | ||
("responses", "Responses"), | ||
], | ||
), | ||
("tutorials.llm", "LLM Integration"), | ||
("tutorials.slots", "Slots"), | ||
("tutorials.stats", "Stats"), | ||
] | ||
) | ||
regenerate_apiref( | ||
[ | ||
("chatsky.core.service", "Core.Service"), | ||
("chatsky.core", "Core"), | ||
("chatsky.conditions", "Conditions"), | ||
("chatsky.destinations", "Destinations"), | ||
("chatsky.responses", "Responses"), | ||
("chatsky.processing", "Processing"), | ||
("chatsky.context_storages", "Context Storages"), | ||
("chatsky.messengers", "Messenger Interfaces"), | ||
("chatsky.llm", "LLM Integration"), | ||
("chatsky.slots", "Slots"), | ||
("chatsky.stats", "Stats"), | ||
("chatsky.utils.testing", "Testing Utils"), | ||
("chatsky.utils.db_benchmark", "DB Benchmark"), | ||
("chatsky.utils.devel", "Development Utils"), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.