Add docs for bin source, not lib source code

If a crate has both a lib and a bin target, cargo will prefer to
generate for the library target[1]. By renaming the library target, we
force cargo to document the binary instead.

[1]: 3b379fcc54/src/doc/src/reference/cargo-targets.md (the-doc-field)
pull/146/head
miniduikboot 3 days ago
parent b97fd36ad5
commit 1f3cd0446d

@ -15,3 +15,10 @@ which = { workspace = true }
[[bin]]
name = "{{ project-name }}_ebpf"
path = "src/main.rs"
# Tip: if you want to get aya-ebpf documentation in your crate docs, try
# running `cargo doc --all`. This block makes cargo doc skip the dummy library
# (see {{ project-name }}/Cargo.toml for more details)
[lib]
name = "{{ project-name | snake_case }}_ebpf_dummy"
doc = false

Loading…
Cancel
Save