-
Notifications
You must be signed in to change notification settings - Fork 0
rewrite #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
def-WA2025
merged 14 commits into
master
from
copilot/rewrite-docs-with-modern-architecture
May 1, 2026
Merged
rewrite #3
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
71eadce
feat: rewrite docs with VitePress, add messages & ELXMOJ pages
Copilot b2f6f3a
fix: remove hardcoded version from ELXMOJ download links
Copilot b57c6d6
feat: GitHub Primer theme, delete Writerside, enrich all content
Copilot d5505cf
ci: add test build workflow and PR preview workflow
Copilot 4fe4a3f
ci: upload PR preview to FTP, auto-delete on PR close
Copilot cd23257
ci: update preview URL to xmoj-docs.infinityfreeapp.com
Copilot a8612cd
Create package-lock.json
PythonSmall-Q 66a5568
ci: upload to htdocs/pr-N/ so files are served by InfinityFree web root
Copilot d74e534
ci: pass --base /pr-N/ to vitepress build so assets resolve correctly…
Copilot 73f8734
Update installation link for XMOJ-Script
PythonSmall-Q 800905e
Revise known bug warning in get-data.md
PythonSmall-Q 662f536
Fix: resolve math formula display issue
def-WA2025 3c9beeb
Fix: resolve math formula display issue
def-WA2025 fbadc99
Update package-lock.json
def-WA2025 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: PR preview cleanup | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| cleanup: | ||
| name: Delete FTP preview | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install lftp | ||
| run: sudo apt-get install -y lftp | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
|
|
||
| - name: Remove preview directory from FTP | ||
| env: | ||
| FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | ||
| FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| lftp -c " | ||
| set ftp:ssl-allow no; | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
| open -u $FTP_USERNAME,$FTP_PASSWORD ftpupload.net; | ||
| rm -rf htdocs/pr-$PR_NUMBER/; | ||
| bye | ||
| " | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: PR preview | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| preview: | ||
| name: Build & deploy preview | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
|
|
||
| - name: Build docs | ||
| run: npm run docs:build -- --base /pr-${{ github.event.pull_request.number }}/ | ||
|
|
||
| - name: Deploy to FTP | ||
| uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | ||
| with: | ||
| server: ftpupload.net | ||
| port: 21 | ||
| username: ${{ secrets.FTP_USERNAME }} | ||
| password: ${{ secrets.FTP_PASSWORD }} | ||
| local-dir: .vitepress/dist/ | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
| server-dir: htdocs/pr-${{ github.event.pull_request.number }}/ | ||
|
|
||
| - name: Comment on PR | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const prNumber = context.payload.pull_request.number; | ||
| const previewUrl = `http://xmoj-docs.infinityfreeapp.com/pr-${prNumber}/`; | ||
| const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | ||
| const body = [ | ||
| '## 📖 文档预览', | ||
| '', | ||
| `构建成功!点击下方链接在线预览文档(PR 关闭后自动删除)。`, | ||
| '', | ||
| `**[🔗 在线预览](${previewUrl})**`, | ||
| '', | ||
| `> 预览地址:\`${previewUrl}\``, | ||
| `> 构建运行:[#${context.runNumber}](${runUrl})`, | ||
| ].join('\n'); | ||
|
|
||
| const { data: comments } = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| }); | ||
|
|
||
| const botComment = comments.find( | ||
| c => c.user.type === 'Bot' && c.body.includes('## 📖 文档预览') | ||
| ); | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
|
|
||
| if (botComment) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: botComment.id, | ||
| body, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body, | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Test build | ||
|
|
||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - master | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
PythonSmall-Q marked this conversation as resolved.
|
||
|
|
||
| - name: Build docs | ||
| run: npm run docs:build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node_modules | ||
| .vitepress/dist | ||
| .vitepress/cache |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.