Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultBuilderData = "main.json" DefaultBuilderPath = ".builder" DefaultBuilderRunner = "main.go" )
View Source
const ( CmdDescription = "Generate documentation for the project that based on iris web framework" CmdName = "gen:doc" )
View Source
const ( OptBaseDir = "base-dir" OptBaseDirA = 'b' OptBaseDirDefault = "./" OptBaseDirDescription = "Application base directory" )
View Source
const ( OptControllerPath = "controller-path" OptControllerPathA = 'c' OptControllerPathDefault = "app/controllers" OptControllerPathDesc = "Controller files location" )
View Source
const ( OptOutputPath = "output-path" OptOutputPathA = 'o' OptOutputPathDefault = "docs/api" OptOutputPathDescription = "Generated markdown files exported to" )
View Source
const ( OptOutputFormat = "output-format" OptOutputFormatA = 'f' OptOutputFormatDescription = "Which format documents to export, accept one of" )
Variables ¶
View Source
var ( RegexScanEntityName = regexp.MustCompile(`^[a-zA-Z]`) RegexScanEntityFile = regexp.MustCompile(`\.go$`) RegexScanModuleName = regexp.MustCompile(`module\s+([^\n]+)`) )
View Source
var ( // RegexScannerIsComment like follows. // // - // // - // content RegexScannerIsComment = regexp.MustCompile(`^/{2,}(.*)`) // RegexScannerIsComment1 like follows. // // - * content RegexScannerIsComment1 = regexp.MustCompile(`^\*\s?`) // RegexScannerIsComment2 like follows. // // - /* RegexScannerIsComment2 = regexp.MustCompile(`^/\*+?`) // RegexScannerIsComment3 like follows. // // - */ RegexScannerIsComment3 = regexp.MustCompile(`\*/$`) RegexScannerMatchAnnotation = regexp.MustCompile(`^\s*@([a-zA-Z][_a-zA-Z0-9]*)\s*$`) RegexScannerMatchAnnotationValues = regexp.MustCompile(`^\s*@([a-zA-Z][_a-zA-Z0-9]*)\s*\(([^)]*)\)\s*$`) RegexScannerMatchAction = regexp.MustCompile("^([A-Z][a-z]*)([A-Z]*[a-zA-Z0-9]*)$") RegexScannerMatchCommentCode = regexp.MustCompile("`([^`]*)`") RegexScannerMatchCommentPre = regexp.MustCompile(`^\s+`) RegexScannerMatchCommentDotEnds = regexp.MustCompile(`\.+$`) RegexScannerMatchCommentTableStart = regexp.MustCompile(`^\t`) RegexScannerMatchMainFunc = regexp.MustCompile(`^func\s+main\s*\(\s*\)\s*\{`) // RegexScannerMatchPackage like follows. // // - package main // - package controllers RegexScannerMatchPackage = regexp.MustCompile(`^package\s+(\S+)$`) // RegexScannerMatchFunc like follows. // // func (c *Controller) Post(ctx iris.Context) { RegexScannerMatchFunc = regexp.MustCompile(`^func\s*\(\s*[_a-zA-Z0-9]*\s*\*?([A-Z][_a-zA-Z0-9]*)\s*\)\s*([A-Z][_a-z0-9A-Z]*)\s*\(`) // RegexScannerMatchStruct like follows. // // type Controller struct { // ... // } RegexScannerMatchStruct = regexp.MustCompile(`^type\s+([A-Z][_a-zA-Z0-9]*)\s+struct\s*\{`) // RegexScannerMatchStructGroup like follows. // // var ( // Controller struct { // ... // } // ) RegexScannerMatchStructGroup = regexp.MustCompile(`^([A-Z][_a-zA-Z0-9]*)\s*struct\s*\{`) )
View Source
var (
Output console.Output
)
View Source
var (
RegexActionMatchUpper = regexp.MustCompile(`([A-Z])`)
)
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format string
Format is a type name that represents the output documents format.
const ( FormatHtml Format = "html" FormatMarkdown Format = "md" // DefaultFormat // is the default format if not specified. DefaultFormat = FormatMarkdown )
func (Format) IsMarkdown ¶
IsMarkdown returns true if the format is markdown.
Click to show internal directories.
Click to hide internal directories.