Skip to main content

link_to_wgpu_docs

Macro link_to_wgpu_docs 

Source
macro_rules! link_to_wgpu_docs {
    ([$reference:expr]: $url_path:expr) => { ... };
    (../ [$reference:expr]: $url_path:expr) => { ... };
}
Expand description

Create a Markdown link definition referring to the wgpu crate.

This macro should be used inside a #[doc = ...] attribute. The two arguments should be string literals or macros that expand to string literals. If the module in which the item using this macro is located is not the crate root, use the ../ syntax.

We cannot simply use rustdoc links to wgpu because it is one of our dependents. This link adapts to work in locally generated documentation (cargo doc) by default, and work with docs.rs URL structure when building for docs.rs.

Note: This macro cannot be used outside this crate, because cfg(docsrs) will not apply.