Skip to content

Commit

Permalink
merge change + mistake fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ZergLev committed Sep 27, 2024
1 parent 3887383 commit b75c8cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/source/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def replace(v: Any) -> str:
# Cleaning outdated documentation build
clean_docs(str(output_dir))

# doing DFF funcs before doc building
# Running Chatsky custom funcs before doc building
scripts.doc.pre_sphinx_build_funcs(str(root_dir))
setup_module.setup(str(root_dir), str(output_dir))

Expand Down
18 changes: 9 additions & 9 deletions docs/source/switcher_gen.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import git
import json


def generate_switcher():
repo = git.Repo('./')
branch = repo.active_branch
# branch = repo.active_branch

tags = sorted(repo.tags, key=lambda t: t.commit.committed_datetime)
tags.reverse()
latest_tag = tags[-1]

switcher_json = []

dev_data = {
"version": "dev",
"url": "https://deeppavlov.github.io/dialog_flow_framework/dev/index.html",
"url": "https://deeppavlov.github.io/chatsky/dev/index.html",
}
switcher_json += [dev_data]

for tag in tags:
url = "https://deppavlov.github.io/dialog_flow_framework/" + str(tag) + "/index.html"
url = "https://deepavlov.github.io/chatsky/" + str(tag) + "/index.html"
tag_data = {
"name": str(tag),
"version": str(tag),
Expand All @@ -29,10 +30,9 @@ def generate_switcher():
# Only building for tags from v0.7.0
if str(tag) > "v0.7.0":
switcher_json += [tag_data]

switcher_json_obj = json.dumps(switcher_json, indent=4)

# Write nested JSON data to the switcher.json file
with open('./docs/source/_static/switcher.json', 'w') as f:
f.write(switcher_json_obj)

2 changes: 1 addition & 1 deletion scripts/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ def docs(docker: Optional[DockerClient]):
def pre_sphinx_build_funcs(root_dir: str):
_build_drawio(root_dir)
apiref_dir = root_dir + "/docs/source/apiref"
apidoc.main(["-e", "-E", "-f", "-o", apiref_dir, "dff"])
apidoc.main(["-e", "-E", "-f", "-o", apiref_dir, "chatsky"])

0 comments on commit b75c8cc

Please sign in to comment.