Skip to content

Commit

Permalink
build docs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Nov 9, 2024
1 parent 9776f5f commit 3d01f31
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 13 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,16 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v2
- name: Pull Julia cache
uses: julia-actions/cache@v2
- name: Install documentation dependencies
run: julia --project=docs -e 'using Pkg; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
#- name: Creating new mds from src
- name: Build and deploy docs
uses: julia-actions/julia-docdeploy@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
GKSwstype: "100" # for Plots.jl plots (if you have them)
JULIA_DEBUG: "Documenter"
DATADEPS_ALWAYS_ACCEPT: true
# GKSwstype: "100" # for Plots.jl plots (if you have them)
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
Manifest.toml

.vscode
*.json

benchmarks/benchmarks_output.json

.ipynb_checkpoints
*.ipynb
20 changes: 20 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,23 @@ Run the following command:
```shell
julia --project=docs docs/make.jl
```

# How to start a local Vitepress site ?

> [!NOTE]
> You need to install `Node.js` and `npm` first.
Enter `docs` directory first:
```shell
cd /path/to/QuantumToolbox.jl/docs
```

Install `npm` dependencies:
```shell
npm i
```

Run the following command:
```shell
npm run docs:dev
```
15 changes: 15 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scripts": {
"docs:dev": "vitepress dev build/.documenter",
"docs:build": "vitepress build build/.documenter",
"docs:preview": "vitepress preview build/.documenter"
},
"dependencies": {
"@shikijs/transformers": "^1.1.7",
"markdown-it": "^14.1.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-mathjax3": "^4.3.2",
"vitepress": "^1.1.4",
"vitepress-plugin-tabs": "^0.5.0"
}
}

0 comments on commit 3d01f31

Please sign in to comment.