doc

package
v0.0.0-...-77be293 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Overview

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

godoc2md converts godoc formatted package documentation into Markdown format.

Usage

godoc2md $PACKAGE > $GOPATH/src/$PACKAGE/README.md

Index

Constants

This section is empty.

Variables

View Source
var GOARCH = func() string {
	if env := os.Getenv("GOARCH"); env != "" {
		return env
	} else {
		return runtime.GOARCH
	}
}()
View Source
var GOOS = func() string {
	if env := os.Getenv("GOOS"); env != "" {
		return env
	} else {
		return runtime.GOOS
	}
}()

Functions

func Main

func Main() int

func ToMD

func ToMD(w io.Writer, text string)

ToMD converts comment text to formatted Markdown. The comment was prepared by DocReader, so it is known not to have leading, trailing blank lines nor to have trailing spaces at the end of lines. The comment markers have already been removed.

Each span of unindented non-blank lines is converted into a single paragraph. There is one exception to the rule: a span that consists of a single line, is followed by another paragraph span, begins with a capital letter, and contains no punctuation is formatted as a heading.

A span of indented lines is converted into a <pre> block, with the common indent prefix removed.

URLs in the comment text are converted into links.

Types

This section is empty.

Jump to

Keyboard shortcuts

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