md

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParseMD model.ParseFunc = func(in io.ReadCloser, options ...model.ParseOption) *model.ParseOutput {

	c := &model.ParseConfig{}

	for _, option := range options {
		option(c)
	}

	if c.Verbose {
		fmt.Println("--> parsing Markdown...")
	}

	defer in.Close()
	contents := parseMD(in)

	if c.Verbose {
		fmt.Println("--> parsed")
		fmt.Printf("%s\n", contents)
	}

	var tagWeights model.TagWeights

	if len(c.TagWeights) == 0 {
		tagWeights = defaultTagWeights
	} else {
		tagWeights = c.TagWeights
	}

	tags, title := tagifyMD(contents, tagWeights, c.Verbose, c.NoStopWords)

	return &model.ParseOutput{Tags: tags, DocTitle: title, DocHash: contents.hash()}
}

ParseMD parses given Markdown document input into a slice of tags.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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