From 5cdd4c3bb718527c7cfc7e5bcde765863d1cfdf4 Mon Sep 17 00:00:00 2001 From: Mossa Date: Wed, 28 Feb 2024 23:45:50 +0100 Subject: [PATCH] wp: doc: add linking to docs these don't work perfectly. --- extendr-macros/src/extendr_impl.rs | 1 + extendr-macros/src/lib.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/extendr-macros/src/extendr_impl.rs b/extendr-macros/src/extendr_impl.rs index 68814c98ab..8d7a91c809 100644 --- a/extendr-macros/src/extendr_impl.rs +++ b/extendr-macros/src/extendr_impl.rs @@ -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() { diff --git a/extendr-macros/src/lib.rs b/extendr-macros/src/lib.rs index 8d1a8ece71..f7327a7183 100644 --- a/extendr-macros/src/lib.rs +++ b/extendr-macros/src/lib.rs @@ -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);