parse

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDocs

func ConvertDocs(packageDir string, c *Config) (string, error)

ConvertDocs processes the package docs and converts to markdown. The

func ToMD

func ToMD(w io.Writer, text, syntax 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

type Config

type Config struct {
	FencedCodeLanguage   string
	ShowGeneratedSuffix  bool
	ShowGodocBadge       bool
	ShowGoReportBadge    bool
	CustomMarkdownBadges []string
	CustomMarkdownFile   string
}

func DefaultConfig

func DefaultConfig() *Config

Directories

Path Synopsis
We don't use the 'testdata' package, as this messes up the import paths reported by the docs tools.
We don't use the 'testdata' package, as this messes up the import paths reported by the docs tools.

Jump to

Keyboard shortcuts

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