[contracts] Add docs generator for the contracts API to the #[define_env] macro (#13032)

* macro to expand traits for host functions documentation

* other way: same Doc trait in seal modules

* added docs for macro, and remove `doc` attribute

* fmt

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* make docs to be generated into re-exported `api_doc` module; fix
unrelated elder docs;

* make it compile without `doc` attr passed to macro

* make alias functions indicated explicitly in docs

* tidy up docs

* refactored a bit

* macro to auto-add doc warning for unstable functions

* invoke macro with no doc generation by default

* addressed review comments

* hide api_doc module behind cfg(doc)

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
Sasha Gryaznov
2023-01-06 01:22:43 +02:00
committed by GitHub
parent 876fccc0e5
commit 628efddce1
5 changed files with 242 additions and 116 deletions
+3
View File
@@ -134,6 +134,9 @@ pub use crate::{
wasm::Determinism,
};
#[cfg(doc)]
pub use crate::wasm::api_doc;
type CodeHash<T> = <T as frame_system::Config>::Hash;
type TrieId = BoundedVec<u8, ConstU32<128>>;
type BalanceOf<T> =