Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 408e5f1

Browse files
NeoZhangJianyuarthwpre-commit-ci[bot]
authored
fix search issue of online doc (#1687)
* fix search issue of online doc * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: ZhangJianyu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dbd809b commit 408e5f1

File tree

3 files changed

+37
-9
lines changed

3 files changed

+37
-9
lines changed

docs/build_docs/source/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
'sphinx.ext.coverage',
3535
'sphinx.ext.autosummary',
3636
'sphinx_md',
37+
'sphinx_rtd_theme',
3738
'autoapi.extension',
3839
'sphinx.ext.napoleon',
3940
'sphinx.ext.githubpages',
40-
"sphinx.ext.linkcode",
41-
'breathe'
41+
'sphinx.ext.linkcode',
42+
'breathe',
43+
'sphinxcontrib.jquery',
4244
]
4345

4446
autoapi_dirs = ['../../intel_extension_for_transformers']
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
breathe
2-
recommonmark
3-
setuptools_scm[toml]>=6.2
4-
sphinx
5-
sphinx-autoapi
6-
sphinx-markdown-tables
7-
sphinx-md
8-
sphinx_rtd_theme
2+
recommonmark==0.7.1
3+
setuptools_scm[toml]==8.1.0
4+
sphinx==7.3.7
5+
sphinx-autoapi==3.1.0
6+
sphinx-autobuild==2024.4.16
7+
sphinx-markdown-tables==0.0.17
8+
sphinx-md==0.0.4
9+
sphinx_rtd_theme==2.0.0
10+
sphinxcontrib-jquery==4.1
11+
sphinxemoji==0.3.1
12+

docs/build_docs/update_html.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,33 @@ def update_source_url(version, folder_name, index_file):
5050
with open(index_file, "w") as f:
5151
f.write(index_buf)
5252

53+
def update_search(folder):
54+
search_file_name="{}/search.html".format(folder)
55+
56+
with open(search_file_name, "r") as f:
57+
index_buf = f.read()
58+
key_str='<script src="_static/searchtools.js"></script>'
59+
version_list = '''<!--[if lt IE 9]>
60+
<script src="_static/js/html5shiv.min.js"></script>
61+
<![endif]-->
62+
<script src="_static/jquery.js?v=5d32c60e"></script>
63+
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
64+
<script src="_static/documentation_options.js?v=fc837d61"></script>
65+
<script src="_static/doctools.js?v=9a2dae69"></script>
66+
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
67+
<script src="_static/js/theme.js"></script>
68+
<script src="_static/searchtools.js"></script>'''
69+
index_buf = index_buf.replace(key_str, version_list)
70+
71+
with open(search_file_name, "w") as f:
72+
f.write(index_buf)
73+
5374
def main(folder, version):
5475
folder_name=os.path.basename(folder)
5576
for index_file in glob.glob('{}/**/*.html'.format(folder),recursive = True):
5677
update_version_link(version, folder_name, index_file)
5778
update_source_url(version, folder_name, index_file)
79+
update_search(folder)
5880

5981
def help(me):
6082
print("python {} html_folder version".format(me))

0 commit comments

Comments
 (0)