Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit a441d96

Browse files
committed
fix: fix Makefile.toml task names
1 parent 8feea38 commit a441d96

File tree

1 file changed

+36
-20
lines changed

1 file changed

+36
-20
lines changed

examples/Makefile.toml

+36-20
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,54 @@
1-
[tasks.doc-build]
1+
# Modify these to suit your needs
2+
[env]
3+
BIBFILE = "cite.bib"
4+
STYLE = "apa"
5+
6+
# actually generate the docs
7+
[tasks.doc-gen]
28
command = "cargo"
39
args = ["doc", "--no-deps", "-q"]
410

5-
[tasks.doc-post-proc]
11+
[tasks.doc-post-process]
12+
# we'll use fd to find all the doc files
613
command = "fd"
714
args = [
815
".",
9-
"./${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/doc/${CARGO_MAKE_CRATE_FS_NAME}",
16+
"${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/doc/${CARGO_MAKE_CRATE_FS_NAME}", # search the generated doc files
1017
"-e",
11-
"html",
12-
"-x",
18+
"html", # only those with extention html
19+
"-x", # run the cmb command on each file found
1320
"cmb",
14-
"-b",
15-
"cite.bib",
16-
"--style",
17-
"apa",
18-
"--format",
21+
"-b", # use bibfile cite.bib
22+
"${BIBFILE}",
23+
"--style", # use style defined in env table
24+
"${STYLE}",
25+
"--format", # generate in html so it looks good in docs
1926
"html",
20-
"-i",
21-
"{}",
27+
"-i", # modify files inplace
28+
"{}", # fd shorthand for "the file you just found"
2229
]
23-
dependencies = ["fd", "doc-build"]
30+
# dependencies to make sure the necessary binaries are installed
31+
# and the docs are actually generated
32+
dependencies = ["fd", "cmb", "doc-gen"]
2433

25-
[tasks.doc-http]
34+
# serve docs over simple http server
35+
[tasks.doc-serve]
2636
command = "http-server"
27-
args = ['-i', '--cors', 'target/doc']
37+
args = ['-i', '--cors', 'target/doc'] # -i to open index.html in dir
38+
dependencies = ["http", "doc-post-process"]
2839

29-
[tasks.doc-serve]
30-
run_task = [{ name = ['doc-http', "doc-post-proc"], parallel = true }]
40+
# just an alias
41+
[tasks.doc-build]
42+
run_task = "doc-post-process"
3143

44+
# needed for finding the files to modify in a cross platform way
3245
[tasks.fd]
3346
install_crate = { crate_name = "fd-find", binary = "fd", test_arg = ["--help"] }
3447

48+
# simple http server we can bootstrap from crates.io directly
3549
[tasks.http]
36-
install_crate = { crate_name = "http-server", binary = "http-server", test_arg = [
37-
"--help",
38-
] }
50+
install_crate = { crate_name = "http-server", binary = "http-server", test_arg = "--help" }
51+
52+
# that's us of course
53+
[tasks.cmb]
54+
install_crate = { crate_name = "cite-me-bro", binary = "cmb", test_arg = "--help" }

0 commit comments

Comments
 (0)