doc

package
v0.0.0-...-216e240 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package doc handles documentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SlugFromOldID

func SlugFromOldID(i int) string

SlugFromOldID gets a doc file's slug from its old ID

Types

type Document

type Document struct {
	Slug      string
	OldID     int
	Languages map[string]File
}

Document represents a documentation file, providing its old ID, its slug, and all its variations in the various languages.

func (Document) File

func (d Document) File(lang string) File

File retrieves a Document's File based on the passed language, and returns the values for the referenceLanguage (en) if in the passed language they are not available

type File

type File struct {
	IsUpdated bool
	Title     string
	// contains filtered or unexported fields
}

File represents the single documentation file of a determined language.

func GetFile

func GetFile(slug, language string) File

GetFile retrieves a file, given a slug and a language.

func (File) Data

func (f File) Data() (string, error)

Data retrieves data from file's actual file on disk.

type LanguageDoc

type LanguageDoc struct {
	Title string
	Slug  string
}

LanguageDoc has the only purpose to be returned by GetDocs.

func GetDocs

func GetDocs(lang string) []LanguageDoc

GetDocs retrieves a list of documents in a certain language, with titles and slugs.

Jump to

Keyboard shortcuts

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