Skip to content

Commit

Permalink
Merge pull request #47 from EnergySystemsModellingLab/mdbook
Browse files Browse the repository at this point in the history
Build and publish manual with mdBook
  • Loading branch information
alexdewar authored Jun 6, 2024
2 parents e237e28 + 76fcbad commit a5d47a3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ 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 '<meta http-equiv="refresh" content="0;url=muse2/index.html">' > target/doc/index.html
- name: Install mdBook
run: cargo install mdbook
- name: Build docs with mdBook
run: |
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:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# mdBook output
book/
index.html
6 changes: 6 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["Alex Dewar"]
language = "en"
multilingual = false
src = "docs"
title = "MUSE 2.0"
5 changes: 5 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Summary

[Introduction](./introduction.md)

- [Chapter 1](./chapter_1.md)
Empty file added docs/api/muse2/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions docs/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Chapter 1

[Insert content here.]
9 changes: 9 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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 [API docs are available here].

[the older MUSE tool]: https://github.com/EnergySystemsModellingLab/MUSE_OS
[API docs are available here]: ./api/muse2

0 comments on commit a5d47a3

Please sign in to comment.