1.0.13 • Published 12 months ago

solcco v1.0.13

Weekly downloads
17
License
MIT
Repository
github
Last release
12 months ago

Documentation generator for Solidity with a literary bent.

Features

  • Comments and code side-by-side
  • Markdown in comments
  • Contract code around an area
  • TOC navigation bar

Install

npm install solcco

Usage

tl;dr

CLI

npx -w solcco file

will output the documented version of file in out.html.

Library use

const solcco = require('solcco')({level: 3 /* max. heading level for toc */});
solcco.level = 1; // Changing your mind?
const html = solcco.run("/* # Heading */\n Struct s { uint s; }");

How to format comments

  • use markdown anywhere in comments
  • /* */ blocks for full paragraphs
  • whole-line // comments for quick annotations

More info

CLI

npx solcco --help for more options

File Hello.sol:

/* Compiler version must be greater than or equal to 0.6.10 and less than 0.7.0 */
pragma solidity ^0.6.10;

/* # Hello, World.
   The canonical hello world example */ 
contract HelloWorld {
    // make accessible
    string public greet = "Hello World!";
}

Then

npx solcco -f Hello.html Hello.sol

Outputs the following Hello.html.

How-to

  • // comments with not just whitespace to their left are not interpreted.
  • Special commands look like this: //+<command>+:
  • //+clear+ to force push an empty code block.
  • //+ignore+<anything here> to leave a line comment unintepreted.
  • Spaces at the beginning of lines in comment blocks (/* */) are ignored up to the position of the initial /*+3, so that Markdown's indentation-sensitivity and code block indents work well together.

References

This style was initiated (I think) by Docco. There are versions of this for plenty of languages at the link.

1.0.13

12 months ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago