Skip to content

Commit

Permalink
Add Makefile command for starting Vitepress locally and some minor ch…
Browse files Browse the repository at this point in the history
…anges (#293)

* add Makefile command for starting Vitepress locally

* minor changes
  • Loading branch information
ytdHuang authored Nov 10, 2024
1 parent 5d4acec commit f220410
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ docs:
${JULIA} --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
${JULIA} --project=docs docs/make.jl

all: format test docs
vitepress:
npm --prefix docs i
npm --prefix docs run docs:dev

all: format test docs vitepress

help:
@echo "The following make commands are available:"
@echo " - make format: format codes with JuliaFormatter"
@echo " - make test: run the tests"
@echo " - make docs: instantiate and build the documentation"
@echo " - make vitepress: start Vitepress site of documentation"
@echo " - make all: run every commands in the above order"

.PHONY: default format test docs all help
.PHONY: default format test docs vitepress all help
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ QuantumToolbox.jl is equipped with a robust set of features:

- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package.
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation directly on the GPU with the same syntax as the CPU case.
- **GPU Computing:** Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case.
- **Distributed Computing:** Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.

Expand Down
27 changes: 14 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# How to build documentation locally ?
# How to build documentation and start Vitepress site locally ?

## Working Directory
All the commands should be run under the root folder of the package: `/path/to/QuantumToolbox.jl/`

The document pages will be generated in the directory: `/path/to/QuantumToolbox.jl/docs/build/` (which is ignored by git).

## Method 1: Run with `make` command
Run the following command:
Run the following command to instantiate and build the documentation:
```shell
make docs
```

## Method 2: Run `julia` command manually
Run the following command to start Vitepress site of documentation:
> [!NOTE]
> You need to install `Node.js` and `npm` first.
```shell
make vitepress
```

## Method 2: Run commands manually

### Build Pkg
Run the following command:
Expand All @@ -26,22 +33,16 @@ Run the following command:
julia --project=docs docs/make.jl
```

# How to start a local Vitepress site ?

### 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
```
> You need to install `Node.js` and `npm` first.
Install `npm` dependencies:
```shell
npm i
npm --prefix docs i
```

Run the following command:
```shell
npm run docs:dev
npm --prefix docs run docs:dev
```
10 changes: 7 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ layout: home
hero:
name: "QuantumToolbox.jl"
tagline: High-performance quantum simulations made simple
tagline: A pure Julia framework designed for High-performance quantum physics simulations
image:
src: /logo.png
alt: QuantumToolbox
Expand All @@ -25,17 +25,21 @@ hero:
features:
- icon: <img width="64" height="64" src="https://qutip.org/images/logo.png" alt="markdown"/>
title: QuTiP
details: Easily handle quantum states and operators with a rich set of tools, with the same functionalities as Python QuTiP.
link: https://qutip.org/
- icon: <img width="64" height="64" src="https://docs.sciml.ai/DiffEqDocs/stable/assets/logo.png" alt="markdown"/>
title: Dynamical Evolution
details: Advanced solvers for time evolution of quantum systems, thanks to the powerful DifferentialEquations.jl package.
link: /users_guide/time_evolution/intro
- icon: <img width="64" height="64" src="https://cuda.juliagpu.org/stable/assets/logo.png" />
title: GPU Computing
details: Leverage GPU resources for high-performance computing. Simulate the master equation directly on the GPU with the same syntax as the CPU case.
details: Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case.
link: /getting_started
- icon: <img width="64" height="64" src="https://img.icons8.com/?size=100&id=1W4Bkj363ov0&format=png&color=000000" />
title: Distributed Computing
details: Distribute the computation over multiple nodes (e.g., a cluster). Simulate undreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
details: Distribute the computation over multiple nodes (e.g., a cluster). Simulate hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
link: /users_guide/time_evolution/mcsolve
---
```
Expand Down

0 comments on commit f220410

Please sign in to comment.