Skip to content

Commit

Permalink
wp: doc: add linking to docs
Browse files Browse the repository at this point in the history
these don't work perfectly.
  • Loading branch information
CGMossa committed Feb 28, 2024
1 parent b835eb0 commit 5cdd4c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions extendr-macros/src/extendr_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use crate::{extendr_options::ExtendrOptions, wrappers};
/// fn aux_func;
/// }
/// ```
#[doc(alias = "extendr-impl")]
pub fn extendr_impl(mut item_impl: ItemImpl, opts: &ExtendrOptions) -> TokenStream {
// Only `impl name { }` allowed
if item_impl.defaultness.is_some() {
Expand Down
13 changes: 13 additions & 0 deletions extendr-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, Item};


/// The `#[extendr]`-macro may be placed on three items
///
/// - `fn` for wrapped rust-functions, see [`extendr-fn`]
/// - `impl`-blocks, see [`extendr-impl`]
/// - `Rust enum`s as R factors, see [`extendr-enum`]
///
/// [`extendr-fn`]: extendr-macros/extendr_function/fn.extendr_function.html
/// [`extendr-impl`]: extendr_impl/fn.extendr_impl.html
/// [`extendr-enum`]: extendr_enum/fn.extendr_enum.html
///
/// There is also [extendr_module!], which is used for defining what rust
/// wrapped items should be visible to the surrounding R-package.
#[proc_macro_attribute]
pub fn extendr(attr: TokenStream, item: TokenStream) -> TokenStream {
let item = parse_macro_input!(item as Item);
Expand Down

0 comments on commit 5cdd4c3

Please sign in to comment.