Skip to content

Commit

Permalink
Fix/overview license (#20)
Browse files Browse the repository at this point in the history
* updated package json

* change titles
  • Loading branch information
dovgopoly authored Oct 5, 2023
1 parent 091c0ce commit 11505ae
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solarity/hardhat-markup",
"version": "1.0.2",
"version": "1.0.3",
"description": "Customizable markdown smart contracts documentation",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
10 changes: 3 additions & 7 deletions src/generator/md-generator/MDGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ContractInfo, Documentation, DocumentationBlock, NatSpecDocumentation } from "../../parser/types";
import { CONTRACT_NAME_H_SIZE, FUNCTION_NAME_H_SIZE } from "./constants";
import { CONTRACT_NAME_H_SIZE, FUNCTION_NAME_H_SIZE, LICENSE_H_SIZE } from "./constants";
import { MDFactory } from "./MDFactory";

export class MDGenerator {
Expand All @@ -11,12 +11,8 @@ export class MDGenerator {
const mdFactory: MDFactory = new MDFactory();

mdFactory.addHeaderTag(contractInfo.name, CONTRACT_NAME_H_SIZE);
mdFactory.addHeaderTag(
`${contractInfo.isAbstract ? "Abstract " : ""}${this.capitalizeFirstLetter(
contractInfo.contractKind
)} Description`
);
mdFactory.addParagraphTag(`License: ${contractInfo.license}`);
mdFactory.addHeaderTag("Overview");
mdFactory.addHeaderTag(`License: ${contractInfo.license}`, LICENSE_H_SIZE);

contractInfo.documentations.forEach((blockInfos) => {
this.generateBlockInfo(mdFactory, blockInfos);
Expand Down
1 change: 1 addition & 0 deletions src/generator/md-generator/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const CONTRACT_NAME_H_SIZE = 1;
export const TOPIC_H_SIZE = 2;
export const FUNCTION_NAME_H_SIZE = 3;
export const FUNCTION_INSIDE_H_SIZE = 4;
export const LICENSE_H_SIZE = 4;
export const DEFAULT_CODE_LANGUAGE = "solidity";
export const DEFAULT_TABLE_ALIGN = AlignTypes.LEFT;
export const FULL_METHOD_SIGN_MAX_LENGTH = 99;

0 comments on commit 11505ae

Please sign in to comment.