Skip to content

Commit f55d7f1

Browse files
committed
support output llms.txt
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
1 parent 9e74d69 commit f55d7f1

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

.github/workflows/presubmit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: presubmit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
presubmit:
10+
name: Presubmit Tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup mdBook
15+
shell: bash
16+
run: |
17+
rm -rf ~/.cargo/registry
18+
cargo version
19+
cargo install mdbook-llms-txt-tools mdbook@0.4.52
20+
21+
- run: mdbook build

.github/workflows/publish.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ jobs:
1111
- uses: actions/checkout@v3
1212

1313
- name: Setup mdBook
14-
uses: peaceiris/actions-mdbook@v1
15-
with:
16-
mdbook-version: 'latest'
14+
shell: bash
15+
run: |
16+
rm -rf ~/.cargo/registry
17+
cargo version
18+
cargo install mdbook-llms-txt-tools mdbook@0.4.52
1719
1820
- run: mdbook build
21+
- name: Fix the llms.txt location
22+
run: |
23+
mv book/llms-txt/llms.txt book/html/llms.txt
24+
mv book/llms-txt-full/llms-full.txt book/html/llms-full.txt
1925
2026
- name: Deploy
2127
uses: peaceiris/actions-gh-pages@v3
2228
if: github.ref == 'refs/heads/master'
2329
with:
2430
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
publish_dir: ./book
31+
publish_dir: ./book/html

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ your web browser.
2626

2727
_Firefox:_
2828
```bash
29-
$ firefox book/index.html # Linux
30-
$ open -a "Firefox" book/index.html # OS X
31-
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
32-
$ start firefox.exe .\book\index.html # Windows (Cmd)
29+
$ firefox book/html/index.html # Linux
30+
$ open -a "Firefox" book/html/index.html # OS X
31+
$ Start-Process "firefox.exe" .\book\html\index.html # Windows (PowerShell)
32+
$ start firefox.exe .\book\html\index.html # Windows (Cmd)
3333
```
3434

3535
_Chrome:_
3636
```bash
37-
$ google-chrome book/index.html # Linux
38-
$ open -a "Google Chrome" book/index.html # OS X
39-
$ Start-Process "chrome.exe" .\book\index.html # Windows (PowerShell)
40-
$ start chrome.exe .\book\index.html # Windows (Cmd)
37+
$ google-chrome book/html/index.html # Linux
38+
$ open -a "Google Chrome" book/html/index.html # OS X
39+
$ Start-Process "chrome.exe" .\book\html\index.html # Windows (PowerShell)
40+
$ start chrome.exe .\book\html\index.html # Windows (Cmd)
4141
```
4242

4343
## Contribute to this guide

book.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ title = "TiDB Development Guide"
33

44
[output.html]
55
git-repository-url = "https://github.com/pingcap/tidb-dev-guide"
6+
7+
[output.llms-txt]
8+
9+
[output.llms-txt-full]

0 commit comments

Comments
 (0)