Skip to content

Commit 21d2253

Browse files
committed
docs: add Chinese "试一试" (Try It Out) sections to all lessons
Add interactive example sections with Chinese/English bilingual prompts for lessons S01-S12. Each section provides practical exercises that correspond to the lesson content, helping readers practice what they learned.
1 parent 35a379e commit 21d2253

12 files changed

+1332
-0
lines changed

docs/diagrams/s01_agent_loop.html

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,74 @@
455455
transform: translateX(4px);
456456
}
457457

458+
/* ---- Try It Out Section ---- */
459+
.try-section {
460+
margin-bottom: 64px;
461+
}
462+
463+
.try-section > h2 {
464+
font-family: var(--font-heading);
465+
font-weight: 700;
466+
font-size: 28px;
467+
color: var(--text-primary);
468+
margin-bottom: 32px;
469+
padding-left: 16px;
470+
border-left: 3px solid var(--cyan);
471+
}
472+
473+
.try-grid {
474+
display: grid;
475+
gap: 16px;
476+
}
477+
478+
.try-item {
479+
background: var(--bg-card);
480+
border: 1px solid var(--border-card);
481+
border-radius: 12px;
482+
padding: 20px 24px;
483+
backdrop-filter: blur(12px);
484+
-webkit-backdrop-filter: blur(12px);
485+
transition: all 0.3s ease;
486+
display: flex;
487+
align-items: flex-start;
488+
gap: 16px;
489+
}
490+
491+
.try-item:hover {
492+
background: var(--bg-card-hover);
493+
border-color: var(--border-card-hover);
494+
transform: translateX(4px);
495+
}
496+
497+
.try-number {
498+
font-family: var(--font-code);
499+
font-size: 14px;
500+
font-weight: 700;
501+
color: var(--amber);
502+
background: rgba(240, 180, 41, 0.1);
503+
border: 1px solid rgba(240, 180, 41, 0.25);
504+
border-radius: 50%;
505+
width: 32px;
506+
height: 32px;
507+
display: flex;
508+
align-items: center;
509+
justify-content: center;
510+
flex-shrink: 0;
511+
}
512+
513+
.try-content {
514+
flex: 1;
515+
}
516+
517+
.try-content code {
518+
font-family: var(--font-code);
519+
font-size: 14px;
520+
color: var(--cyan);
521+
background: rgba(78, 205, 196, 0.08);
522+
padding: 3px 8px;
523+
border-radius: 4px;
524+
}
525+
458526
/* Responsive */
459527
@media (max-width: 640px) {
460528
.container { padding: 32px 16px 60px; }
@@ -590,6 +658,41 @@ <h3>模型即 Agent</h3>
590658
</div>
591659
</section>
592660

661+
<!-- Try It Out -->
662+
<section class="try-section">
663+
<h2>试一试 Try It Out</h2>
664+
<div class="try-grid">
665+
<div class="try-item">
666+
<div class="try-number">1</div>
667+
<div class="try-content">
668+
<p>创建一个输出问候消息的 Java 文件</p>
669+
<p>Create a Java file that outputs a greeting message</p>
670+
</div>
671+
</div>
672+
<div class="try-item">
673+
<div class="try-number">2</div>
674+
<div class="try-content">
675+
<p>列出当前目录下的 Java 文件</p>
676+
<p>Enumerate Java files in the current directory</p>
677+
</div>
678+
</div>
679+
<div class="try-item">
680+
<div class="try-number">3</div>
681+
<div class="try-content">
682+
<p>识别当前活跃的 git 分支</p>
683+
<p>Identify the active git branch</p>
684+
</div>
685+
</div>
686+
<div class="try-item">
687+
<div class="try-number">4</div>
688+
<div class="try-content">
689+
<p>创建一个新目录,并在其中生成多个文件</p>
690+
<p>Generate a new directory with multiple files inside it</p>
691+
</div>
692+
</div>
693+
</div>
694+
</section>
695+
593696
<!-- Navigation -->
594697
<nav class="nav-hint" style="display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;">
595698
<a href="s00_prerequisites.html">

docs/diagrams/s02_tool_dispatch.html

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,74 @@
407407
.nav-hint a.prev { color: var(--text-secondary); border-color: rgba(255,255,255,0.1); }
408408
.nav-hint a.prev:hover { color: var(--cyan); border-color: var(--cyan-dim); }
409409

410+
/* ---- Try It Out Section ---- */
411+
.try-section {
412+
margin-bottom: 64px;
413+
}
414+
415+
.try-section > h2 {
416+
font-family: var(--font-heading);
417+
font-weight: 700;
418+
font-size: 28px;
419+
color: var(--text-primary);
420+
margin-bottom: 32px;
421+
padding-left: 16px;
422+
border-left: 3px solid var(--cyan);
423+
}
424+
425+
.try-grid {
426+
display: grid;
427+
gap: 16px;
428+
}
429+
430+
.try-item {
431+
background: var(--bg-card);
432+
border: 1px solid var(--border-card);
433+
border-radius: 12px;
434+
padding: 20px 24px;
435+
backdrop-filter: blur(12px);
436+
-webkit-backdrop-filter: blur(12px);
437+
transition: all 0.3s ease;
438+
display: flex;
439+
align-items: flex-start;
440+
gap: 16px;
441+
}
442+
443+
.try-item:hover {
444+
background: var(--bg-card-hover);
445+
border-color: var(--border-card-hover);
446+
transform: translateX(4px);
447+
}
448+
449+
.try-number {
450+
font-family: var(--font-code);
451+
font-size: 14px;
452+
font-weight: 700;
453+
color: var(--amber);
454+
background: rgba(240, 180, 41, 0.1);
455+
border: 1px solid rgba(240, 180, 41, 0.25);
456+
border-radius: 50%;
457+
width: 32px;
458+
height: 32px;
459+
display: flex;
460+
align-items: center;
461+
justify-content: center;
462+
flex-shrink: 0;
463+
}
464+
465+
.try-content {
466+
flex: 1;
467+
}
468+
469+
.try-content code {
470+
font-family: var(--font-code);
471+
font-size: 14px;
472+
color: var(--cyan);
473+
background: rgba(78, 205, 196, 0.08);
474+
padding: 3px 8px;
475+
border-radius: 4px;
476+
}
477+
410478
@media (max-width: 640px) {
411479
.container { padding: 32px 16px 60px; }
412480
.cards-grid { grid-template-columns: 1fr; }
@@ -572,6 +640,41 @@ <h2>Tool Interface 工具接口</h2>
572640
</div>
573641
</section>
574642

643+
<!-- Try It Out -->
644+
<section class="try-section">
645+
<h2>试一试 Try It Out</h2>
646+
<div class="try-grid">
647+
<div class="try-item">
648+
<div class="try-number">1</div>
649+
<div class="try-content">
650+
<p>"读取 pom.xml 文件"</p>
651+
<p>"Read the file pom.xml"</p>
652+
</div>
653+
</div>
654+
<div class="try-item">
655+
<div class="try-number">2</div>
656+
<div class="try-content">
657+
<p>"创建一个名为 Greeter.java 的文件,包含一个 greet(name) 方法"</p>
658+
<p>"Create a file called Greeter.java with a greet(name) function"</p>
659+
</div>
660+
</div>
661+
<div class="try-item">
662+
<div class="try-number">3</div>
663+
<div class="try-content">
664+
<p>"编辑 Greeter.java,为方法添加文档注释"</p>
665+
<p>"Edit Greeter.java to add a docstring to the function"</p>
666+
</div>
667+
</div>
668+
<div class="try-item">
669+
<div class="try-number">4</div>
670+
<div class="try-content">
671+
<p>"读取 Greeter.java 验证编辑成功"</p>
672+
<p>"Read Greeter.java to verify the edit worked"</p>
673+
</div>
674+
</div>
675+
</div>
676+
</section>
677+
575678
<!-- Navigation -->
576679
<nav class="nav-hint" style="display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;">
577680
<a href="s01_agent_loop.html">

docs/diagrams/s03_todo_write.html

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,74 @@
401401
.nav-hint a.prev { color: var(--text-secondary); border-color: rgba(255,255,255,0.1); }
402402
.nav-hint a.prev:hover { color: var(--cyan); border-color: var(--cyan-dim); }
403403

404+
/* ---- Try It Out Section ---- */
405+
.try-section {
406+
margin-bottom: 64px;
407+
}
408+
409+
.try-section > h2 {
410+
font-family: var(--font-heading);
411+
font-weight: 700;
412+
font-size: 28px;
413+
color: var(--text-primary);
414+
margin-bottom: 32px;
415+
padding-left: 16px;
416+
border-left: 3px solid var(--cyan);
417+
}
418+
419+
.try-grid {
420+
display: grid;
421+
gap: 16px;
422+
}
423+
424+
.try-item {
425+
background: var(--bg-card);
426+
border: 1px solid var(--border-card);
427+
border-radius: 12px;
428+
padding: 20px 24px;
429+
backdrop-filter: blur(12px);
430+
-webkit-backdrop-filter: blur(12px);
431+
transition: all 0.3s ease;
432+
display: flex;
433+
align-items: flex-start;
434+
gap: 16px;
435+
}
436+
437+
.try-item:hover {
438+
background: var(--bg-card-hover);
439+
border-color: var(--border-card-hover);
440+
transform: translateX(4px);
441+
}
442+
443+
.try-number {
444+
font-family: var(--font-code);
445+
font-size: 14px;
446+
font-weight: 700;
447+
color: var(--amber);
448+
background: rgba(240, 180, 41, 0.1);
449+
border: 1px solid rgba(240, 180, 41, 0.25);
450+
border-radius: 50%;
451+
width: 32px;
452+
height: 32px;
453+
display: flex;
454+
align-items: center;
455+
justify-content: center;
456+
flex-shrink: 0;
457+
}
458+
459+
.try-content {
460+
flex: 1;
461+
}
462+
463+
.try-content code {
464+
font-family: var(--font-code);
465+
font-size: 14px;
466+
color: var(--cyan);
467+
background: rgba(78, 205, 196, 0.08);
468+
padding: 3px 8px;
469+
border-radius: 4px;
470+
}
471+
404472
@media (max-width: 640px) {
405473
.container { padding: 32px 16px 60px; }
406474
.cards-grid { grid-template-columns: 1fr; }
@@ -610,6 +678,34 @@ <h2>State Transitions 状态转换</h2>
610678
</div>
611679
</section>
612680

681+
<!-- Try It Out -->
682+
<section class="try-section">
683+
<h2>试一试 Try It Out</h2>
684+
<div class="try-grid">
685+
<div class="try-item">
686+
<div class="try-number">1</div>
687+
<div class="try-content">
688+
<p>"重构 Hello.java:添加类型提示、文档注释和 main 方法保护"</p>
689+
<p>"Refactor the file Hello.java: add type hints, docstrings, and a main guard"</p>
690+
</div>
691+
</div>
692+
<div class="try-item">
693+
<div class="try-number">2</div>
694+
<div class="try-content">
695+
<p>"创建一个 Java 包,包含 App.java、Utils.java 和 tests/UtilsTest.java"</p>
696+
<p>"Create a Java package with App.java, Utils.java, and tests/UtilsTest.java"</p>
697+
</div>
698+
</div>
699+
<div class="try-item">
700+
<div class="try-number">3</div>
701+
<div class="try-content">
702+
<p>"审查所有 Java 文件并修复任何风格问题"</p>
703+
<p>"Review all Java files and fix any style issues"</p>
704+
</div>
705+
</div>
706+
</div>
707+
</section>
708+
613709
<!-- Navigation -->
614710
<nav class="nav-hint" style="display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;">
615711
<a href="s02_tool_dispatch.html">

0 commit comments

Comments
 (0)