-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build and publish manual with mdBook #47
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there anything in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. There's the readme file I put in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, there is the |
||
mv target/doc/* book/api | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: target/doc | ||
path: book | ||
deploy: | ||
name: Deploy | ||
environment: | ||
|
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" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Summary | ||
|
||
[Introduction](./introduction.md) | ||
|
||
- [Chapter 1](./chapter_1.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Chapter 1 | ||
|
||
[Insert content here.] |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no such a thing as
doc
dependencies ordev
dependencies inrust
? If so, this dependency should go in that section and here just install those, so the same setup can be used when building the documentation locally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Seemingly there's no such thing as doc dependencies in
cargo
, but there is devdependencies, so I'll add
mdBook
there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a look and this sadly doesn't seem possible currently 😞. I think this is the relevant upstream issue: rust-lang/cargo#9096
The problem is that
cargo
won't let you have an executable as a dependency. You can addmdbook
as a dep, but when it installs you don't get themdbook
binary.