diff options
author | Cameron Moore <moorereason@gmail.com> | 2018-09-06 20:40:37 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-07 08:25:51 +0200 |
commit | 30bc4ed0a01f965cc2f9187ccb6ab5d28a3149f6 (patch) | |
tree | ec739b714ea03de1f1d9d519feb3f0b1ac94548d /hugofs/language_fs.go | |
parent | f6f22ad944a1c308fd823792b2fbff1504f42cef (diff) |
Improve some godoc comments
Diffstat (limited to 'hugofs/language_fs.go')
-rw-r--r-- | hugofs/language_fs.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/hugofs/language_fs.go b/hugofs/language_fs.go index ce331fca4..db77c1fab 100644 --- a/hugofs/language_fs.go +++ b/hugofs/language_fs.go @@ -51,7 +51,8 @@ type FilePather interface { BaseDir() string } -// LanguageDirsMerger implements the afero.DirsMerger interface. +// LanguageDirsMerger implements the afero.DirsMerger interface, which is used +// to merge two directories. var LanguageDirsMerger = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, error) { m := make(map[string]*LanguageFileInfo) @@ -102,39 +103,41 @@ type LanguageFileInfo struct { weight int } -// Filename returns a file's real filename. +// Filename returns a file's real filename including the base (ie. +// "/my/base/sect/page.md"). func (fi *LanguageFileInfo) Filename() string { return fi.realFilename } -// Path returns a file's relative filename. +// Path returns a file's filename relative to the base (ie. "sect/page.md"). func (fi *LanguageFileInfo) Path() string { return fi.relFilename } -// RealName returns a file's real name. +// RealName returns a file's real base name (ie. "page.md"). func (fi *LanguageFileInfo) RealName() string { return fi.realName } -// BaseDir returns a file's base directory. +// BaseDir returns a file's base directory (ie. "/my/base"). func (fi *LanguageFileInfo) BaseDir() string { return fi.baseDir } -// Lang returns a file's language. +// Lang returns a file's language (ie. "sv"). func (fi *LanguageFileInfo) Lang() string { return fi.lang } // TranslationBaseName returns the base filename without any extension or language -// identificator. +// identifiers (ie. "page"). func (fi *LanguageFileInfo) TranslationBaseName() string { return fi.translationBaseName } // Name is the name of the file within this filesystem without any path info. -// It will be marked with language information so we can identify it as ours. +// It will be marked with language information so we can identify it as ours +// (ie. "__hugofs_sv_page.md"). func (fi *LanguageFileInfo) Name() string { return fi.name } @@ -175,7 +178,7 @@ type LanguageFs struct { afero.Fs } -// NewLanguageFs creates a new LanguageFs. +// NewLanguageFs creates a new language filesystem. func NewLanguageFs(lang string, languages map[string]bool, fs afero.Fs) *LanguageFs { if lang == "" { panic("no lang set for the language fs") @@ -191,7 +194,7 @@ func NewLanguageFs(lang string, languages map[string]bool, fs afero.Fs) *Languag return &LanguageFs{lang: lang, languages: languages, basePath: basePath, Fs: fs, nameMarker: marker} } -// Lang returns a language filesystem's language. +// Lang returns a language filesystem's language (ie. "sv"). func (fs *LanguageFs) Lang() string { return fs.lang } |