extractor

package
v0.0.0-...-05455a2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	Extract(creativeWork *schema.CreativeWork, path string) error
}

Extractor updates the schema.CreativeWork structure.

type Git

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

Git extracts metadata from the Git repository containing Markdown files.

func NewGit

func NewGit(inputDirectory string) (*Git, error)

NewGit returns a new instance properly configured of the Git extractor

func (Git) Extract

func (git Git) Extract(creativeWork *schema.CreativeWork, path string) error

Extract extracts the list of contributors to the file, and date of modifications.

type Markdown

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

Markdown is an extractor converting the content of .md files to HTML.

func NewMarkdown

func NewMarkdown(inputDirectory string) *Markdown

NewMarkdown creates a new Markdown extractor

func (Markdown) Extract

func (markdown Markdown) Extract(creativeWork *schema.CreativeWork, path string) error

Extract converts the Markdown syntax to HTML in a secure way. The generated file is sanitized: all special tags and characters stripped (JavaScript, CSS...) or escaped. A "class" attributes containing language indication for syntax highlighting is added to all code snippets. All references to ".md" files are converted to links pointing to ".jsonld" files.

Jump to

Keyboard shortcuts

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