Skip to content

Commit 02c6850

Browse files
committed
deploy: ce92321
1 parent d7a600a commit 02c6850

File tree

49 files changed

+157
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+157
-65
lines changed
0 Bytes
Binary file not shown.

.doctrees/environment.pickle

0 Bytes
Binary file not shown.

_examples_synced/fully_async/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/fully_async/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_examples_synced/multi_agent/README.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/multi_agent/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />
@@ -448,10 +448,10 @@ <h2> Contents </h2>
448448

449449
<section class="tex2jax_ignore mathjax_ignore" id="multi-agent-rl">
450450
<h1>Multi-Agent RL<a class="headerlink" href="#multi-agent-rl" title="Link to this heading">#</a></h1>
451-
<p>This directory provides an example of running multi-agent reinforcement learning (RL) with Slime.</p>
451+
<p>This directory provides an example of running multi-agent reinforcement learning (RL) with slime.</p>
452452
<section id="environment-setup">
453453
<h2>Environment Setup<a class="headerlink" href="#environment-setup" title="Link to this heading">#</a></h2>
454-
<p>The environment setup is identical to the standard RL setup used in Slime.</p>
454+
<p>The environment setup is identical to the standard RL setup used in slime.</p>
455455
</section>
456456
<section id="running-the-script">
457457
<h2>Running the Script<a class="headerlink" href="#running-the-script" title="Link to this heading">#</a></h2>

_examples_synced/retool/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/retool/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_examples_synced/search-r1/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/search-r1/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_sources/_examples_synced/multi_agent/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Multi-Agent RL
22

3-
This directory provides an example of running multi-agent reinforcement learning (RL) with Slime.
3+
This directory provides an example of running multi-agent reinforcement learning (RL) with slime.
44

55
## Environment Setup
66

7-
The environment setup is identical to the standard RL setup used in Slime.
7+
The environment setup is identical to the standard RL setup used in slime.
88

99
## Running the Script
1010

_static/js/lang-toggle.js

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,66 @@
33
const STORAGE_KEY = 'slime-doc-lang';
44
const AVAILABLE = ['en','zh'];
55
function detectCurrent(){
6-
const parts = window.location.pathname.split('/').filter(Boolean);
7-
if(parts.length>0 && AVAILABLE.includes(parts[0])) return parts[0];
6+
const { parts, langIndex } = analyzePath();
7+
if(langIndex !== -1) return parts[langIndex];
88
return 'en';
99
}
1010
function otherLang(lang){ return lang === 'en' ? 'zh' : 'en'; }
11+
/**
12+
* Analyze current pathname to figure out repo root + language segment pattern.
13+
* Supports patterns:
14+
* /en/… (language as first segment)
15+
* /slime/en/… (GitHub Pages project site repo root, language second)
16+
* /slime/ (no lang yet) -> insert /slime/zh/
17+
* / (no lang) -> insert /zh/
18+
*/
19+
function analyzePath(){
20+
const rawParts = window.location.pathname.split('/').filter(Boolean);
21+
let parts = rawParts.slice();
22+
let repoRoot = null;
23+
let langIndex = -1;
24+
25+
if(parts[0] && AVAILABLE.includes(parts[0])){
26+
langIndex = 0; // /en/...
27+
} else if(parts.length > 1 && AVAILABLE.includes(parts[1])){
28+
repoRoot = parts[0];
29+
langIndex = 1; // /slime/en/...
30+
} else {
31+
// No explicit language; try to detect repo root (GitHub Pages typical) so we insert AFTER it.
32+
// Heuristic: if host ends with github.io OR first segment matches known repo name 'slime'.
33+
if(parts.length > 0 && (window.location.host.endsWith('github.io') || parts[0] === 'slime')){
34+
repoRoot = parts[0];
35+
}
36+
}
37+
return { parts, repoRoot, langIndex };
38+
}
39+
1140
function buildTargetUrl(target){
1241
const url = new URL(window.location.href);
13-
const parts = url.pathname.split('/').filter(Boolean);
14-
if(parts.length === 0){
15-
url.pathname = `/${target}/`;
16-
return url.toString();
42+
const trailingSlash = url.pathname.endsWith('/') || url.pathname === '/';
43+
const { parts, repoRoot, langIndex } = analyzePath();
44+
45+
if(langIndex === 0){
46+
// replace first
47+
parts[0] = target;
48+
} else if(langIndex === 1){
49+
parts[1] = target; // replace second (/repo/en/)
50+
} else if(repoRoot){
51+
// insert after repo root
52+
if(parts.length === 1){
53+
parts.push(target); // /repo/ -> /repo/zh/
54+
} else {
55+
parts.splice(1, 0, target);
56+
}
57+
} else {
58+
// no repo root detected; put language first
59+
parts.unshift(target);
1760
}
18-
if(AVAILABLE.includes(parts[0])) parts[0] = target; else parts.unshift(target);
19-
url.pathname = '/' + parts.join('/') + (url.pathname.endsWith('/') ? '' : '');
61+
62+
let newPath = '/' + parts.join('/');
63+
// Add trailing slash if original had it and new path doesn't look like a file (no extension)
64+
if(trailingSlash && !/\.[a-zA-Z0-9]+$/.test(parts[parts.length-1] || '')) newPath += '/';
65+
url.pathname = newPath;
2066
return url.toString();
2167
}
2268
function createButton(){

advanced/speculative-decoding.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'advanced/speculative-decoding';</script>
49-
<script src="../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

blogs/introducing_slime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'blogs/introducing_slime';</script>
49-
<script src="../_static/js/lang-toggle.js?v=f2779536"></script>
49+
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

0 commit comments

Comments
 (0)