@@ -528,62 +528,37 @@ <h3>🚀 快速開始</h3>
528528 4. 開始第一個場景的學習</ p >
529529
530530 < details style ="margin-top: 15px; background: #f0f7ff; padding: 15px; border-radius: 8px; border: 1px solid #667eea; ">
531- < summary style ="cursor: pointer; font-weight: bold; color: #667eea; "> 🤖 Agent 快速設置指令(點擊展開)</ summary >
532- < div style ="position: relative; ">
533- < button onclick ="copyAgentPrompt() " style ="position: absolute; top: 15px; right: 15px; padding: 5px 10px; background: #667eea; color: white; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; z-index: 10; ">
534- 複製
535- </ button >
536- < pre id ="agentPrompt " style ="margin-top: 10px; background: white; padding: 15px; padding-right: 60px; border-radius: 5px; font-size: 0.9rem; overflow-x: auto; "> 請幫我設置 GitHub Copilot 教學專案環境:
531+ < summary style ="cursor: pointer; font-weight: bold; color: #667eea; "> 🤖 Agent 快速設置(點擊展開)</ summary >
532+ < div style ="margin-top: 15px; ">
533+ < p style ="margin-bottom: 10px; color: #666; "> 將以下內容儲存為 < code > setup-copilot-tutorial.txt</ code > 檔案:</ p >
534+ < div style ="position: relative; ">
535+ < button onclick ="copySetupFile() " style ="position: absolute; top: 10px; right: 10px; padding: 5px 10px; background: #667eea; color: white; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; z-index: 10; ">
536+ 複製檔案內容
537+ </ button >
538+ < pre id ="setupFile " style ="background: white; padding: 15px; padding-right: 60px; border-radius: 5px; font-size: 0.9rem; overflow-x: auto; "> GitHub Copilot 教學專案 - 快速設置檔案
539+ =====================================
537540
538- 1. 首先檢查目前位置並決定克隆位置 :
539- - 如果在 VS Code 中已有開啟的專案,請詢問我是否要在當前目錄的父目錄克隆
540- - 如果沒有開啟專案,請詢問我想要克隆到哪個目錄
541- - 建議的位置:~/projects/ 或 ~/Github/
541+ 專案資訊 :
542+ - Repository: https://github.com/yulin0629/github-copilot-tutorial
543+ - 包含 8 個漸進式學習場景
544+ - 場景 8 為獨立的 git submodule
542545
543- 2. 克隆專案(包含 submodule):
544- cd [選定的目錄]
545- git clone --recursive https://github.com/yulin0629/github-copilot-tutorial.git
546- cd github-copilot-tutorial
546+ 設置步驟:
547+ 1. 克隆專案到 ~/projects/ 或 ~/Github/ 目錄
548+ 2. 使用 --recursive 參數確保 submodule 正確下載
549+ 3. 在編輯器中開啟專案資料夾
550+ 4. 確認 GitHub Copilot 擴充套件已安裝
551+ 5. 開啟 index.html 預覽教學內容
547552
548- 3. 如果場景 8 的 submodule 沒有正確下載,請執行:
549- git submodule update --init --recursive
550-
551- 4. 檢查專案結構是否完整(應有 8 個場景資料夾)
552-
553- 5. 在編輯器中開啟克隆下來的專案資料夾:
554- - 請執行開啟資料夾的命令,選擇 github-copilot-tutorial 資料夾
555- - 或使用 VS Code API:vscode.openFolder 命令
556-
557- 6. 確認已安裝必要的擴充套件:
558- - VS Code/VS Code Insiders:需要 GitHub Copilot 擴充套件
559- - Cursor AI:內建 AI 功能,無需額外安裝
560-
561- 7. 設定語言偏好為繁體中文(如果需要)
562-
563- 完成後請告訴我設置狀態,並直接開啟 index.html 預覽教學內容。
564-
565- ---
566-
567- 🎯 新視窗初始化提示詞(在新視窗開啟後使用):
568-
569- 請使用 Agent 模式幫我初始化 GitHub Copilot 教學專案環境:
570-
571- 1. 檢查專案結構完整性:
572- - 確認有 8 個場景資料夾(01-first-experience 到 08-comprehensive-project)
573- - 檢查場景 8 是否為完整的 git submodule
574- - 如果有缺失,請提醒我需要執行的命令
575-
576- 2. 設定開發環境:
577- - 確認 GitHub Copilot 擴充套件已啟用
578- - 檢查語言設定是否為繁體中文(github.copilot.chat.localeOverride: zh-TW)
579- - 確認 .github/copilot-instructions.md 存在
580-
581- 3. 準備教學環境:
582- - 開啟 index.html 在瀏覽器中預覽
583- - 顯示專案的基本資訊和結構
584- - 提供開始學習的建議順序
585-
586- 完成後請給我一個簡短的狀態報告,並建議從哪個場景開始學習。</ pre >
553+ 如需檢查專案完整性:
554+ - 應有 8 個場景資料夾(01-first-experience 到 08-comprehensive-project)
555+ - 場景 8 應為完整的 git submodule
556+ - 存在 .github/copilot-instructions.md 檔案</ pre >
557+ </ div >
558+ < div style ="margin-top: 15px; padding: 15px; background: #e8f5e8; border-radius: 5px; border-left: 3px solid #28a745; ">
559+ < p style ="margin: 0; font-weight: bold; color: #28a745; "> 💡 使用方式:</ p >
560+ < p style ="margin: 5px 0 0 0; color: #666; font-size: 0.9rem; "> 儲存檔案後,在 VS Code 中使用 Agent 模式,將檔案拖曳到對話框即可開始設置。</ p >
561+ </ div >
587562 </ div >
588563 </ details >
589564
@@ -719,14 +694,14 @@ <h2>📚 8 個學習場景</h2>
719694 </ div >
720695
721696 < script >
722- // 複製 Agent 設置指令
723- async function copyAgentPrompt ( ) {
724- const promptElement = document . getElementById ( 'agentPrompt' ) ;
697+ // 複製設置檔案內容
698+ async function copySetupFile ( ) {
699+ const fileContent = document . getElementById ( 'setupFile' ) . textContent ;
725700 const button = event . target ;
726701 const originalText = button . textContent ;
727702
728703 try {
729- await navigator . clipboard . writeText ( promptElement . textContent ) ;
704+ await navigator . clipboard . writeText ( fileContent ) ;
730705 button . textContent = '✓ 已複製' ;
731706 button . style . background = '#48bb78' ;
732707
@@ -737,7 +712,7 @@ <h2>📚 8 個學習場景</h2>
737712 } catch ( err ) {
738713 // 降級方案
739714 const textArea = document . createElement ( 'textarea' ) ;
740- textArea . value = promptElement . textContent ;
715+ textArea . value = fileContent ;
741716 textArea . style . position = 'fixed' ;
742717 textArea . style . left = '-999999px' ;
743718 document . body . appendChild ( textArea ) ;
0 commit comments