Skip to content
Discussion options

You must be logged in to vote

Documenting view functions

Documentation needs to be attached to the item associated. This is a little bit more picky than say with something like Rust.

For view functions

Below is an example of how to use with a view function:

/// My awesome module
module 0x42::example { // double slash can be anywhere

  // Double slash can be anywhere

  /// My awesome constant
  const MY_VALUE: u64 = 5;
   
  /// My awesome error message
  const E_MY_ERROR: u64 = 10;

  #[view]
  /// My awesome view function
  fun show_me_the_money() {
    // ...
  }
}

Comments that will fail

Below here are examples of doc comments /// that will fail

module 0x42::example {

  /// My awesome view function <- must be be…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 0x-j
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move Questions related to the Move Language
2 participants