Documentation ¶
Overview ¶
Package doc extracts source code documentation from a Magpie AST.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //PlaceHolder line, used only in html output. PlaceHolderTOC = "<p>__TOC_PLACEHOLDER_LINE_END__</p>" PlaceHolderShowSourceEnd = "<p>__SHOWSOURCE_PLACEHOLDER_LINE_END__</p>" Cfg = Config{} )
View Source
var ( //Predefined css style color BuiltinCssStyle = map[int][]string{ 0: []string{"black", "#f7f7f7", "#969896", "#795da3", "#333", "#a71d5d", "#333", "#333"}, 1: []string{"#dcdcdc", "#3f3f3f", "#7f9f7f", "#efef8f", "#efef8f", "#e3ceab", "#efef8f", "#efef8f"}, 2: []string{"#695d69", "#f7f3f7", "#379a37", "#776977", "#776977", "#7b59c0", "#776977", "#776977"}, 3: []string{"#5e6e5e", "#f0fff0", "#379a37", "#40a070", "#776977", "#ad2bee", "#776977", "#776977"}, 4: []string{"#5e6e5e", "#fbebd4", "#379a37", "#40a070", "#a57a4c", "#ad2bee", "#a57a4c", "#a57a4c"}, 5: []string{"#0ff", "navy", "#888", "#ff0", "#fff", "#fff", "#a57a4c", "#a57a4c"}, 6: []string{"#bbbb9d", "#282c34", "#969896", "#51b6c2", "#7cc379", "#c678dd", "#333", "#333"}, 7: []string{"#51616b", "#f2fbff", "grey", "green", "#008bb7", "#e68538", "#333", "#333"}, } )
Functions ¶
func HtmlDocGen ¶
HtmlDocGen generates html documentation from a markdown file.
func SanitizedAnchorName ¶
SanitizedAnchorName returns a sanitized anchor name for the given text. copied from 'Blackfriday': a markdown processor for Go.
Types ¶
type Classes ¶
type Classes struct { Value *Value Props []*Value //Properties Lets []*Value //Let-statements Funcs []*Function //Function }
Classes is the documention for a class
type File ¶
type File struct { Name string //FileName Classes []*Classes Enums []*Value Lets []*Value Consts []*Value Funcs []*Function GenHTML int }
File is the documentation for an entire magpie file.
type FuncInfo ¶
type FuncInfo struct { Name string //parameter name if @param, or else "" Type string //type Desc string //description }
function information(@param/@return/@returns part)
type Request ¶
type Request struct { Text string `json:"text"` Mode string `json:"mode"` Context string `json:"context"` }
Request for github REST API URL : https://developer.github.com/v3/markdown/
type Value ¶
type Value struct { Name string //name Doc string //comment Text string //declaration text ShowSrc int //should source or not, 1: show Src string //Source code text SrcLines int //number of lines of `Src`. GenHTML int //1: if generate html-style document }
Value is the documentation for a (possibly grouped) enums, lets, functions, or class declaration.
Click to show internal directories.
Click to hide internal directories.