github.com/huner2/gomarkdoc@v0.3.6/lang/README.md (about)

     1  <!-- Code generated by gomarkdoc. DO NOT EDIT -->
     2  
     3  # lang
     4  
     5  ```go
     6  import "github.com/huner2/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  - [type Block](<#type-block>)
    14    - [func NewBlock(cfg *Config, kind BlockKind, text string) *Block](<#func-newblock>)
    15    - [func (b *Block) Kind() BlockKind](<#func-block-kind>)
    16    - [func (b *Block) Level() int](<#func-block-level>)
    17    - [func (b *Block) Text() string](<#func-block-text>)
    18  - [type BlockKind](<#type-blockkind>)
    19  - [type Config](<#type-config>)
    20    - [func NewConfig(log logger.Logger, workDir string, pkgDir string, opts ...ConfigOption) (*Config, error)](<#func-newconfig>)
    21    - [func (c *Config) Inc(step int) *Config](<#func-config-inc>)
    22  - [type ConfigOption](<#type-configoption>)
    23    - [func ConfigWithRepoOverrides(overrides *Repo) ConfigOption](<#func-configwithrepooverrides>)
    24  - [type Doc](<#type-doc>)
    25    - [func NewDoc(cfg *Config, text string) *Doc](<#func-newdoc>)
    26    - [func (d *Doc) Blocks() []*Block](<#func-doc-blocks>)
    27    - [func (d *Doc) Level() int](<#func-doc-level>)
    28  - [type Example](<#type-example>)
    29    - [func NewExample(cfg *Config, name string, doc *doc.Example) *Example](<#func-newexample>)
    30    - [func (ex *Example) Code() (string, error)](<#func-example-code>)
    31    - [func (ex *Example) Doc() *Doc](<#func-example-doc>)
    32    - [func (ex *Example) HasOutput() bool](<#func-example-hasoutput>)
    33    - [func (ex *Example) Level() int](<#func-example-level>)
    34    - [func (ex *Example) Location() Location](<#func-example-location>)
    35    - [func (ex *Example) Name() string](<#func-example-name>)
    36    - [func (ex *Example) Output() string](<#func-example-output>)
    37    - [func (ex *Example) Summary() string](<#func-example-summary>)
    38    - [func (ex *Example) Title() string](<#func-example-title>)
    39  - [type File](<#type-file>)
    40    - [func NewFile(header, footer string, packages []*Package) *File](<#func-newfile>)
    41  - [type Func](<#type-func>)
    42    - [func NewFunc(cfg *Config, doc *doc.Func, examples []*doc.Example) *Func](<#func-newfunc>)
    43    - [func (fn *Func) Doc() *Doc](<#func-func-doc>)
    44    - [func (fn *Func) Examples() (examples []*Example)](<#func-func-examples>)
    45    - [func (fn *Func) Level() int](<#func-func-level>)
    46    - [func (fn *Func) Location() Location](<#func-func-location>)
    47    - [func (fn *Func) Name() string](<#func-func-name>)
    48    - [func (fn *Func) Receiver() string](<#func-func-receiver>)
    49    - [func (fn *Func) Signature() (string, error)](<#func-func-signature>)
    50    - [func (fn *Func) Summary() string](<#func-func-summary>)
    51    - [func (fn *Func) Title() string](<#func-func-title>)
    52  - [type Location](<#type-location>)
    53    - [func NewLocation(cfg *Config, node ast.Node) Location](<#func-newlocation>)
    54  - [type Package](<#type-package>)
    55    - [func NewPackage(cfg *Config, doc *doc.Package, examples []*doc.Example) *Package](<#func-newpackage>)
    56    - [func NewPackageFromBuild(log logger.Logger, pkg *build.Package, opts ...PackageOption) (*Package, error)](<#func-newpackagefrombuild>)
    57    - [func (pkg *Package) Consts() (consts []*Value)](<#func-package-consts>)
    58    - [func (pkg *Package) Dir() string](<#func-package-dir>)
    59    - [func (pkg *Package) Dirname() string](<#func-package-dirname>)
    60    - [func (pkg *Package) Doc() *Doc](<#func-package-doc>)
    61    - [func (pkg *Package) Examples() (examples []*Example)](<#func-package-examples>)
    62    - [func (pkg *Package) Funcs() (funcs []*Func)](<#func-package-funcs>)
    63    - [func (pkg *Package) Import() string](<#func-package-import>)
    64    - [func (pkg *Package) Level() int](<#func-package-level>)
    65    - [func (pkg *Package) Name() string](<#func-package-name>)
    66    - [func (pkg *Package) Summary() string](<#func-package-summary>)
    67    - [func (pkg *Package) Types() (types []*Type)](<#func-package-types>)
    68    - [func (pkg *Package) Vars() (vars []*Value)](<#func-package-vars>)
    69  - [type PackageOption](<#type-packageoption>)
    70    - [func PackageWithRepositoryOverrides(repo *Repo) PackageOption](<#func-packagewithrepositoryoverrides>)
    71    - [func PackageWithUnexportedIncluded() PackageOption](<#func-packagewithunexportedincluded>)
    72  - [type PackageOptions](<#type-packageoptions>)
    73  - [type Position](<#type-position>)
    74  - [type Repo](<#type-repo>)
    75  - [type Type](<#type-type>)
    76    - [func NewType(cfg *Config, doc *doc.Type, examples []*doc.Example) *Type](<#func-newtype>)
    77    - [func (typ *Type) Consts() []*Value](<#func-type-consts>)
    78    - [func (typ *Type) Decl() (string, error)](<#func-type-decl>)
    79    - [func (typ *Type) Doc() *Doc](<#func-type-doc>)
    80    - [func (typ *Type) Examples() (examples []*Example)](<#func-type-examples>)
    81    - [func (typ *Type) Funcs() []*Func](<#func-type-funcs>)
    82    - [func (typ *Type) Level() int](<#func-type-level>)
    83    - [func (typ *Type) Location() Location](<#func-type-location>)
    84    - [func (typ *Type) Methods() []*Func](<#func-type-methods>)
    85    - [func (typ *Type) Name() string](<#func-type-name>)
    86    - [func (typ *Type) Summary() string](<#func-type-summary>)
    87    - [func (typ *Type) Title() string](<#func-type-title>)
    88    - [func (typ *Type) Vars() []*Value](<#func-type-vars>)
    89  - [type Value](<#type-value>)
    90    - [func NewValue(cfg *Config, doc *doc.Value) *Value](<#func-newvalue>)
    91    - [func (v *Value) Decl() (string, error)](<#func-value-decl>)
    92    - [func (v *Value) Doc() *Doc](<#func-value-doc>)
    93    - [func (v *Value) Level() int](<#func-value-level>)
    94    - [func (v *Value) Location() Location](<#func-value-location>)
    95    - [func (v *Value) Summary() string](<#func-value-summary>)
    96  
    97  
    98  ## type [Block](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L6-L10>)
    99  
   100  Block defines a single block element \(e\.g\. paragraph\, code block\) in the documentation for a symbol or package\.
   101  
   102  ```go
   103  type Block struct {
   104      // contains filtered or unexported fields
   105  }
   106  ```
   107  
   108  ### func [NewBlock](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L30>)
   109  
   110  ```go
   111  func NewBlock(cfg *Config, kind BlockKind, text string) *Block
   112  ```
   113  
   114  NewBlock creates a new block element of the provided kind and with the given text contents\.
   115  
   116  ### func \(\*Block\) [Kind](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L42>)
   117  
   118  ```go
   119  func (b *Block) Kind() BlockKind
   120  ```
   121  
   122  Kind provides the kind of data that this block's text should be interpreted as\.
   123  
   124  ### func \(\*Block\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L36>)
   125  
   126  ```go
   127  func (b *Block) Level() int
   128  ```
   129  
   130  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\.
   131  
   132  ### func \(\*Block\) [Text](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L49>)
   133  
   134  ```go
   135  func (b *Block) Text() string
   136  ```
   137  
   138  Text provides the raw text of the block's contents\. 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\)\.
   139  
   140  ## type [BlockKind](<https://github.com/huner2/gomarkdoc/blob/master/lang/block.go#L14>)
   141  
   142  BlockKind identifies the type of block element represented by the corresponding Block\.
   143  
   144  ```go
   145  type BlockKind string
   146  ```
   147  
   148  ```go
   149  const (
   150      // ParagraphBlock defines a block that represents a paragraph of text.
   151      ParagraphBlock BlockKind = "paragraph"
   152  
   153      // CodeBlock defines a block that represents a section of code.
   154      CodeBlock BlockKind = "code"
   155  
   156      // HeaderBlock defines a block that represents a section header.
   157      HeaderBlock BlockKind = "header"
   158  )
   159  ```
   160  
   161  ## type [Config](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L20-L27>)
   162  
   163  Config defines contextual information used to resolve documentation for a construct\.
   164  
   165  ```go
   166  type Config struct {
   167      FileSet *token.FileSet
   168      Level   int
   169      Repo    *Repo
   170      PkgDir  string
   171      WorkDir string
   172      Log     logger.Logger
   173  }
   174  ```
   175  
   176  ### func [NewConfig](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L61>)
   177  
   178  ```go
   179  func NewConfig(log logger.Logger, workDir string, pkgDir string, opts ...ConfigOption) (*Config, error)
   180  ```
   181  
   182  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\.
   183  
   184  ### func \(\*Config\) [Inc](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L109>)
   185  
   186  ```go
   187  func (c *Config) Inc(step int) *Config
   188  ```
   189  
   190  Inc copies the Config and increments the level by the provided step\.
   191  
   192  ## type [ConfigOption](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L54>)
   193  
   194  ConfigOption modifies the Config generated by NewConfig\.
   195  
   196  ```go
   197  type ConfigOption func(c *Config) error
   198  ```
   199  
   200  ### func [ConfigWithRepoOverrides](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L122>)
   201  
   202  ```go
   203  func ConfigWithRepoOverrides(overrides *Repo) ConfigOption
   204  ```
   205  
   206  ConfigWithRepoOverrides defines a set of manual overrides for the repository information to be used in place of automatic repository detection\.
   207  
   208  ## type [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/doc.go#L10-L13>)
   209  
   210  Doc provides access to the documentation comment contents for a package or symbol in a structured form\.
   211  
   212  ```go
   213  type Doc struct {
   214      // contains filtered or unexported fields
   215  }
   216  ```
   217  
   218  ### func [NewDoc](<https://github.com/huner2/gomarkdoc/blob/master/lang/doc.go#L27>)
   219  
   220  ```go
   221  func NewDoc(cfg *Config, text string) *Doc
   222  ```
   223  
   224  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\.
   225  
   226  ### func \(\*Doc\) [Blocks](<https://github.com/huner2/gomarkdoc/blob/master/lang/doc.go#L70>)
   227  
   228  ```go
   229  func (d *Doc) Blocks() []*Block
   230  ```
   231  
   232  Blocks holds the list of block elements that makes up the documentation contents\.
   233  
   234  ### func \(\*Doc\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/doc.go#L64>)
   235  
   236  ```go
   237  func (d *Doc) Level() int
   238  ```
   239  
   240  Level provides the default level that headers within the documentation should be rendered
   241  
   242  ## type [Example](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L11-L15>)
   243  
   244  Example holds a single documentation example for a package or symbol\.
   245  
   246  ```go
   247  type Example struct {
   248      // contains filtered or unexported fields
   249  }
   250  ```
   251  
   252  ### func [NewExample](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L19>)
   253  
   254  ```go
   255  func NewExample(cfg *Config, name string, doc *doc.Example) *Example
   256  ```
   257  
   258  NewExample creates a new example from the example function's name\, its documentation example and the files holding code related to the example\.
   259  
   260  ### func \(\*Example\) [Code](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L65>)
   261  
   262  ```go
   263  func (ex *Example) Code() (string, error)
   264  ```
   265  
   266  Code provides the raw text code representation of the example's contents\.
   267  
   268  ### func \(\*Example\) [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L60>)
   269  
   270  ```go
   271  func (ex *Example) Doc() *Doc
   272  ```
   273  
   274  Doc provides the structured contents of the documentation comment for the example\.
   275  
   276  ### func \(\*Example\) [HasOutput](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L87>)
   277  
   278  ```go
   279  func (ex *Example) HasOutput() bool
   280  ```
   281  
   282  HasOutput indicates whether the example contains any example output\.
   283  
   284  ### func \(\*Example\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L25>)
   285  
   286  ```go
   287  func (ex *Example) Level() int
   288  ```
   289  
   290  Level provides the default level that headers for the example should be rendered\.
   291  
   292  ### func \(\*Example\) [Location](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L48>)
   293  
   294  ```go
   295  func (ex *Example) Location() Location
   296  ```
   297  
   298  Location returns a representation of the node's location in a file within a repository\.
   299  
   300  ### func \(\*Example\) [Name](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L31>)
   301  
   302  ```go
   303  func (ex *Example) Name() string
   304  ```
   305  
   306  Name provides a pretty\-printed name for the specific example\, if one was provided\.
   307  
   308  ### func \(\*Example\) [Output](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L82>)
   309  
   310  ```go
   311  func (ex *Example) Output() string
   312  ```
   313  
   314  Output provides the code's example output\.
   315  
   316  ### func \(\*Example\) [Summary](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L54>)
   317  
   318  ```go
   319  func (ex *Example) Summary() string
   320  ```
   321  
   322  Summary provides the one\-sentence summary of the example's documentation comment\.
   323  
   324  ### func \(\*Example\) [Title](<https://github.com/huner2/gomarkdoc/blob/master/lang/example.go#L37>)
   325  
   326  ```go
   327  func (ex *Example) Title() string
   328  ```
   329  
   330  Title provides a formatted string to print as the title of the example\. It incorporates the example's name\, if present\.
   331  
   332  ## type [File](<https://github.com/huner2/gomarkdoc/blob/master/lang/file.go#L5-L9>)
   333  
   334  File holds information for rendering a single file that contains one or more packages\.
   335  
   336  ```go
   337  type File struct {
   338      Header   string
   339      Footer   string
   340      Packages []*Package
   341  }
   342  ```
   343  
   344  ### func [NewFile](<https://github.com/huner2/gomarkdoc/blob/master/lang/file.go#L12>)
   345  
   346  ```go
   347  func NewFile(header, footer string, packages []*Package) *File
   348  ```
   349  
   350  NewFile creates a new instance of File with the provided information\.
   351  
   352  ## type [Func](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L12-L16>)
   353  
   354  Func holds documentation information for a single func declaration within a package or type\.
   355  
   356  ```go
   357  type Func struct {
   358      // contains filtered or unexported fields
   359  }
   360  ```
   361  
   362  ### func [NewFunc](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L21>)
   363  
   364  ```go
   365  func NewFunc(cfg *Config, doc *doc.Func, examples []*doc.Example) *Func
   366  ```
   367  
   368  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\.
   369  
   370  ### func \(\*Func\) [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L66>)
   371  
   372  ```go
   373  func (fn *Func) Doc() *Doc
   374  ```
   375  
   376  Doc provides the structured contents of the documentation comment for the function\.
   377  
   378  ### func \(\*Func\) [Examples](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L79>)
   379  
   380  ```go
   381  func (fn *Func) Examples() (examples []*Example)
   382  ```
   383  
   384  Examples provides the list of examples from the list given on initialization that pertain to the function\.
   385  
   386  ### func \(\*Func\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L27>)
   387  
   388  ```go
   389  func (fn *Func) Level() int
   390  ```
   391  
   392  Level provides the default level at which headers for the func should be rendered in the final documentation\.
   393  
   394  ### func \(\*Func\) [Location](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L54>)
   395  
   396  ```go
   397  func (fn *Func) Location() Location
   398  ```
   399  
   400  Location returns a representation of the node's location in a file within a repository\.
   401  
   402  ### func \(\*Func\) [Name](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L32>)
   403  
   404  ```go
   405  func (fn *Func) Name() string
   406  ```
   407  
   408  Name provides the name of the function\.
   409  
   410  ### func \(\*Func\) [Receiver](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L48>)
   411  
   412  ```go
   413  func (fn *Func) Receiver() string
   414  ```
   415  
   416  Receiver provides the type of the receiver for the function\, or empty string if there is no receiver type\.
   417  
   418  ### func \(\*Func\) [Signature](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L72>)
   419  
   420  ```go
   421  func (fn *Func) Signature() (string, error)
   422  ```
   423  
   424  Signature provides the raw text representation of the code for the function's signature\.
   425  
   426  ### func \(\*Func\) [Summary](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L60>)
   427  
   428  ```go
   429  func (fn *Func) Summary() string
   430  ```
   431  
   432  Summary provides the one\-sentence summary of the function's documentation comment
   433  
   434  ### func \(\*Func\) [Title](<https://github.com/huner2/gomarkdoc/blob/master/lang/func.go#L38>)
   435  
   436  ```go
   437  func (fn *Func) Title() string
   438  ```
   439  
   440  Title provides the formatted name of the func\. It is primarily designed for generating headers\.
   441  
   442  ## type [Location](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L39-L45>)
   443  
   444  Location holds information for identifying a position within a file and repository\, if present\.
   445  
   446  ```go
   447  type Location struct {
   448      Start    Position
   449      End      Position
   450      Filepath string
   451      WorkDir  string
   452      Repo     *Repo
   453  }
   454  ```
   455  
   456  ### func [NewLocation](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L343>)
   457  
   458  ```go
   459  func NewLocation(cfg *Config, node ast.Node) Location
   460  ```
   461  
   462  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\.
   463  
   464  ## type [Package](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L23-L27>)
   465  
   466  Package holds documentation information for a package and all of the symbols contained within it\.
   467  
   468  ```go
   469  type Package struct {
   470      // contains filtered or unexported fields
   471  }
   472  ```
   473  
   474  ### func [NewPackage](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L44>)
   475  
   476  ```go
   477  func NewPackage(cfg *Config, doc *doc.Package, examples []*doc.Example) *Package
   478  ```
   479  
   480  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\.
   481  
   482  ### func [NewPackageFromBuild](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L51>)
   483  
   484  ```go
   485  func NewPackageFromBuild(log logger.Logger, pkg *build.Package, opts ...PackageOption) (*Package, error)
   486  ```
   487  
   488  NewPackageFromBuild creates a representation of a package's documentation from the build metadata for that package\. It can be configured using the provided options\.
   489  
   490  ### func \(\*Package\) [Consts](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L149>)
   491  
   492  ```go
   493  func (pkg *Package) Consts() (consts []*Value)
   494  ```
   495  
   496  Consts lists the top\-level constants provided by the package\.
   497  
   498  ### func \(\*Package\) [Dir](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L111>)
   499  
   500  ```go
   501  func (pkg *Package) Dir() string
   502  ```
   503  
   504  Dir provides the name of the full directory in which the package is located\.
   505  
   506  ### func \(\*Package\) [Dirname](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L117>)
   507  
   508  ```go
   509  func (pkg *Package) Dirname() string
   510  ```
   511  
   512  Dirname provides the name of the leaf directory in which the package is located\.
   513  
   514  ### func \(\*Package\) [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L143>)
   515  
   516  ```go
   517  func (pkg *Package) Doc() *Doc
   518  ```
   519  
   520  Doc provides the structured contents of the documentation comment for the package\.
   521  
   522  ### func \(\*Package\) [Examples](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L187>)
   523  
   524  ```go
   525  func (pkg *Package) Examples() (examples []*Example)
   526  ```
   527  
   528  Examples provides the package\-level examples that have been defined\. This does not include examples that are associated with symbols contained within the package\.
   529  
   530  ### func \(\*Package\) [Funcs](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L167>)
   531  
   532  ```go
   533  func (pkg *Package) Funcs() (funcs []*Func)
   534  ```
   535  
   536  Funcs lists the top\-level functions provided by the package\.
   537  
   538  ### func \(\*Package\) [Import](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L131>)
   539  
   540  ```go
   541  func (pkg *Package) Import() string
   542  ```
   543  
   544  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 "\."\`\.
   545  
   546  ### func \(\*Package\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L106>)
   547  
   548  ```go
   549  func (pkg *Package) Level() int
   550  ```
   551  
   552  Level provides the default level that headers for the package's root documentation should be rendered\.
   553  
   554  ### func \(\*Package\) [Name](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L123>)
   555  
   556  ```go
   557  func (pkg *Package) Name() string
   558  ```
   559  
   560  Name provides the name of the package as it would be seen from another package importing it\.
   561  
   562  ### func \(\*Package\) [Summary](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L137>)
   563  
   564  ```go
   565  func (pkg *Package) Summary() string
   566  ```
   567  
   568  Summary provides the one\-sentence summary of the package's documentation comment\.
   569  
   570  ### func \(\*Package\) [Types](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L176>)
   571  
   572  ```go
   573  func (pkg *Package) Types() (types []*Type)
   574  ```
   575  
   576  Types lists the top\-level types provided by the package\.
   577  
   578  ### func \(\*Package\) [Vars](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L158>)
   579  
   580  ```go
   581  func (pkg *Package) Vars() (vars []*Value)
   582  ```
   583  
   584  Vars lists the top\-level variables provided by the package\.
   585  
   586  ## type [PackageOption](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L37>)
   587  
   588  PackageOption configures one or more options for the package\.
   589  
   590  ```go
   591  type PackageOption func(opts *PackageOptions) error
   592  ```
   593  
   594  ### func [PackageWithRepositoryOverrides](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L97>)
   595  
   596  ```go
   597  func PackageWithRepositoryOverrides(repo *Repo) PackageOption
   598  ```
   599  
   600  PackageWithRepositoryOverrides can be used along with the NewPackageFromBuild function to define manual overrides to the automatic repository detection logic\.
   601  
   602  ### func [PackageWithUnexportedIncluded](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L87>)
   603  
   604  ```go
   605  func PackageWithUnexportedIncluded() PackageOption
   606  ```
   607  
   608  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\.
   609  
   610  ## type [PackageOptions](<https://github.com/huner2/gomarkdoc/blob/master/lang/package.go#L31-L34>)
   611  
   612  PackageOptions holds options related to the configuration of the package and its documentation on creation\.
   613  
   614  ```go
   615  type PackageOptions struct {
   616      // contains filtered or unexported fields
   617  }
   618  ```
   619  
   620  ## type [Position](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L48-L51>)
   621  
   622  Position represents a line and column number within a file\.
   623  
   624  ```go
   625  type Position struct {
   626      Line int
   627      Col  int
   628  }
   629  ```
   630  
   631  ## type [Repo](<https://github.com/huner2/gomarkdoc/blob/master/lang/config.go#L31-L35>)
   632  
   633  Repo represents information about a repository relevant to documentation generation\.
   634  
   635  ```go
   636  type Repo struct {
   637      Remote        string
   638      DefaultBranch string
   639      PathFromRoot  string
   640  }
   641  ```
   642  
   643  ## type [Type](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L10-L14>)
   644  
   645  Type holds documentation information for a type declaration\.
   646  
   647  ```go
   648  type Type struct {
   649      // contains filtered or unexported fields
   650  }
   651  ```
   652  
   653  ### func [NewType](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L19>)
   654  
   655  ```go
   656  func NewType(cfg *Config, doc *doc.Type, examples []*doc.Example) *Type
   657  ```
   658  
   659  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\.
   660  
   661  ### func \(\*Type\) [Consts](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L120>)
   662  
   663  ```go
   664  func (typ *Type) Consts() []*Value
   665  ```
   666  
   667  Consts lists the const declaration blocks containing values of this type\.
   668  
   669  ### func \(\*Type\) [Decl](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L60>)
   670  
   671  ```go
   672  func (typ *Type) Decl() (string, error)
   673  ```
   674  
   675  Decl provides the raw text representation of the code for the type's declaration\.
   676  
   677  ### func \(\*Type\) [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L54>)
   678  
   679  ```go
   680  func (typ *Type) Doc() *Doc
   681  ```
   682  
   683  Doc provides the structured contents of the documentation comment for the type\.
   684  
   685  ### func \(\*Type\) [Examples](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L66>)
   686  
   687  ```go
   688  func (typ *Type) Examples() (examples []*Example)
   689  ```
   690  
   691  Examples lists the examples pertaining to the type from the set provided on initialization\.
   692  
   693  ### func \(\*Type\) [Funcs](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L100>)
   694  
   695  ```go
   696  func (typ *Type) Funcs() []*Func
   697  ```
   698  
   699  Funcs lists the funcs related to the type\. This only includes functions which return an instance of the type or its pointer\.
   700  
   701  ### func \(\*Type\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L25>)
   702  
   703  ```go
   704  func (typ *Type) Level() int
   705  ```
   706  
   707  Level provides the default level that headers for the type should be rendered\.
   708  
   709  ### func \(\*Type\) [Location](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L42>)
   710  
   711  ```go
   712  func (typ *Type) Location() Location
   713  ```
   714  
   715  Location returns a representation of the node's location in a file within a repository\.
   716  
   717  ### func \(\*Type\) [Methods](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L110>)
   718  
   719  ```go
   720  func (typ *Type) Methods() []*Func
   721  ```
   722  
   723  Methods lists the funcs that use the type as a value or pointer receiver\.
   724  
   725  ### func \(\*Type\) [Name](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L30>)
   726  
   727  ```go
   728  func (typ *Type) Name() string
   729  ```
   730  
   731  Name provides the name of the type
   732  
   733  ### func \(\*Type\) [Summary](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L48>)
   734  
   735  ```go
   736  func (typ *Type) Summary() string
   737  ```
   738  
   739  Summary provides the one\-sentence summary of the type's documentation comment\.
   740  
   741  ### func \(\*Type\) [Title](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L36>)
   742  
   743  ```go
   744  func (typ *Type) Title() string
   745  ```
   746  
   747  Title provides a formatted name suitable for use in a header identifying the type\.
   748  
   749  ### func \(\*Type\) [Vars](<https://github.com/huner2/gomarkdoc/blob/master/lang/type.go#L130>)
   750  
   751  ```go
   752  func (typ *Type) Vars() []*Value
   753  ```
   754  
   755  Vars lists the var declaration blocks containing values of this type\.
   756  
   757  ## type [Value](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L8-L11>)
   758  
   759  Value holds documentation for a var or const declaration within a package\.
   760  
   761  ```go
   762  type Value struct {
   763      // contains filtered or unexported fields
   764  }
   765  ```
   766  
   767  ### func [NewValue](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L15>)
   768  
   769  ```go
   770  func NewValue(cfg *Config, doc *doc.Value) *Value
   771  ```
   772  
   773  NewValue creates a new Value from the raw const or var documentation and the token\.FileSet of files for the containing package\.
   774  
   775  ### func \(\*Value\) [Decl](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L45>)
   776  
   777  ```go
   778  func (v *Value) Decl() (string, error)
   779  ```
   780  
   781  Decl provides the raw text representation of the code for declaring the const or var\.
   782  
   783  ### func \(\*Value\) [Doc](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L39>)
   784  
   785  ```go
   786  func (v *Value) Doc() *Doc
   787  ```
   788  
   789  Doc provides the structured contents of the documentation comment for the example\.
   790  
   791  ### func \(\*Value\) [Level](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L21>)
   792  
   793  ```go
   794  func (v *Value) Level() int
   795  ```
   796  
   797  Level provides the default level that headers for the value should be rendered\.
   798  
   799  ### func \(\*Value\) [Location](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L27>)
   800  
   801  ```go
   802  func (v *Value) Location() Location
   803  ```
   804  
   805  Location returns a representation of the node's location in a file within a repository\.
   806  
   807  ### func \(\*Value\) [Summary](<https://github.com/huner2/gomarkdoc/blob/master/lang/value.go#L33>)
   808  
   809  ```go
   810  func (v *Value) Summary() string
   811  ```
   812  
   813  Summary provides the one\-sentence summary of the value's documentation comment\.
   814  
   815  
   816  
   817  Generated by [gomarkdoc](<https://github.com/huner2/gomarkdoc>)