Giter Club home page Giter Club logo

solmd's Introduction

solmd

Generate lightweight markdown documentation for Solidity contracts.

Build Status

Installation

npm install -g solmd
solmd <src> [--dest <target>]

Output will default to sol.md;

Uses Ethereum Natural Specification Format to generate method details.

// natspec example
/**
@title GavCoin
@author Gavin Wood
*/
contract GavCoin {
    /**
    @notice Send `(valueInmGAV / 1000).fixed(0,3)` GAV from the account of
    `message.caller.address()`, to an account accessible only by `to.address()
    @dev This should be the documentation of the function for the developer docs
    @param to The address of the recipient of the GavCoin
    @param valueInmGAV The GavCoin value to send
    @return {
        "done": "if done"
    }
    */
    function send(address to, uint256 valueInmGAV) returns (bool done) {
        if (balances[msg.sender] >= valueInmGAV) {
            balances[to] += valueInmGAV;
            balances[msg.sender] -= valueInmGAV;
            done = true;
        }
    }
}

Return params must be a single @param formatted as an object as shown above.

The above example will produce the following result as raw markdown.

* [GavCoin](#gavcoin)
  * [send](#function-send)

# GavCoin

Gavin Wood

## *function* send

GavCoin.Send(to, valueInmGAV) `d0679d34`

**Send `(valueInmGAV / 1000).fixed(0,3)` GAV from the account of `message.caller.address()`, to an account accessible only by `to.address()**

> This should be the documentation of the function for the developer docs

Inputs

| | | |
|-|-|-|
| *address* | to | The address of the recipient of the GavCoin |
| *uint256* | valueInmGAV | The GavCoin value to send |

Outputs

| | | |
|-|-|-|
| *bool* | done | if done |

---

The same output now parsed:

GavCoin

Gavin Wood

function send

d0679d34

Send (valueInmGAV / 1000).fixed(0,3) GAV from the account of message.caller.address(), to an account accessible only by `to.address()

This should be the documentation of the function for the developer docs

Inputs

address to The address of the recipient of the GavCoin
uint256 valueInmGAV The GavCoin value to send

License

MIT

solmd's People

Contributors

dpilch avatar jirkachadima avatar

Watchers

James Cloos avatar Tan Si Ling avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.