article

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SnakeCaseGenerator

func SnakeCaseGenerator(a *Article) string

SnakeCaseGenerator is generates a snake-case file name from the Article title. All punctuation, spaces and control codes are replaced by '_'s, which are squeezed. No extension is added to the file name.

Types

type Article

type Article struct {
	Handle   Handle // article identifier DOI, ISBN, ISSN...
	DOI      string
	Title    string
	Url      *url.URL // PDF download link
	Citation []byte
	// contains filtered or unexported fields
}

The Article holds data needed to download and write the article to disc. The DOI is used to fetch the title and PDF URL from Sci-Hub.

func (*Article) GenerateFileName

func (a *Article) GenerateFileName() string

GenerateFileName generates and caches the file name of the article.

func (*Article) GeneratorFunc

func (a *Article) GeneratorFunc(g fileNameFunc)

GeneratorFunc assigns a new generator

func (*Article) Reset

func (a *Article) Reset()

Reset resets all article data.

type Handle

type Handle struct {
	Value string
	Type  HandleType
}

func (Handle) String

func (h Handle) String() string

type HandleType

type HandleType int
const (
	DOI HandleType = iota
	ISBN
)

Jump to

Keyboard shortcuts

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