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

fix search issue of online doc #1687

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions docs/build_docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
'sphinx.ext.coverage',
'sphinx.ext.autosummary',
'sphinx_md',
'sphinx_rtd_theme',
'autoapi.extension',
'sphinx.ext.napoleon',
'sphinx.ext.githubpages',
"sphinx.ext.linkcode",
'breathe'
'sphinx.ext.linkcode',
'breathe',
'sphinxcontrib.jquery',
]

autoapi_dirs = ['../../intel_extension_for_transformers']
Expand Down
18 changes: 11 additions & 7 deletions docs/build_docs/sphinx-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
breathe
recommonmark
setuptools_scm[toml]>=6.2
sphinx
sphinx-autoapi
sphinx-markdown-tables
sphinx-md
sphinx_rtd_theme
recommonmark==0.7.1
setuptools_scm[toml]==8.1.0
sphinx==7.3.7
sphinx-autoapi==3.1.0
sphinx-autobuild==2024.4.16
sphinx-markdown-tables==0.0.17
sphinx-md==0.0.4
sphinx_rtd_theme==2.0.0
sphinxcontrib-jquery==4.1
sphinxemoji==0.3.1

22 changes: 22 additions & 0 deletions docs/build_docs/update_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,33 @@ def update_source_url(version, folder_name, index_file):
with open(index_file, "w") as f:
f.write(index_buf)

def update_search(folder):
search_file_name="{}/search.html".format(folder)

with open(search_file_name, "r") as f:
index_buf = f.read()
key_str='<script src="_static/searchtools.js"></script>'
version_list = '''<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=fc837d61"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<script src="_static/searchtools.js"></script>'''
index_buf = index_buf.replace(key_str, version_list)

with open(search_file_name, "w") as f:
f.write(index_buf)

def main(folder, version):
folder_name=os.path.basename(folder)
for index_file in glob.glob('{}/**/*.html'.format(folder),recursive = True):
update_version_link(version, folder_name, index_file)
update_source_url(version, folder_name, index_file)
update_search(folder)

def help(me):
print("python {} html_folder version".format(me))
Expand Down
Loading