Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@ltfschoen
Copy link
Contributor

@ltfschoen ltfschoen added A0-please_review Pull request needs code review. M3-docs labels Mar 7, 2019
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();
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

@ltfschoen ltfschoen Mar 11, 2019

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

Copy link
Member

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".

Copy link
Contributor Author

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

@ltfschoen
Copy link
Contributor Author

ltfschoen commented Mar 14, 2019

@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.
You can build the docs with cargo doc --package srml-example --open
Should I remove the "Implementation Details" and "Extensibility" sections?
UPDATE: I've removed the "Implementation Details" (since it was requested by Gav here #1927 (comment))

Screenshot:

Screen Shot 2019-03-14 at 3 52 51 pm

@ltfschoen
Copy link
Contributor Author

On hold, pending Assets module #1945

@ltfschoen ltfschoen removed the A0-please_review Pull request needs code review. label Mar 20, 2019
@gavofyork gavofyork merged commit cea6d5f into master Apr 23, 2019
@gavofyork gavofyork deleted the luke-example-module-docs branch April 23, 2019 18:02
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Jul 10, 2019
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants