mirror of
https://github.com/p2p-ld/docs.git
synced 2024-11-12 17:54:30 +00:00
building with mdbook as a library
This commit is contained in:
parent
cd71eb6641
commit
676b41da14
4 changed files with 15 additions and 19 deletions
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
|
@ -43,6 +43,8 @@ jobs:
|
|||
# This assumes your book is in the root of your repository.
|
||||
# Just add a `cd` here if you need to change to another directory.
|
||||
# mdbook build
|
||||
# the binary of the package builds the book!
|
||||
docs
|
||||
git worktree add gh-pages
|
||||
git config user.name "Deploy from CI"
|
||||
git config user.email ""
|
||||
|
|
|
@ -12,7 +12,7 @@ publish = false
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
[dependencies]
|
||||
mdbook = "0.4.30"
|
||||
mdbook-bib = "0.0.5"
|
||||
mdbook-mermaid = "0.12.6"
|
||||
|
|
17
src/build.rs
17
src/build.rs
|
@ -1,17 +0,0 @@
|
|||
// build.rs
|
||||
// following https://github.com/tchernobog/rfcs/blob/master/text/0000-cargo-run-deps.md
|
||||
use std::{env, process::Command};
|
||||
|
||||
fn main() {
|
||||
let cargo_path = env::var("CARGO").unwrap();
|
||||
let mut mdbook = Command::new(cargo_path).args(&[
|
||||
"run",
|
||||
"--package",
|
||||
"mdbook",
|
||||
"--",
|
||||
"build",
|
||||
]);
|
||||
|
||||
println!("Built book!")
|
||||
|
||||
}
|
13
src/main.rs
13
src/main.rs
|
@ -1,5 +1,16 @@
|
|||
// dummy file
|
||||
|
||||
use mdbook::MDBook;
|
||||
|
||||
fn main() {
|
||||
println!("This package does nothing! It's just for gathering deps to build the book!")
|
||||
let root_dir = "./";
|
||||
let mut md = MDBook::load(root_dir)
|
||||
.expect("Unable to load the book");
|
||||
md.build().expect("Building failed");
|
||||
|
||||
|
||||
|
||||
// println!("This package does nothing! It's just for gathering deps to build the book!")
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue