You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing a proc-macro which allows users to generate Varnish caching proxy plugins. It would be good for users to automatically generate plugin documentation based on their code's doc comments, combined with the automatic comments by the proc-macro itself, and save that markdown file into the user's code tree.
Possible API:
// This is my proc-macro handleruse{proc_macro as pm, proc_macro2 as pm2};#[proc_macro_attribute]pubfnmy_attribute(args: pm::TokenStream,input: pm::TokenStream) -> pm::TokenStream{// Parse token stream into some itemletmut parsed_item_mod:ItemMod = syn::parse2::<ItemMod>(pm2::TokenStream::from(input)).unwrap();// modify parsed_item_mod doc attributes as needed// use readme's crate to generate some file// the item var might need to be wrapped into some syn::FileItem// Note that here I can control which code get documented and how
cargo_readme::generate_md_file(parsed_item_mod,"../GENERATED.md");// ... finish additional processing and return generated stream to the compiler}
The text was updated successfully, but these errors were encountered:
I am implementing a proc-macro which allows users to generate Varnish caching proxy plugins. It would be good for users to automatically generate plugin documentation based on their code's doc comments, combined with the automatic comments by the proc-macro itself, and save that markdown file into the user's code tree.
Possible API:
The text was updated successfully, but these errors were encountered: