pkgdoc

package module
v0.0.0-...-ff13b7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2016 License: BSD-3-Clause Imports: 13 Imported by: 1

README

pkgdoc

Package pkgdoc prepares package documentation from source.

Usage

package main

import (
    "log"
    "github.com/pnelson/pkgdoc"
)

func main() {
    doc, err := pkgdoc.New("net")
    if err != nil {
        log.Fatal(err)
    }
    log.Println(doc.Synopsis)
}

Documentation

Overview

Package pkgdoc prepares package documentation from source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc string

Doc represents source code documentation.

func (Doc) HTML

func (d Doc) HTML() template.HTML

HTML returns the source code documentation as formatted HTML.

type Function

type Function struct {
	Doc  Doc
	Name string
	Decl string
}

Function represents the documentation for functions.

type Package

type Package struct {
	Name        string
	ImportPath  string
	Doc         Doc
	Synopsis    string
	Constants   []Value
	Variables   []Value
	Functions   []Function
	Types       []Type
	SubPackages []string
}

Package represents package documentation.

func New

func New(name string) (Package, error)

New returns a new Package.

The package is loaded from source and must exist on the file system.

type Type

type Type struct {
	Doc       Doc
	Name      string
	Decl      string
	Constants []Value
	Variables []Value
	Functions []Function
	Methods   []Function
}

Type represents the documentation for types.

type Value

type Value struct {
	Doc  Doc
	Decl string
}

Value represents the documentation for values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL