-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Documentation for example module #1947
Conversation
srml/example/README.adoc
Outdated
| 2. In your module call the `INSERT_MODULE_NAME` module's `example_getter_name()` function to get <EXPLAIN_WHAT_IT_RETURNS>. | ||
|
|
||
| ``` | ||
| const example_value = <INSERT_MODULE_NAME>::Module<T>>::example_getter_name(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you want to tell us here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a commit to try an make it clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you just want to show standard rust syntax for calling methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, i'm not sure what change you're implying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkchr I've pushed a commit that removes the steps that show a user how to call getter and setter methods and just left a comment there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example you showed was just about "how to call a function".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was a dismal example. I'm going to try and approach it similar to the example that's evolving in #1943
|
@bkchr I've pushed a commit that moves the docs into lib.rs based on review comments, and the docs for the staking module that's been approved. In the docs you can show/hide the "Documentation Template" by clicking the "> Details" link as shown in below screenshot. Screenshot: |
|
On hold, pending Assets module #1945 |
* WIP: SRML Example Module README * add newlines * review-fix: Change const to let. Explain generic usage more * refactor: Remove example steps 2 and 3. User can refer to other examples to figure it out * fix: Update to incorporate approved approach of staking module docs in PR paritytech#1951 * fix: Move into expandable Details arrow and fix syntax so appears correctly in rust docs * fix: Fix linting * docs: Add Public Dispatchable functions * fix: Rearrange to use Simple Code Snippet and Examples from SRML * fix: Remove duplicate Dispatchable Functions section * fix: Remove Implementation Details as requested by Gav

Relates to polkadot-developers/substrate-developer-hub.github.io#44