Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/update_api_references.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
name: Update API references
on:
pull_request_review:
types: [submitted]
push:
branches: [master]
paths: ['LLama/**']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update_api_references:
if: github.event.pull_request.base.ref == 'master' && github.event.review.state == 'approved'
if: github.repository == 'SciSharp/LLamaSharp'
name: Update API References
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.REPO_TOKEN || github.token }}
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
10.0.x
- name: install_tool_and_generate_api_docs
run: |
dotnet tool install -g XMLDoc2Markdown
dotnet build ./LLama/LLamaSharp.csproj
cd LLama/bin/Debug/net8.0
rm -rf ../../../../docs/xmldocs
dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
Comment thread
Laurianti marked this conversation as resolved.
Resolved
# XMLDoc2Markdown 6 also writes the compiler's fixed buffer types, named like <key>e__FixedBuffer,
# which Windows cannot check out
find ../../../../docs/xmldocs -name '*[<>]*' -delete
sed -i '/e__fixedbuffer\.md)/d' ../../../../docs/xmldocs/index.md

- name: Commit and push changes
run: |
Expand All @@ -41,6 +49,4 @@ jobs:
git diff --cached --name-only
git commit -m "chore(docs): update API references in the github action."
git push
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}

8 changes: 2 additions & 6 deletions docs/ContributingGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ For API references, LLamaSharp takes use of [xmldoc2md](https://github.com/charl
```
dotnet tool install -g XMLDoc2Markdown
cd LLama/bin/Debug/net8 # change the path to your bin path.
dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
```

Specifically, if the xmldoc2md cannot be found by dotnet cli, please replace the `dotnet xmldoc2md` with the executable file, like below.

```
C:\Users\liu_y\.dotnet\tools\xmldoc2md.exe LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
```
XMLDoc2Markdown 6 runs on .NET 10, so the .NET 10 runtime needs to be installed as well.
Loading