Skip to content

Commit

Permalink
docs: pull git submodule before build (#67)
Browse files Browse the repository at this point in the history
* docs: pull git submodule before build

* fix: adopt clippy advice
  • Loading branch information
duskmoon314 authored Jun 8, 2024
1 parent bd6da2e commit 8b5f3d4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ To build from source, run the following commands:

```sh
git clone https://github.com/Myriad-Dreamin/typst-book.git
git submodule update --recursive --init
cargo run --bin typst-book-build
# optional: install it globally
cargo install --path ./cli
Expand Down
6 changes: 3 additions & 3 deletions cli/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Project {
}

if args.workspace.is_empty() {
args.workspace = args.dir.clone();
args.workspace.clone_from(&args.dir);
}

let tr = TypstRenderer::new(args);
Expand Down Expand Up @@ -101,11 +101,11 @@ impl Project {
}

if final_dest_dir.is_empty() {
final_dest_dir = "dist".to_owned();
"dist".clone_into(&mut final_dest_dir);
}

proj.tr.fix_dest_dir(Path::new(&final_dest_dir));
proj.dest_dir = proj.tr.dest_dir.clone();
proj.dest_dir.clone_from(&proj.tr.dest_dir);

Ok(proj)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/src/render/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl HelperDef for RenderToc {

for item in chapters {
// Spacer
if item.get("spacer").is_some() {
if item.contains_key("spacer") {
out.write("<li class=\"spacer\"></li>")?;
continue;
}
Expand Down Expand Up @@ -189,7 +189,7 @@ impl HelperDef for RenderToc {
write_li_open_tag(out, is_expanded, false)?;
}
Ordering::Equal => {
write_li_open_tag(out, is_expanded, item.get("section").is_none())?;
write_li_open_tag(out, is_expanded, !item.contains_key("section"))?;
}
}

Expand Down
1 change: 1 addition & 0 deletions github-pages/docs/guide/installation.typ
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ To build from source, run the following commands (note: it depends on `yarn` to

```sh
git clone https://github.com/Myriad-Dreamin/typst-book.git
git submodule update --recursive --init
cargo run --bin typst-book-build
# optional: install it globally
cargo install --path ./cli
Expand Down

0 comments on commit 8b5f3d4

Please sign in to comment.