Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
cccfc10e
Unverified
Commit
cccfc10e
authored
Apr 02, 2025
by
renxin
Committed by
GitHub
Apr 02, 2025
Browse files
Feature/revise docs ci (#5009)
parent
a2aea59b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
.github/workflows/release-docs.yml
.github/workflows/release-docs.yml
+1
-0
docs/wrap_run_llm.py
docs/wrap_run_llm.py
+40
-0
No files found.
.github/workflows/release-docs.yml
View file @
cccfc10e
...
@@ -49,6 +49,7 @@ jobs:
...
@@ -49,6 +49,7 @@ jobs:
make compile
make compile
make html
make html
python3 wrap_run_llm.py
cd _build/html
cd _build/html
git clone https://$GITHUB_TOKEN@github.com/sgl-project/sgl-project.github.io.git ../sgl-project.github.io --depth 1
git clone https://$GITHUB_TOKEN@github.com/sgl-project/sgl-project.github.io.git ../sgl-project.github.io --depth 1
...
...
docs/wrap_run_llm.py
0 → 100644
View file @
cccfc10e
import
os
import
re
def
insert_runllm_widget
(
html_content
):
# RunLLM Widget script to be inserted
widget_script
=
"""
<!-- RunLLM Widget Script -->
<script type="module" id="runllm-widget-script" src="https://widget.runllm.com" crossorigin="true" version="stable" runllm-keyboard-shortcut="Mod+j" runllm-name="SGLang Chatbot" runllm-position="BOTTOM_RIGHT" runllm-assistant-id="629" async></script>
"""
# Find the closing body tag and insert the widget script before it
return
re
.
sub
(
r
"</body>"
,
f
"
{
widget_script
}
\n
</body>"
,
html_content
)
def
main
():
# Get the build directory path
build_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"_build"
,
"html"
)
index_file
=
os
.
path
.
join
(
build_dir
,
"index.html"
)
# Process only index.html
if
os
.
path
.
exists
(
index_file
):
# Read the HTML file
with
open
(
index_file
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
content
=
f
.
read
()
# Insert the RunLLM widget
modified_content
=
insert_runllm_widget
(
content
)
# Write back the modified content
with
open
(
index_file
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
modified_content
)
else
:
print
(
f
"Index file not found:
{
index_file
}
"
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment