Code Monkey home page Code Monkey logo

hq20 / soldoc Goto Github PK

View Code? Open in Web Editor NEW
62.0 5.0 9.0 4.37 MB

A solidity documentation generator, based in NatSpec format. :page_with_curl: with standalone HTML, pdf, gitbook and docsify output :pencil2: just plug and play.

Home Page: https://soldoc-demo.netlify.com/

License: GNU General Public License v3.0

JavaScript 34.63% HTML 27.69% TypeScript 25.09% Solidity 12.60%
solidity solidity-contracts solidity-documentation documentation document documentation-tool smart-contracts html pdf pdf-generation

soldoc's People

Contributors

connorltodd avatar dependabot-preview[bot] avatar dependabot[bot] avatar techhq-git avatar vibern0 avatar zlocate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

soldoc's Issues

List tests

Describe the solution you'd like
Most projects, if not all, have tests. Tests also work as documentation. They must be listed has part of the documentation.

Test ASCII in readme

Some people have asciis on their readmes.

                                                  `T",.`-,
                                                     '8, :.
                                              `""`oooob."T,.
                                            ,-`".)O;8:doob.'-.
                                     ,..`'.'' -dP()d8O8Yo8:,..`,
                                   -o8b-     ,..)doOO8:':o; `Y8.`,
                                  ,..bo.,.....)OOO888o' :oO.  ".  `-.
                                , "`"d....88OOOOO8O88o  :O8o;.    ;;,b
                               ,dOOOOO""""""""O88888o:  :O88Oo.;:o888d
                               ""888Ob...,-- :o88O88o:. :o'"""""""Y8OP
                               d8888.....,.. :o8OO888:: ::
                              "" .dOO8bo`'',,;O88O:O8o: ::,
                                 ,dd8".  ,-)do8O8o:"""; :::
                                 ,db(.  T)8P:8o:::::    :::
                                 -"",`(;O"KdOo::        :::
                                   ,K,'".doo:::'        :o:
                                    .doo:::"""::  :.    'o:
        ,..            .;ooooooo..o:"""""     ::;. ::;.  'o.
   ,, "'    ` ..   .d;o:"""'                  ::o:;::o::  :;
   d,         , ..ooo::;                      ::oo:;::o"'.:o
  ,d'.       :OOOOO8Oo::" '.. .               ::o8Ooo:;  ;o:
  'P"   ;  ;.OPd8888O8::;. 'oOoo:.;..         ;:O88Ooo:' O"'
  ,8:   o::oO` 88888OOo:::  o8O8Oo:::;;     ,;:oO88OOo;  '
 ,YP  ,::;:O:  888888o::::  :8888Ooo::::::::::oo888888o;. ,
 ',d: :;;O;:   :888888::o;  :8888888Ooooooooooo88888888Oo; ,
 dPY:  :o8O     YO8888O:O:;  O8888888888OOOO888"" Y8o:O88o; ,
,' O:  'ob`      "8888888Oo;;o8888888888888'"'     `8OO:.`OOb .
'  Y:  ,:o:       `8O88888OOoo"""""""""""'           `OOob`Y8b`
   ::  ';o:        `8O88o:oOoP                        `8Oo `YO.
   `:   Oo:         `888O::oP                          88O  :OY
    :o; 8oP         :888o::P                           do:  8O:
   ,ooO:8O'       ,d8888o:O'                          dOo   ;:.
   ;O8odo'        88888O:o'                          do::  oo.:
  d"`)8O'         "YO88Oo'                          "8O:   o8b'
 ''-'`"            d:O8oK  -hrr-                   dOOo'  :o":
                   O:8o:b.                        :88o:   `8:,
                   `8O:;7b,.                       `"8'     Y:
                    `YO;`8b'
                     `Oo; 8:.
                      `OP"8.`
                       :  Y8P
                       `o  `,
                        Y8bod.
                        `""""'

------------------------------------------------
Thank you for visiting https://asciiart.website/
This ASCII pic can be found at
https://asciiart.website//index.php?art=animals/horses

Add link to repository

Describe the solution you'd like
A link to the repository from the documentation. Maybe something like what happens with docsify when adding the git URL.

Request from HQ20/contracts#24

Constructor comments are not handled correctly

  • Version:v8.2.1
  • Platform:64-bit (Windows)
  • Subsystem:

Documentation generation fails when constructor comments are missing.

In file pdf.js line 55, I had to extend this:

if (contract.contractData.constructor !== null)

To this:

if (contract.contractData.constructor !== null && contract.contractData.constructor.comments !== undefined)

Thanks

ignore a function to be rendered

Describe the solution you'd like
Would be interesting to ignore specific methods to be rendered. something like

// soldoc-ignore
function some() public pure returns(uint) {
    return 0;
}

Add readme (if it exists) in index.html page

Describe the solution you'd like
It would be cool to have loaded the README.md in the main page (index.html) and maybe other .md's files like CONTRIBUTING.md, LICENSE, and others.

Make the function/event/variable tag a footer

The same that there is a coloured line at the top of each method/event/variable, there should be a ~10px footer in the same colour with the method/event/variable/constructor word within.

find all default .md files

Describe the solution you'd like
Right now, only the README.md and LICENSE are copied if they exist. And not across all of the 4 results.

First, it is necessary to have a method that is consistently called, whatever the desired result is.
Second, it is also necessary to look at other standard files, such as

  • CONTRIBUTING(.md)?
  • CODE_OF_CONDUCT(.md)?
  • SECURITY(.md)?

externalize templates

Describe the solution you'd like
If templates come from an external source, then it will allow others to contribute with templates.

BY default, we should have one template.

Observe inheritence

The current documentation only shows the members of the contracts themselves. Inherited functionality is an important part of the documentation picture.

Ignore Interfaces

Describe the solution you'd like
When coding a big project, there are some interfaces. They are not really necessary sometimes. A flag to avoid them all would be cool.

clean dependencies and add peerDependencies

Describe the solution you'd like
There are too many dependencies in soldoc, currently. First of all, soldoc is meant to be more like a plugin, not a system, so it shouldn't have grab dependencies with it. Some of those dependencies should be in devDependencies.

TypeError: Cannot read property 'get' of undefined

  • Node Version: v12.13.0
  • Soldoc Version: v0.1.2-beta.0
  • Platform: 16.04.1-Ubuntu x64

params: () => (val, render) => paramComments.get(render(val)),
TypeError: Cannot read property 'get' of undefined

I am getting this error when running soldoc on a particular contract. Strangely, it runs fine on contracts such as Ownable.sol (standard contract) and Migrations.sol (truffle suite).

After some manual debugging it seems to be related to the constructor having arguments. The constructor with arguments is throwing the error shown above.

Missing dependencies

This are missing dependencies required to run

npm install -D puppeteer typescript

Add .soldocignore file

Often same contracts (e.g external common deps) needs to be ignored from build process.
.soldocignore may resolve this case as .gitignore for git :)

Add option to ignore files.

Sometimes we may not want to get the documentation about a specific file. We need an option to ignore it!

'no viable alternative at input' when put comments in variables

  • Version: v0.1.2-beta.1
  • Platform: linux mint 19.2
  • Subsystem:
.../contracts/node_modules/soldoc/node_modules/solidity-parser-antlr/dist/index.js:79                                                                  
    throw new ParserError({ errors: listener.getErrors() });                                                                                                                                      
    ^                                                                                                                                                                                             
ParserError: no viable alternative at input '/**\n     * @dev All states ever created.\n     */mapping' (29:4)

This happens when doing something similar to

/**
* @notice All roles ever created.
*/
mapping (bytes32 => int) internal someVarName;

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.