github.com/anthonyme00/gomarkdoc@v1.0.0/lang/README.md (about)

     1  <!-- Code generated by gomarkdoc. DO NOT EDIT -->
     2  
     3  # lang
     4  
     5  ```go
     6  import "github.com/anthonyme00/gomarkdoc/lang"
     7  ```
     8  
     9  Package lang provides constructs for defining golang language constructs and extracting information from them for documentation purposes.
    10  
    11  ## Index
    12  
    13  - [func PackageSymbols\(pkg \*doc.Package\) map\[string\]Symbol](<#PackageSymbols>)
    14  - [type Block](<#Block>)
    15    - [func NewBlock\(cfg \*Config, kind BlockKind, spans \[\]\*Span, inline bool\) \*Block](<#NewBlock>)
    16    - [func NewListBlock\(cfg \*Config, list \*List, inline bool\) \*Block](<#NewListBlock>)
    17    - [func ParseBlocks\(cfg \*Config, blocks \[\]comment.Block, inline bool\) \[\]\*Block](<#ParseBlocks>)
    18    - [func \(b \*Block\) Inline\(\) bool](<#Block.Inline>)
    19    - [func \(b \*Block\) Kind\(\) BlockKind](<#Block.Kind>)
    20    - [func \(b \*Block\) Level\(\) int](<#Block.Level>)
    21    - [func \(b \*Block\) List\(\) \*List](<#Block.List>)
    22    - [func \(b \*Block\) Spans\(\) \[\]\*Span](<#Block.Spans>)
    23  - [type BlockKind](<#BlockKind>)
    24  - [type Config](<#Config>)
    25    - [func NewConfig\(log logger.Logger, workDir string, pkgDir string, opts ...ConfigOption\) \(\*Config, error\)](<#NewConfig>)
    26    - [func \(c \*Config\) Inc\(step int\) \*Config](<#Config.Inc>)
    27  - [type ConfigOption](<#ConfigOption>)
    28    - [func ConfigWithRepoOverrides\(overrides \*Repo\) ConfigOption](<#ConfigWithRepoOverrides>)
    29  - [type Doc](<#Doc>)
    30    - [func NewDoc\(cfg \*Config, text string\) \*Doc](<#NewDoc>)
    31    - [func \(d \*Doc\) Blocks\(\) \[\]\*Block](<#Doc.Blocks>)
    32    - [func \(d \*Doc\) Level\(\) int](<#Doc.Level>)
    33  - [type Example](<#Example>)
    34    - [func NewExample\(cfg \*Config, name string, doc \*doc.Example\) \*Example](<#NewExample>)
    35    - [func \(ex \*Example\) Code\(\) \(string, error\)](<#Example.Code>)
    36    - [func \(ex \*Example\) Doc\(\) \*Doc](<#Example.Doc>)
    37    - [func \(ex \*Example\) HasOutput\(\) bool](<#Example.HasOutput>)
    38    - [func \(ex \*Example\) Level\(\) int](<#Example.Level>)
    39    - [func \(ex \*Example\) Location\(\) Location](<#Example.Location>)
    40    - [func \(ex \*Example\) Name\(\) string](<#Example.Name>)
    41    - [func \(ex \*Example\) Output\(\) string](<#Example.Output>)
    42    - [func \(ex \*Example\) Summary\(\) string](<#Example.Summary>)
    43    - [func \(ex \*Example\) Title\(\) string](<#Example.Title>)
    44  - [type File](<#File>)
    45    - [func NewFile\(header, footer string, packages \[\]\*Package\) \*File](<#NewFile>)
    46  - [type Func](<#Func>)
    47    - [func NewFunc\(cfg \*Config, doc \*doc.Func, examples \[\]\*doc.Example\) \*Func](<#NewFunc>)
    48    - [func \(fn \*Func\) Anchor\(\) string](<#Func.Anchor>)
    49    - [func \(fn \*Func\) Doc\(\) \*Doc](<#Func.Doc>)
    50    - [func \(fn \*Func\) Examples\(\) \(examples \[\]\*Example\)](<#Func.Examples>)
    51    - [func \(fn \*Func\) Level\(\) int](<#Func.Level>)
    52    - [func \(fn \*Func\) Location\(\) Location](<#Func.Location>)
    53    - [func \(fn \*Func\) Name\(\) string](<#Func.Name>)
    54    - [func \(fn \*Func\) Receiver\(\) string](<#Func.Receiver>)
    55    - [func \(fn \*Func\) Signature\(\) \(string, error\)](<#Func.Signature>)
    56    - [func \(fn \*Func\) Summary\(\) string](<#Func.Summary>)
    57    - [func \(fn \*Func\) Title\(\) string](<#Func.Title>)
    58  - [type Item](<#Item>)
    59    - [func NewItem\(cfg \*Config, docItem \*comment.ListItem\) \*Item](<#NewItem>)
    60    - [func \(i \*Item\) Blocks\(\) \[\]\*Block](<#Item.Blocks>)
    61    - [func \(i \*Item\) Kind\(\) ItemKind](<#Item.Kind>)
    62    - [func \(i \*Item\) Number\(\) int](<#Item.Number>)
    63  - [type ItemKind](<#ItemKind>)
    64  - [type List](<#List>)
    65    - [func NewList\(cfg \*Config, docList \*comment.List\) \*List](<#NewList>)
    66    - [func \(l \*List\) BlankBetween\(\) bool](<#List.BlankBetween>)
    67    - [func \(l \*List\) Items\(\) \[\]\*Item](<#List.Items>)
    68  - [type Location](<#Location>)
    69    - [func NewLocation\(cfg \*Config, node ast.Node\) Location](<#NewLocation>)
    70  - [type Package](<#Package>)
    71    - [func NewPackage\(cfg \*Config, examples \[\]\*doc.Example\) \*Package](<#NewPackage>)
    72    - [func NewPackageFromBuild\(log logger.Logger, pkg \*build.Package, opts ...PackageOption\) \(\*Package, error\)](<#NewPackageFromBuild>)
    73    - [func \(pkg \*Package\) Consts\(\) \(consts \[\]\*Value\)](<#Package.Consts>)
    74    - [func \(pkg \*Package\) Dir\(\) string](<#Package.Dir>)
    75    - [func \(pkg \*Package\) Dirname\(\) string](<#Package.Dirname>)
    76    - [func \(pkg \*Package\) Doc\(\) \*Doc](<#Package.Doc>)
    77    - [func \(pkg \*Package\) Examples\(\) \(examples \[\]\*Example\)](<#Package.Examples>)
    78    - [func \(pkg \*Package\) Funcs\(\) \(funcs \[\]\*Func\)](<#Package.Funcs>)
    79    - [func \(pkg \*Package\) Import\(\) string](<#Package.Import>)
    80    - [func \(pkg \*Package\) ImportPath\(\) string](<#Package.ImportPath>)
    81    - [func \(pkg \*Package\) Level\(\) int](<#Package.Level>)
    82    - [func \(pkg \*Package\) Name\(\) string](<#Package.Name>)
    83    - [func \(pkg \*Package\) Summary\(\) string](<#Package.Summary>)
    84    - [func \(pkg \*Package\) Types\(\) \(types \[\]\*Type\)](<#Package.Types>)
    85    - [func \(pkg \*Package\) Vars\(\) \(vars \[\]\*Value\)](<#Package.Vars>)
    86  - [type PackageOption](<#PackageOption>)
    87    - [func PackageWithRepositoryOverrides\(repo \*Repo\) PackageOption](<#PackageWithRepositoryOverrides>)
    88    - [func PackageWithUnexportedIncluded\(\) PackageOption](<#PackageWithUnexportedIncluded>)
    89  - [type PackageOptions](<#PackageOptions>)
    90  - [type Position](<#Position>)
    91  - [type Repo](<#Repo>)
    92  - [type Span](<#Span>)
    93    - [func NewSpan\(cfg \*Config, kind SpanKind, text string, url string\) \*Span](<#NewSpan>)
    94    - [func ParseSpans\(cfg \*Config, texts \[\]comment.Text\) \[\]\*Span](<#ParseSpans>)
    95    - [func \(s \*Span\) Kind\(\) SpanKind](<#Span.Kind>)
    96    - [func \(s \*Span\) Text\(\) string](<#Span.Text>)
    97    - [func \(s \*Span\) URL\(\) string](<#Span.URL>)
    98  - [type SpanKind](<#SpanKind>)
    99  - [type Symbol](<#Symbol>)
   100    - [func \(s Symbol\) Anchor\(\) string](<#Symbol.Anchor>)
   101  - [type SymbolKind](<#SymbolKind>)
   102  - [type Type](<#Type>)
   103    - [func NewType\(cfg \*Config, doc \*doc.Type, examples \[\]\*doc.Example\) \*Type](<#NewType>)
   104    - [func \(typ \*Type\) Anchor\(\) string](<#Type.Anchor>)
   105    - [func \(typ \*Type\) Consts\(\) \[\]\*Value](<#Type.Consts>)
   106    - [func \(typ \*Type\) Decl\(\) \(string, error\)](<#Type.Decl>)
   107    - [func \(typ \*Type\) Doc\(\) \*Doc](<#Type.Doc>)
   108    - [func \(typ \*Type\) Examples\(\) \(examples \[\]\*Example\)](<#Type.Examples>)
   109    - [func \(typ \*Type\) Funcs\(\) \[\]\*Func](<#Type.Funcs>)
   110    - [func \(typ \*Type\) Level\(\) int](<#Type.Level>)
   111    - [func \(typ \*Type\) Location\(\) Location](<#Type.Location>)
   112    - [func \(typ \*Type\) Methods\(\) \[\]\*Func](<#Type.Methods>)
   113    - [func \(typ \*Type\) Name\(\) string](<#Type.Name>)
   114    - [func \(typ \*Type\) Summary\(\) string](<#Type.Summary>)
   115    - [func \(typ \*Type\) Title\(\) string](<#Type.Title>)
   116    - [func \(typ \*Type\) Vars\(\) \[\]\*Value](<#Type.Vars>)
   117  - [type Value](<#Value>)
   118    - [func NewValue\(cfg \*Config, doc \*doc.Value\) \*Value](<#NewValue>)
   119    - [func \(v \*Value\) Anchor\(\) string](<#Value.Anchor>)
   120    - [func \(v \*Value\) Decl\(\) \(string, error\)](<#Value.Decl>)
   121    - [func \(v \*Value\) Doc\(\) \*Doc](<#Value.Doc>)
   122    - [func \(v \*Value\) Level\(\) int](<#Value.Level>)
   123    - [func \(v \*Value\) Location\(\) Location](<#Value.Location>)
   124    - [func \(v \*Value\) Summary\(\) string](<#Value.Summary>)
   125  
   126  
   127  <a name="PackageSymbols"></a>
   128  ## func [PackageSymbols](<https://github.com/princjef/gomarkdoc/blob/master/lang/symbol.go#L38>)
   129  
   130  ```go
   131  func PackageSymbols(pkg *doc.Package) map[string]Symbol
   132  ```
   133  
   134  PackageSymbols gets the list of symbols for a doc package.
   135  
   136  <a name="Block"></a>
   137  ## type [Block](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L11-L17>)
   138  
   139  Block defines a single block element \(e.g. paragraph, code block\) in the documentation for a symbol or package.
   140  
   141  ```go
   142  type Block struct {
   143      // contains filtered or unexported fields
   144  }
   145  ```
   146  
   147  <a name="NewBlock"></a>
   148  ### func [NewBlock](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L41>)
   149  
   150  ```go
   151  func NewBlock(cfg *Config, kind BlockKind, spans []*Span, inline bool) *Block
   152  ```
   153  
   154  NewBlock creates a new block element of the provided kind and with the given text spans and a flag indicating whether this block is part of an inline element.
   155  
   156  <a name="NewListBlock"></a>
   157  ### func [NewListBlock](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L48>)
   158  
   159  ```go
   160  func NewListBlock(cfg *Config, list *List, inline bool) *Block
   161  ```
   162  
   163  NewListBlock creates a new list block element and with the given list definition and a flag indicating whether this block is part of an inline element.
   164  
   165  <a name="ParseBlocks"></a>
   166  ### func [ParseBlocks](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L87>)
   167  
   168  ```go
   169  func ParseBlocks(cfg *Config, blocks []comment.Block, inline bool) []*Block
   170  ```
   171  
   172  ParseBlocks produces a set of blocks from the corresponding comment blocks. It also takes a flag indicating whether the blocks are part of an inline element such as a list item.
   173  
   174  <a name="Block.Inline"></a>
   175  ### func \(\*Block\) [Inline](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L80>)
   176  
   177  ```go
   178  func (b *Block) Inline() bool
   179  ```
   180  
   181  Inline indicates whether the block is part of an inline element, such as a list item.
   182  
   183  <a name="Block.Kind"></a>
   184  ### func \(\*Block\) [Kind](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L60>)
   185  
   186  ```go
   187  func (b *Block) Kind() BlockKind
   188  ```
   189  
   190  Kind provides the kind of data that this block's text should be interpreted as.
   191  
   192  <a name="Block.Level"></a>
   193  ### func \(\*Block\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L54>)
   194  
   195  ```go
   196  func (b *Block) Level() int
   197  ```
   198  
   199  Level provides the default level that a block of kind HeaderBlock will render at in the output. The level is not used for other block types.
   200  
   201  <a name="Block.List"></a>
   202  ### func \(\*Block\) [List](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L74>)
   203  
   204  ```go
   205  func (b *Block) List() *List
   206  ```
   207  
   208  List provides the list contents for a list block. Only relevant for blocks of type ListBlock.
   209  
   210  <a name="Block.Spans"></a>
   211  ### func \(\*Block\) [Spans](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L68>)
   212  
   213  ```go
   214  func (b *Block) Spans() []*Span
   215  ```
   216  
   217  Spans provides the raw text of the block's contents as a set of text spans. The text is pre\-scrubbed and sanitized as determined by the block's Kind\(\), but it is not wrapped in any special constructs for rendering purposes \(such as markdown code blocks\).
   218  
   219  <a name="BlockKind"></a>
   220  ## type [BlockKind](<https://github.com/princjef/gomarkdoc/blob/master/lang/block.go#L21>)
   221  
   222  BlockKind identifies the type of block element represented by the corresponding Block.
   223  
   224  ```go
   225  type BlockKind string
   226  ```
   227  
   228  <a name="ParagraphBlock"></a>
   229  
   230  ```go
   231  const (
   232      // ParagraphBlock defines a block that represents a paragraph of text.
   233      ParagraphBlock BlockKind = "paragraph"
   234  
   235      // CodeBlock defines a block that represents a section of code.
   236      CodeBlock BlockKind = "code"
   237  
   238      // HeaderBlock defines a block that represents a section header.
   239      HeaderBlock BlockKind = "header"
   240  
   241      // ListBlock defines a block that represents an ordered or unordered list.
   242      ListBlock BlockKind = "list"
   243  )
   244  ```
   245  
   246  <a name="Config"></a>
   247  ## type [Config](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L25-L35>)
   248  
   249  Config defines contextual information used to resolve documentation for a construct.
   250  
   251  ```go
   252  type Config struct {
   253      FileSet *token.FileSet
   254      Files   []*ast.File
   255      Level   int
   256      Repo    *Repo
   257      PkgDir  string
   258      WorkDir string
   259      Symbols map[string]Symbol
   260      Pkg     *doc.Package
   261      Log     logger.Logger
   262  }
   263  ```
   264  
   265  <a name="NewConfig"></a>
   266  ### func [NewConfig](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L69>)
   267  
   268  ```go
   269  func NewConfig(log logger.Logger, workDir string, pkgDir string, opts ...ConfigOption) (*Config, error)
   270  ```
   271  
   272  NewConfig generates a Config for the provided package directory. It will resolve the filepath and attempt to determine the repository containing the directory. If no repository is found, the Repo field will be set to nil. An error is returned if the provided directory is invalid.
   273  
   274  <a name="Config.Inc"></a>
   275  ### func \(\*Config\) [Inc](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L124>)
   276  
   277  ```go
   278  func (c *Config) Inc(step int) *Config
   279  ```
   280  
   281  Inc copies the Config and increments the level by the provided step.
   282  
   283  <a name="ConfigOption"></a>
   284  ## type [ConfigOption](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L62>)
   285  
   286  ConfigOption modifies the Config generated by NewConfig.
   287  
   288  ```go
   289  type ConfigOption func(c *Config) error
   290  ```
   291  
   292  <a name="ConfigWithRepoOverrides"></a>
   293  ### func [ConfigWithRepoOverrides](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L140>)
   294  
   295  ```go
   296  func ConfigWithRepoOverrides(overrides *Repo) ConfigOption
   297  ```
   298  
   299  ConfigWithRepoOverrides defines a set of manual overrides for the repository information to be used in place of automatic repository detection.
   300  
   301  <a name="Doc"></a>
   302  ## type [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/doc.go#L5-L8>)
   303  
   304  Doc provides access to the documentation comment contents for a package or symbol in a structured form.
   305  
   306  ```go
   307  type Doc struct {
   308      // contains filtered or unexported fields
   309  }
   310  ```
   311  
   312  <a name="NewDoc"></a>
   313  ### func [NewDoc](<https://github.com/princjef/gomarkdoc/blob/master/lang/doc.go#L14>)
   314  
   315  ```go
   316  func NewDoc(cfg *Config, text string) *Doc
   317  ```
   318  
   319  NewDoc initializes a Doc struct from the provided raw documentation text and with headers rendered by default at the heading level provided. Documentation is separated into block level elements using the standard rules from golang's documentation conventions.
   320  
   321  <a name="Doc.Blocks"></a>
   322  ### func \(\*Doc\) [Blocks](<https://github.com/princjef/gomarkdoc/blob/master/lang/doc.go#L33>)
   323  
   324  ```go
   325  func (d *Doc) Blocks() []*Block
   326  ```
   327  
   328  Blocks holds the list of block elements that makes up the documentation contents.
   329  
   330  <a name="Doc.Level"></a>
   331  ### func \(\*Doc\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/doc.go#L27>)
   332  
   333  ```go
   334  func (d *Doc) Level() int
   335  ```
   336  
   337  Level provides the default level that headers within the documentation should be rendered
   338  
   339  <a name="Example"></a>
   340  ## type [Example](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L11-L15>)
   341  
   342  Example holds a single documentation example for a package or symbol.
   343  
   344  ```go
   345  type Example struct {
   346      // contains filtered or unexported fields
   347  }
   348  ```
   349  
   350  <a name="NewExample"></a>
   351  ### func [NewExample](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L19>)
   352  
   353  ```go
   354  func NewExample(cfg *Config, name string, doc *doc.Example) *Example
   355  ```
   356  
   357  NewExample creates a new example from the example function's name, its documentation example and the files holding code related to the example.
   358  
   359  <a name="Example.Code"></a>
   360  ### func \(\*Example\) [Code](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L65>)
   361  
   362  ```go
   363  func (ex *Example) Code() (string, error)
   364  ```
   365  
   366  Code provides the raw text code representation of the example's contents.
   367  
   368  <a name="Example.Doc"></a>
   369  ### func \(\*Example\) [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L60>)
   370  
   371  ```go
   372  func (ex *Example) Doc() *Doc
   373  ```
   374  
   375  Doc provides the structured contents of the documentation comment for the example.
   376  
   377  <a name="Example.HasOutput"></a>
   378  ### func \(\*Example\) [HasOutput](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L99>)
   379  
   380  ```go
   381  func (ex *Example) HasOutput() bool
   382  ```
   383  
   384  HasOutput indicates whether the example contains any example output.
   385  
   386  <a name="Example.Level"></a>
   387  ### func \(\*Example\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L25>)
   388  
   389  ```go
   390  func (ex *Example) Level() int
   391  ```
   392  
   393  Level provides the default level that headers for the example should be rendered.
   394  
   395  <a name="Example.Location"></a>
   396  ### func \(\*Example\) [Location](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L48>)
   397  
   398  ```go
   399  func (ex *Example) Location() Location
   400  ```
   401  
   402  Location returns a representation of the node's location in a file within a repository.
   403  
   404  <a name="Example.Name"></a>
   405  ### func \(\*Example\) [Name](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L31>)
   406  
   407  ```go
   408  func (ex *Example) Name() string
   409  ```
   410  
   411  Name provides a pretty\-printed name for the specific example, if one was provided.
   412  
   413  <a name="Example.Output"></a>
   414  ### func \(\*Example\) [Output](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L94>)
   415  
   416  ```go
   417  func (ex *Example) Output() string
   418  ```
   419  
   420  Output provides the code's example output.
   421  
   422  <a name="Example.Summary"></a>
   423  ### func \(\*Example\) [Summary](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L54>)
   424  
   425  ```go
   426  func (ex *Example) Summary() string
   427  ```
   428  
   429  Summary provides the one\-sentence summary of the example's documentation comment.
   430  
   431  <a name="Example.Title"></a>
   432  ### func \(\*Example\) [Title](<https://github.com/princjef/gomarkdoc/blob/master/lang/example.go#L37>)
   433  
   434  ```go
   435  func (ex *Example) Title() string
   436  ```
   437  
   438  Title provides a formatted string to print as the title of the example. It incorporates the example's name, if present.
   439  
   440  <a name="File"></a>
   441  ## type [File](<https://github.com/princjef/gomarkdoc/blob/master/lang/file.go#L5-L9>)
   442  
   443  File holds information for rendering a single file that contains one or more packages.
   444  
   445  ```go
   446  type File struct {
   447      Header   string
   448      Footer   string
   449      Packages []*Package
   450  }
   451  ```
   452  
   453  <a name="NewFile"></a>
   454  ### func [NewFile](<https://github.com/princjef/gomarkdoc/blob/master/lang/file.go#L12>)
   455  
   456  ```go
   457  func NewFile(header, footer string, packages []*Package) *File
   458  ```
   459  
   460  NewFile creates a new instance of File with the provided information.
   461  
   462  <a name="Func"></a>
   463  ## type [Func](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L12-L16>)
   464  
   465  Func holds documentation information for a single func declaration within a package or type.
   466  
   467  ```go
   468  type Func struct {
   469      // contains filtered or unexported fields
   470  }
   471  ```
   472  
   473  <a name="NewFunc"></a>
   474  ### func [NewFunc](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L21>)
   475  
   476  ```go
   477  func NewFunc(cfg *Config, doc *doc.Func, examples []*doc.Example) *Func
   478  ```
   479  
   480  NewFunc creates a new Func from the corresponding documentation construct from the standard library, the related token.FileSet for the package and the list of examples for the package.
   481  
   482  <a name="Func.Anchor"></a>
   483  ### func \(\*Func\) [Anchor](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L107>)
   484  
   485  ```go
   486  func (fn *Func) Anchor() string
   487  ```
   488  
   489  Anchor produces anchor text for the func.
   490  
   491  <a name="Func.Doc"></a>
   492  ### func \(\*Func\) [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L66>)
   493  
   494  ```go
   495  func (fn *Func) Doc() *Doc
   496  ```
   497  
   498  Doc provides the structured contents of the documentation comment for the function.
   499  
   500  <a name="Func.Examples"></a>
   501  ### func \(\*Func\) [Examples](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L79>)
   502  
   503  ```go
   504  func (fn *Func) Examples() (examples []*Example)
   505  ```
   506  
   507  Examples provides the list of examples from the list given on initialization that pertain to the function.
   508  
   509  <a name="Func.Level"></a>
   510  ### func \(\*Func\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L27>)
   511  
   512  ```go
   513  func (fn *Func) Level() int
   514  ```
   515  
   516  Level provides the default level at which headers for the func should be rendered in the final documentation.
   517  
   518  <a name="Func.Location"></a>
   519  ### func \(\*Func\) [Location](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L54>)
   520  
   521  ```go
   522  func (fn *Func) Location() Location
   523  ```
   524  
   525  Location returns a representation of the node's location in a file within a repository.
   526  
   527  <a name="Func.Name"></a>
   528  ### func \(\*Func\) [Name](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L32>)
   529  
   530  ```go
   531  func (fn *Func) Name() string
   532  ```
   533  
   534  Name provides the name of the function.
   535  
   536  <a name="Func.Receiver"></a>
   537  ### func \(\*Func\) [Receiver](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L48>)
   538  
   539  ```go
   540  func (fn *Func) Receiver() string
   541  ```
   542  
   543  Receiver provides the type of the receiver for the function, or empty string if there is no receiver type.
   544  
   545  <a name="Func.Signature"></a>
   546  ### func \(\*Func\) [Signature](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L72>)
   547  
   548  ```go
   549  func (fn *Func) Signature() (string, error)
   550  ```
   551  
   552  Signature provides the raw text representation of the code for the function's signature.
   553  
   554  <a name="Func.Summary"></a>
   555  ### func \(\*Func\) [Summary](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L60>)
   556  
   557  ```go
   558  func (fn *Func) Summary() string
   559  ```
   560  
   561  Summary provides the one\-sentence summary of the function's documentation comment
   562  
   563  <a name="Func.Title"></a>
   564  ### func \(\*Func\) [Title](<https://github.com/princjef/gomarkdoc/blob/master/lang/func.go#L38>)
   565  
   566  ```go
   567  func (fn *Func) Title() string
   568  ```
   569  
   570  Title provides the formatted name of the func. It is primarily designed for generating headers.
   571  
   572  <a name="Item"></a>
   573  ## type [Item](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L51-L55>)
   574  
   575  Item defines a single item in a list in the documentation for a symbol or package.
   576  
   577  ```go
   578  type Item struct {
   579      // contains filtered or unexported fields
   580  }
   581  ```
   582  
   583  <a name="NewItem"></a>
   584  ### func [NewItem](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L59>)
   585  
   586  ```go
   587  func NewItem(cfg *Config, docItem *comment.ListItem) *Item
   588  ```
   589  
   590  NewItem initializes a list item from the equivalent type from the comment package.
   591  
   592  <a name="Item.Blocks"></a>
   593  ### func \(\*Item\) [Blocks](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L79>)
   594  
   595  ```go
   596  func (i *Item) Blocks() []*Block
   597  ```
   598  
   599  Blocks returns the blocks of documentation in a list item.
   600  
   601  <a name="Item.Kind"></a>
   602  ### func \(\*Item\) [Kind](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L84>)
   603  
   604  ```go
   605  func (i *Item) Kind() ItemKind
   606  ```
   607  
   608  Kind returns the kind of the list item.
   609  
   610  <a name="Item.Number"></a>
   611  ### func \(\*Item\) [Number](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L90>)
   612  
   613  ```go
   614  func (i *Item) Number() int
   615  ```
   616  
   617  Number returns the number of the list item. Only populated if the item is of the OrderedItem kind.
   618  
   619  <a name="ItemKind"></a>
   620  ## type [ItemKind](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L39>)
   621  
   622  ItemKind identifies the kind of item
   623  
   624  ```go
   625  type ItemKind string
   626  ```
   627  
   628  <a name="OrderedItem"></a>
   629  
   630  ```go
   631  const (
   632      // OrderedItem identifies an ordered (i.e. numbered) item.
   633      OrderedItem ItemKind = "ordered"
   634  
   635      // UnorderedItem identifies an unordered (i.e. bulletted) item.
   636      UnorderedItem ItemKind = "unordered"
   637  )
   638  ```
   639  
   640  <a name="List"></a>
   641  ## type [List](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L10-L13>)
   642  
   643  List defines a list block element in the documentation for a symbol or package.
   644  
   645  ```go
   646  type List struct {
   647      // contains filtered or unexported fields
   648  }
   649  ```
   650  
   651  <a name="NewList"></a>
   652  ### func [NewList](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L16>)
   653  
   654  ```go
   655  func NewList(cfg *Config, docList *comment.List) *List
   656  ```
   657  
   658  NewList initializes a list from the equivalent type from the comment package.
   659  
   660  <a name="List.BlankBetween"></a>
   661  ### func \(\*List\) [BlankBetween](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L29>)
   662  
   663  ```go
   664  func (l *List) BlankBetween() bool
   665  ```
   666  
   667  BlankBetween returns true if there should be a blank line between list items.
   668  
   669  <a name="List.Items"></a>
   670  ### func \(\*List\) [Items](<https://github.com/princjef/gomarkdoc/blob/master/lang/list.go#L34>)
   671  
   672  ```go
   673  func (l *List) Items() []*Item
   674  ```
   675  
   676  Items returns the slice of items in the list.
   677  
   678  <a name="Location"></a>
   679  ## type [Location](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L47-L53>)
   680  
   681  Location holds information for identifying a position within a file and repository, if present.
   682  
   683  ```go
   684  type Location struct {
   685      Start    Position
   686      End      Position
   687      Filepath string
   688      WorkDir  string
   689      Repo     *Repo
   690  }
   691  ```
   692  
   693  <a name="NewLocation"></a>
   694  ### func [NewLocation](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L361>)
   695  
   696  ```go
   697  func NewLocation(cfg *Config, node ast.Node) Location
   698  ```
   699  
   700  NewLocation returns a location for the provided Config and ast.Node combination. This is typically not called directly, but is made available via the Location\(\) methods of various lang constructs.
   701  
   702  <a name="Package"></a>
   703  ## type [Package](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L23-L27>)
   704  
   705  Package holds documentation information for a package and all of the symbols contained within it.
   706  
   707  ```go
   708  type Package struct {
   709      // contains filtered or unexported fields
   710  }
   711  ```
   712  
   713  <a name="NewPackage"></a>
   714  ### func [NewPackage](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L44>)
   715  
   716  ```go
   717  func NewPackage(cfg *Config, examples []*doc.Example) *Package
   718  ```
   719  
   720  NewPackage creates a representation of a package's documentation from the raw documentation constructs provided by the standard library. This is only recommended for advanced scenarios. Most consumers will find it easier to use NewPackageFromBuild instead.
   721  
   722  <a name="NewPackageFromBuild"></a>
   723  ### func [NewPackageFromBuild](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L51>)
   724  
   725  ```go
   726  func NewPackageFromBuild(log logger.Logger, pkg *build.Package, opts ...PackageOption) (*Package, error)
   727  ```
   728  
   729  NewPackageFromBuild creates a representation of a package's documentation from the build metadata for that package. It can be configured using the provided options.
   730  
   731  <a name="Package.Consts"></a>
   732  ### func \(\*Package\) [Consts](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L154>)
   733  
   734  ```go
   735  func (pkg *Package) Consts() (consts []*Value)
   736  ```
   737  
   738  Consts lists the top\-level constants provided by the package.
   739  
   740  <a name="Package.Dir"></a>
   741  ### func \(\*Package\) [Dir](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L109>)
   742  
   743  ```go
   744  func (pkg *Package) Dir() string
   745  ```
   746  
   747  Dir provides the name of the full directory in which the package is located.
   748  
   749  <a name="Package.Dirname"></a>
   750  ### func \(\*Package\) [Dirname](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L115>)
   751  
   752  ```go
   753  func (pkg *Package) Dirname() string
   754  ```
   755  
   756  Dirname provides the name of the leaf directory in which the package is located.
   757  
   758  <a name="Package.Doc"></a>
   759  ### func \(\*Package\) [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L148>)
   760  
   761  ```go
   762  func (pkg *Package) Doc() *Doc
   763  ```
   764  
   765  Doc provides the structured contents of the documentation comment for the package.
   766  
   767  <a name="Package.Examples"></a>
   768  ### func \(\*Package\) [Examples](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L192>)
   769  
   770  ```go
   771  func (pkg *Package) Examples() (examples []*Example)
   772  ```
   773  
   774  Examples provides the package\-level examples that have been defined. This does not include examples that are associated with symbols contained within the package.
   775  
   776  <a name="Package.Funcs"></a>
   777  ### func \(\*Package\) [Funcs](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L172>)
   778  
   779  ```go
   780  func (pkg *Package) Funcs() (funcs []*Func)
   781  ```
   782  
   783  Funcs lists the top\-level functions provided by the package.
   784  
   785  <a name="Package.Import"></a>
   786  ### func \(\*Package\) [Import](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L129>)
   787  
   788  ```go
   789  func (pkg *Package) Import() string
   790  ```
   791  
   792  Import provides the raw text for the import declaration that is used to import code from the package. If your package's documentation is generated from a local path and does not use Go Modules, this will typically print \`import "."\`.
   793  
   794  <a name="Package.ImportPath"></a>
   795  ### func \(\*Package\) [ImportPath](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L136>)
   796  
   797  ```go
   798  func (pkg *Package) ImportPath() string
   799  ```
   800  
   801  ImportPath provides the identifier used for the package when installing or importing the package. If your package's documentation is generated from a local path and does not use Go Modules, this will typically print \`.\`.
   802  
   803  <a name="Package.Level"></a>
   804  ### func \(\*Package\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L104>)
   805  
   806  ```go
   807  func (pkg *Package) Level() int
   808  ```
   809  
   810  Level provides the default level that headers for the package's root documentation should be rendered.
   811  
   812  <a name="Package.Name"></a>
   813  ### func \(\*Package\) [Name](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L121>)
   814  
   815  ```go
   816  func (pkg *Package) Name() string
   817  ```
   818  
   819  Name provides the name of the package as it would be seen from another package importing it.
   820  
   821  <a name="Package.Summary"></a>
   822  ### func \(\*Package\) [Summary](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L142>)
   823  
   824  ```go
   825  func (pkg *Package) Summary() string
   826  ```
   827  
   828  Summary provides the one\-sentence summary of the package's documentation comment.
   829  
   830  <a name="Package.Types"></a>
   831  ### func \(\*Package\) [Types](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L181>)
   832  
   833  ```go
   834  func (pkg *Package) Types() (types []*Type)
   835  ```
   836  
   837  Types lists the top\-level types provided by the package.
   838  
   839  <a name="Package.Vars"></a>
   840  ### func \(\*Package\) [Vars](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L163>)
   841  
   842  ```go
   843  func (pkg *Package) Vars() (vars []*Value)
   844  ```
   845  
   846  Vars lists the top\-level variables provided by the package.
   847  
   848  <a name="PackageOption"></a>
   849  ## type [PackageOption](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L37>)
   850  
   851  PackageOption configures one or more options for the package.
   852  
   853  ```go
   854  type PackageOption func(opts *PackageOptions) error
   855  ```
   856  
   857  <a name="PackageWithRepositoryOverrides"></a>
   858  ### func [PackageWithRepositoryOverrides](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L95>)
   859  
   860  ```go
   861  func PackageWithRepositoryOverrides(repo *Repo) PackageOption
   862  ```
   863  
   864  PackageWithRepositoryOverrides can be used along with the NewPackageFromBuild function to define manual overrides to the automatic repository detection logic.
   865  
   866  <a name="PackageWithUnexportedIncluded"></a>
   867  ### func [PackageWithUnexportedIncluded](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L85>)
   868  
   869  ```go
   870  func PackageWithUnexportedIncluded() PackageOption
   871  ```
   872  
   873  PackageWithUnexportedIncluded can be used along with the NewPackageFromBuild function to specify that all symbols, including unexported ones, should be included in the documentation for the package.
   874  
   875  <a name="PackageOptions"></a>
   876  ## type [PackageOptions](<https://github.com/princjef/gomarkdoc/blob/master/lang/package.go#L31-L34>)
   877  
   878  PackageOptions holds options related to the configuration of the package and its documentation on creation.
   879  
   880  ```go
   881  type PackageOptions struct {
   882      // contains filtered or unexported fields
   883  }
   884  ```
   885  
   886  <a name="Position"></a>
   887  ## type [Position](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L56-L59>)
   888  
   889  Position represents a line and column number within a file.
   890  
   891  ```go
   892  type Position struct {
   893      Line int
   894      Col  int
   895  }
   896  ```
   897  
   898  <a name="Repo"></a>
   899  ## type [Repo](<https://github.com/princjef/gomarkdoc/blob/master/lang/config.go#L39-L43>)
   900  
   901  Repo represents information about a repository relevant to documentation generation.
   902  
   903  ```go
   904  type Repo struct {
   905      Remote        string
   906      DefaultBranch string
   907      PathFromRoot  string
   908  }
   909  ```
   910  
   911  <a name="Span"></a>
   912  ## type [Span](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L13-L18>)
   913  
   914  Span defines a single text span in a block for documentation of a symbol or package.
   915  
   916  ```go
   917  type Span struct {
   918      // contains filtered or unexported fields
   919  }
   920  ```
   921  
   922  <a name="NewSpan"></a>
   923  ### func [NewSpan](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L41>)
   924  
   925  ```go
   926  func NewSpan(cfg *Config, kind SpanKind, text string, url string) *Span
   927  ```
   928  
   929  NewSpan creates a new span.
   930  
   931  <a name="ParseSpans"></a>
   932  ### func [ParseSpans](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L61>)
   933  
   934  ```go
   935  func ParseSpans(cfg *Config, texts []comment.Text) []*Span
   936  ```
   937  
   938  ParseSpans turns a set of \*comment.Text entries into a slice of spans.
   939  
   940  <a name="Span.Kind"></a>
   941  ### func \(\*Span\) [Kind](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L46>)
   942  
   943  ```go
   944  func (s *Span) Kind() SpanKind
   945  ```
   946  
   947  Kind provides the kind of data that this span represents.
   948  
   949  <a name="Span.Text"></a>
   950  ### func \(\*Span\) [Text](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L51>)
   951  
   952  ```go
   953  func (s *Span) Text() string
   954  ```
   955  
   956  Text provides the raw text for the span.
   957  
   958  <a name="Span.URL"></a>
   959  ### func \(\*Span\) [URL](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L56>)
   960  
   961  ```go
   962  func (s *Span) URL() string
   963  ```
   964  
   965  URL provides the url associated with the span, if any.
   966  
   967  <a name="SpanKind"></a>
   968  ## type [SpanKind](<https://github.com/princjef/gomarkdoc/blob/master/lang/span.go#L22>)
   969  
   970  SpanKind identifies the type of span element represented by the corresponding Span.
   971  
   972  ```go
   973  type SpanKind string
   974  ```
   975  
   976  <a name="TextSpan"></a>
   977  
   978  ```go
   979  const (
   980      // TextSpan defines a span that represents plain text.
   981      TextSpan SpanKind = "text"
   982  
   983      // RawTextSpan defines a span that represents plain text that should be
   984      // displayed as-is.
   985      RawTextSpan SpanKind = "rawText"
   986  
   987      // LinkSpan defines a span that represents a link.
   988      LinkSpan SpanKind = "link"
   989  
   990      // AutolinkSpan defines a span that represents text which is itself a link.
   991      AutolinkSpan SpanKind = "autolink"
   992  )
   993  ```
   994  
   995  <a name="Symbol"></a>
   996  ## type [Symbol](<https://github.com/princjef/gomarkdoc/blob/master/lang/symbol.go#L12-L21>)
   997  
   998  Symbol provides identity information for a symbol in a package.
   999  
  1000  ```go
  1001  type Symbol struct {
  1002      // Receiver holds the receiver for a method or field.
  1003      Receiver string
  1004      // Name holds the name of the symbol itself.
  1005      Name string
  1006      // Kind identifies the category of the symbol.
  1007      Kind SymbolKind
  1008      // Parent holds the linkable parent symbol which contains this one.
  1009      Parent *Symbol
  1010  }
  1011  ```
  1012  
  1013  <a name="Symbol.Anchor"></a>
  1014  ### func \(Symbol\) [Anchor](<https://github.com/princjef/gomarkdoc/blob/master/lang/symbol.go#L158>)
  1015  
  1016  ```go
  1017  func (s Symbol) Anchor() string
  1018  ```
  1019  
  1020  Anchor produces anchor text for the symbol.
  1021  
  1022  <a name="SymbolKind"></a>
  1023  ## type [SymbolKind](<https://github.com/princjef/gomarkdoc/blob/master/lang/symbol.go#L24>)
  1024  
  1025  SymbolKind identifies the type of symbol.
  1026  
  1027  ```go
  1028  type SymbolKind int
  1029  ```
  1030  
  1031  <a name="TypeSymbolKind"></a>The list of valid symbol kinds.
  1032  
  1033  ```go
  1034  const (
  1035      TypeSymbolKind SymbolKind = iota + 1
  1036      FuncSymbolKind
  1037      ConstSymbolKind
  1038      VarSymbolKind
  1039      MethodSymbolKind
  1040      FieldSymbolKind
  1041  )
  1042  ```
  1043  
  1044  <a name="Type"></a>
  1045  ## type [Type](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L10-L14>)
  1046  
  1047  Type holds documentation information for a type declaration.
  1048  
  1049  ```go
  1050  type Type struct {
  1051      // contains filtered or unexported fields
  1052  }
  1053  ```
  1054  
  1055  <a name="NewType"></a>
  1056  ### func [NewType](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L19>)
  1057  
  1058  ```go
  1059  func NewType(cfg *Config, doc *doc.Type, examples []*doc.Example) *Type
  1060  ```
  1061  
  1062  NewType creates a Type from the raw documentation representation of the type, the token.FileSet for the package's files and the full list of examples from the containing package.
  1063  
  1064  <a name="Type.Anchor"></a>
  1065  ### func \(\*Type\) [Anchor](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L140>)
  1066  
  1067  ```go
  1068  func (typ *Type) Anchor() string
  1069  ```
  1070  
  1071  Anchor produces anchor text for the type.
  1072  
  1073  <a name="Type.Consts"></a>
  1074  ### func \(\*Type\) [Consts](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L120>)
  1075  
  1076  ```go
  1077  func (typ *Type) Consts() []*Value
  1078  ```
  1079  
  1080  Consts lists the const declaration blocks containing values of this type.
  1081  
  1082  <a name="Type.Decl"></a>
  1083  ### func \(\*Type\) [Decl](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L60>)
  1084  
  1085  ```go
  1086  func (typ *Type) Decl() (string, error)
  1087  ```
  1088  
  1089  Decl provides the raw text representation of the code for the type's declaration.
  1090  
  1091  <a name="Type.Doc"></a>
  1092  ### func \(\*Type\) [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L54>)
  1093  
  1094  ```go
  1095  func (typ *Type) Doc() *Doc
  1096  ```
  1097  
  1098  Doc provides the structured contents of the documentation comment for the type.
  1099  
  1100  <a name="Type.Examples"></a>
  1101  ### func \(\*Type\) [Examples](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L66>)
  1102  
  1103  ```go
  1104  func (typ *Type) Examples() (examples []*Example)
  1105  ```
  1106  
  1107  Examples lists the examples pertaining to the type from the set provided on initialization.
  1108  
  1109  <a name="Type.Funcs"></a>
  1110  ### func \(\*Type\) [Funcs](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L100>)
  1111  
  1112  ```go
  1113  func (typ *Type) Funcs() []*Func
  1114  ```
  1115  
  1116  Funcs lists the funcs related to the type. This only includes functions which return an instance of the type or its pointer.
  1117  
  1118  <a name="Type.Level"></a>
  1119  ### func \(\*Type\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L25>)
  1120  
  1121  ```go
  1122  func (typ *Type) Level() int
  1123  ```
  1124  
  1125  Level provides the default level that headers for the type should be rendered.
  1126  
  1127  <a name="Type.Location"></a>
  1128  ### func \(\*Type\) [Location](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L42>)
  1129  
  1130  ```go
  1131  func (typ *Type) Location() Location
  1132  ```
  1133  
  1134  Location returns a representation of the node's location in a file within a repository.
  1135  
  1136  <a name="Type.Methods"></a>
  1137  ### func \(\*Type\) [Methods](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L110>)
  1138  
  1139  ```go
  1140  func (typ *Type) Methods() []*Func
  1141  ```
  1142  
  1143  Methods lists the funcs that use the type as a value or pointer receiver.
  1144  
  1145  <a name="Type.Name"></a>
  1146  ### func \(\*Type\) [Name](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L30>)
  1147  
  1148  ```go
  1149  func (typ *Type) Name() string
  1150  ```
  1151  
  1152  Name provides the name of the type
  1153  
  1154  <a name="Type.Summary"></a>
  1155  ### func \(\*Type\) [Summary](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L48>)
  1156  
  1157  ```go
  1158  func (typ *Type) Summary() string
  1159  ```
  1160  
  1161  Summary provides the one\-sentence summary of the type's documentation comment.
  1162  
  1163  <a name="Type.Title"></a>
  1164  ### func \(\*Type\) [Title](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L36>)
  1165  
  1166  ```go
  1167  func (typ *Type) Title() string
  1168  ```
  1169  
  1170  Title provides a formatted name suitable for use in a header identifying the type.
  1171  
  1172  <a name="Type.Vars"></a>
  1173  ### func \(\*Type\) [Vars](<https://github.com/princjef/gomarkdoc/blob/master/lang/type.go#L130>)
  1174  
  1175  ```go
  1176  func (typ *Type) Vars() []*Value
  1177  ```
  1178  
  1179  Vars lists the var declaration blocks containing values of this type.
  1180  
  1181  <a name="Value"></a>
  1182  ## type [Value](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L8-L11>)
  1183  
  1184  Value holds documentation for a var or const declaration within a package.
  1185  
  1186  ```go
  1187  type Value struct {
  1188      // contains filtered or unexported fields
  1189  }
  1190  ```
  1191  
  1192  <a name="NewValue"></a>
  1193  ### func [NewValue](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L15>)
  1194  
  1195  ```go
  1196  func NewValue(cfg *Config, doc *doc.Value) *Value
  1197  ```
  1198  
  1199  NewValue creates a new Value from the raw const or var documentation and the token.FileSet of files for the containing package.
  1200  
  1201  <a name="Value.Anchor"></a>
  1202  ### func \(\*Value\) [Anchor](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L50>)
  1203  
  1204  ```go
  1205  func (v *Value) Anchor() string
  1206  ```
  1207  
  1208  Anchor produces anchor text for the value.
  1209  
  1210  <a name="Value.Decl"></a>
  1211  ### func \(\*Value\) [Decl](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L45>)
  1212  
  1213  ```go
  1214  func (v *Value) Decl() (string, error)
  1215  ```
  1216  
  1217  Decl provides the raw text representation of the code for declaring the const or var.
  1218  
  1219  <a name="Value.Doc"></a>
  1220  ### func \(\*Value\) [Doc](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L39>)
  1221  
  1222  ```go
  1223  func (v *Value) Doc() *Doc
  1224  ```
  1225  
  1226  Doc provides the structured contents of the documentation comment for the example.
  1227  
  1228  <a name="Value.Level"></a>
  1229  ### func \(\*Value\) [Level](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L21>)
  1230  
  1231  ```go
  1232  func (v *Value) Level() int
  1233  ```
  1234  
  1235  Level provides the default level that headers for the value should be rendered.
  1236  
  1237  <a name="Value.Location"></a>
  1238  ### func \(\*Value\) [Location](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L27>)
  1239  
  1240  ```go
  1241  func (v *Value) Location() Location
  1242  ```
  1243  
  1244  Location returns a representation of the node's location in a file within a repository.
  1245  
  1246  <a name="Value.Summary"></a>
  1247  ### func \(\*Value\) [Summary](<https://github.com/princjef/gomarkdoc/blob/master/lang/value.go#L33>)
  1248  
  1249  ```go
  1250  func (v *Value) Summary() string
  1251  ```
  1252  
  1253  Summary provides the one\-sentence summary of the value's documentation comment.
  1254  
  1255  Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)