doc2md

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0, BSD-3-Clause Imports: 11 Imported by: 0

README

doc2md

This is forked from https://github.com/davecheney/godoc2md. The primary difference being that this version is a library that can be used by other packages.

This a fork of a fork https://github.com/WillAbides/godoc2md. But cleanup and simplified. Point it to a Go repo on disk and generate markdown from it.

Further modified to just work for science.ru.nl URLs.

Documentation

Overview

Package doc2md creates a markdown representation of a package's godoc.

This is forked from https://github.com/davecheney/godoc2md. The primary difference being that this version is a library that can be used by other packages.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Funcs contains the functions used in the template. Of these only subdir_format might be
	// of interest to callers.
	Funcs = map[string]interface{}{
		"comment_md":    commentMdFunc,
		"base":          path.Base,
		"md":            mdFunc,
		"pre":           preFunc,
		"kebab":         kebabFunc,
		"bitscape":      bitscapeFunc,
		"subdir_format": path.Base,
	}
)

Functions

func Transform

func Transform(out io.Writer, path string, config *Config) error

Transform turns your godoc into markdown.The imp (import) path will be used for the generated import statement, the same string is also used for generating file 'files' links, but then it will be prefixed with 'https://'.

Types

type Config

type Config struct {
	SrcLinkHashFormat string
	SrcLinkFormat     string
	ShowTimestamps    bool
	DeclLinks         bool
	Verbose           bool
	Import            string
	SubPackage        string // If this is a subpackage, this hold the relative import
	GitRef            string // commit, tag, or branch of the repo.
}

Config contains config options for doc2md

Jump to

Keyboard shortcuts

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