Skip to content
forked from chocolacula/gdmd

godoc alternative for static markdown documentation

License

Notifications You must be signed in to change notification settings

freakytoad1/gdmd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Doc Markdown

godoc alternative for static markdown documentation.

Motivation

Standard pkg.go.dev is awesome but not suitable for private repos. You can use pkgsite as local alternative but it's not perfect. Both occasionally skip certain files and generate incomplete documentation.

As stated in the comment of an engineer from Amazon sometimes it's a nightmare. You have to checkout a repo, run local server and open it in a browser only to read documentation.

With gdmd you don't even have to host your documentation, you can keep it in your repo along with the code. The generator creates a README.md with a package documentation in a package folder.
You can navigate through the documentation right in GitHub UI, any open directory with source code will render its documentation.

How to use

First, you have to

go install github.com/chocolacula/gdmd/cmd/gdmd

Then generate documentation for a package in a directory

gdmd ./directory

Example

package main

The single package in the project, contains data representation, parsing and generation logic.

Index

Variables

Simple error to indicate empty folder

var EmptyErr = errors.New("empty folder")

Functions

func Generate(root string, pkg *Package)

Generate creates markdown files for the given [Package] and its nested packages.

Types

type Function struct {
  Doc       string
  Name      string
  Pos       Position
  Recv      string // "" for functions, receiver name for methods
  Signature string
}

Function represents a function or method declaration.

func NewFunction(fset *token.FileSet, f *doc.Func) Function

You can compare self-generated documentation with pkg.dev.

About

godoc alternative for static markdown documentation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%