From e72122e288c5def1b1b9c6a054310e260c30482e Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 29 May 2024 16:38:59 +0100 Subject: [PATCH 1/4] Add mdBook skeleton --- .gitignore | 4 ++++ book.toml | 6 ++++++ docs/SUMMARY.md | 5 +++++ docs/chapter_1.md | 3 +++ docs/introduction.md | 6 ++++++ 5 files changed, 24 insertions(+) create mode 100644 book.toml create mode 100644 docs/SUMMARY.md create mode 100644 docs/chapter_1.md create mode 100644 docs/introduction.md diff --git a/.gitignore b/.gitignore index 6985cf1b..f199a054 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + +# mdBook output +book/ +index.html diff --git a/book.toml b/book.toml new file mode 100644 index 00000000..22377197 --- /dev/null +++ b/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Alex Dewar"] +language = "en" +multilingual = false +src = "docs" +title = "MUSE 2.0" diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 00000000..bdaca8d4 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,5 @@ +# Summary + +[Introduction](./introduction.md) + +- [Chapter 1](./chapter_1.md) diff --git a/docs/chapter_1.md b/docs/chapter_1.md new file mode 100644 index 00000000..499141a3 --- /dev/null +++ b/docs/chapter_1.md @@ -0,0 +1,3 @@ +# Chapter 1 + +[Insert content here.] diff --git a/docs/introduction.md b/docs/introduction.md new file mode 100644 index 00000000..aa0c568c --- /dev/null +++ b/docs/introduction.md @@ -0,0 +1,6 @@ +# Introduction + +MUSE 2.0 is a tool for running simulations of energy systems, written in Rust. It is a slimmer and +faster version of [the older MUSE tool]. + +[the older MUSE tool]: https://github.com/EnergySystemsModellingLab/MUSE_OS From d6d7f6ef5c99a9cc64333dad92c0c0f1fe8ddd5a Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Wed, 5 Jun 2024 10:22:15 +0100 Subject: [PATCH 2/4] Build and publish mdBook docs Closes #36. --- .github/workflows/docs.yml | 20 +++++++++++++++----- docs/api/muse2/README.txt | 2 ++ docs/introduction.md | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 docs/api/muse2/README.txt diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d7e98436..357d6531 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,14 +20,24 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Setup pages uses: actions/configure-pages@v5 - - name: Build docs - run: cargo doc --no-deps - - name: Add redirect - run: echo '' > target/doc/index.html + - name: Install mdBook + run: cargo install mdbook + - name: Build docs with mdBook + run: | + # Clean repo first + rm -rf book + mdbook build + - name: Build API docs + run: | + cargo doc --no-deps + + # Put API documentation in with book + rm -r book/api/* + mv target/doc/* book/api - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: target/doc + path: book deploy: name: Deploy environment: diff --git a/docs/api/muse2/README.txt b/docs/api/muse2/README.txt new file mode 100644 index 00000000..1229dae3 --- /dev/null +++ b/docs/api/muse2/README.txt @@ -0,0 +1,2 @@ +This is a placeholder for the API documentation, which is automatically generated by the CI runner +using `cargo doc`. diff --git a/docs/introduction.md b/docs/introduction.md index aa0c568c..b540aa8e 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -3,4 +3,7 @@ MUSE 2.0 is a tool for running simulations of energy systems, written in Rust. It is a slimmer and faster version of [the older MUSE tool]. +The [API docs are available here]. + [the older MUSE tool]: https://github.com/EnergySystemsModellingLab/MUSE_OS +[API docs are available here]: ./api/muse2 From d250ff7914354df3097c1336fde638dee1d5fa9c Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Thu, 6 Jun 2024 10:11:02 +0100 Subject: [PATCH 3/4] Remove unnecessary rm in workflow --- .github/workflows/docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 357d6531..c0923ec2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,8 +24,6 @@ jobs: run: cargo install mdbook - name: Build docs with mdBook run: | - # Clean repo first - rm -rf book mdbook build - name: Build API docs run: | From 76fcbad745e5df4abbdafbde52eb9662847e6a8e Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Thu, 6 Jun 2024 10:14:50 +0100 Subject: [PATCH 4/4] Replace pointless readme file with .gitkeep --- docs/api/muse2/.gitkeep | 0 docs/api/muse2/README.txt | 2 -- 2 files changed, 2 deletions(-) create mode 100644 docs/api/muse2/.gitkeep delete mode 100644 docs/api/muse2/README.txt diff --git a/docs/api/muse2/.gitkeep b/docs/api/muse2/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/api/muse2/README.txt b/docs/api/muse2/README.txt deleted file mode 100644 index 1229dae3..00000000 --- a/docs/api/muse2/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a placeholder for the API documentation, which is automatically generated by the CI runner -using `cargo doc`.