markdown

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package markdown allows versions to be rendered as basic Flavored Markdown, supported by GitLab and GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

Markdown renders versions as basic flavored Markdown.

func NewMarkdown

func NewMarkdown(v versions.Versions, opts ...Option) Markdown

NewMarkdown instantiates a new template for rendering in Markdown.

func (Markdown) String

func (m Markdown) String() string

String returns versions in Markdown format.

type ModulesSorting

type ModulesSorting uint

ModulesSorting is the enum for sorting modules options.

const (
	// ModulesSortingAsInput indicates modules are rendered in the order they
	// were parsed.
	ModulesSortingAsInput ModulesSorting = iota

	// ModulesSortingAlphabetically indicates modules are rendered alphabetically
	// by their name.
	ModulesSortingAlphabetically
)

type Option

type Option func(*Markdown)

Option is configuration option for this renderer.

func WithModulesSorting

func WithModulesSorting(opt ModulesSorting) Option

WithModulesSorting allows specifyig the sorting option for modules.

func WithPackagesLicense

func WithPackagesLicense(opt bool) Option

WithPackagesLicense allows display the package License when present.

func WithPackagesSorting

func WithPackagesSorting(opt PackagesSorting) Option

WithPackagesSorting allows specifying the sorting option for packages.

type PackagesSorting

type PackagesSorting uint

PackagesSorting is the enum for sorting packages options.

const (
	// PackagesSortingAsFound indicates packages are not sorted and
	// instead they are rendered in the order the were found.
	PackagesSortingAsFound PackagesSorting = iota

	// PackagesSortingAlphabeticallySupported indicates packages are sorted
	// alphabetically in two groups by their name. The first group includes all
	// modules having the same version. The second group includes all modules
	// having different versions.
	PackagesSortingAlphabeticallySupported

	// PackagesSortingAlphabetically indicates packages are sorted alphabetically
	// by their name.
	PackagesSortingAlphabetically
)

Jump to

Keyboard shortcuts

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