]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
all: Fix comments for exported functions and packages
authorOleksandr Redko <Oleksandr_Redko@epam.com>
Thu, 18 May 2023 09:05:56 +0000 (12:05 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 18 May 2023 19:25:27 +0000 (21:25 +0200)
24 files changed:
common/herrors/errors.go
common/herrors/file_error.go
common/maps/params.go
config/security/whitelist.go
deps/deps.go
helpers/general.go
hugofs/fs.go
hugolib/page.go
hugolib/pagecollections.go
identity/identity.go
langs/i18n/translationProvider.go
lazy/init.go
markup/asciidocext/asciidocext_config/config.go
markup/converter/hooks/hooks.go
markup/goldmark/codeblocks/transform.go
markup/goldmark/goldmark_config/config.go
markup/highlight/highlight.go
markup/internal/attributes/attributes.go
markup/tableofcontents/tableofcontents.go
resources/page/page.go
resources/page/site.go
resources/postpub/postpub.go
resources/resource_transformers/tocss/dartsass/client.go
tpl/compare/compare.go

index 822271ef202e44bdc5652e261b36a07aa2620cf9..4d86423629c5ef299b9ad5a9ad53f174503b533f 100644 (file)
@@ -49,7 +49,7 @@ func Recover(args ...any) {
        }
 }
 
-// Get the current goroutine id. Used only for debugging.
+// GetGID the current goroutine id. Used only for debugging.
 func GetGID() uint64 {
        b := make([]byte, 64)
        b = b[:runtime.Stack(b, false)]
index 9273b2a8041774d1e24e93a8af4ed5b7dbed19c9..30417897f6a6ea6e6338fe833ae8b59830f6256c 100644 (file)
@@ -35,7 +35,7 @@ import (
 type FileError interface {
        error
 
-       // ErroContext holds some context information about the error.
+       // ErrorContext holds some context information about the error.
        ErrorContext() *ErrorContext
 
        text.Positioner
index a3e607b8935f11f8b04eafa561e35359139110c4..d94d16f9d6cee8469bff9fca66a82a29ce9edb04 100644 (file)
@@ -37,7 +37,7 @@ func (p Params) GetNested(indices ...string) any {
        return v
 }
 
-// Set overwrites values in dst with values in src for common or new keys.
+// SetParams overwrites values in dst with values in src for common or new keys.
 // This is done recursively.
 func SetParams(dst, src Params) {
        for k, v := range src {
@@ -83,7 +83,7 @@ func MergeParamsWithStrategy(strategy string, dst, src Params) {
        dst.merge(ParamsMergeStrategy(strategy), src)
 }
 
-// MergeParamsWithStrategy transfers values from src to dst for new keys using the merge encoded in dst.
+// MergeParams transfers values from src to dst for new keys using the merge encoded in dst.
 // This is done recursively.
 func MergeParams(dst, src Params) {
        ms, _ := dst.GetMergeStrategy()
index ee1025d3bd8ecca1b28c525d07baba0c88812ce4..72a80da2e236f8e583611845591d51ecb82aa261 100644 (file)
@@ -84,7 +84,7 @@ func NewWhitelist(patterns ...string) Whitelist {
        return Whitelist{patterns: patternsr, patternsStrings: patternsStrings}
 }
 
-// Accepted reports whether name is whitelisted.
+// Accept reports whether name is whitelisted.
 func (w Whitelist) Accept(name string) bool {
        if w.acceptNone {
                return false
index 9cb8557a5a2de964486fefebbac86a82393df9d9..0eeb4248bd8b7a3ddfa32f6a00c573826c9e4ba0 100644 (file)
@@ -231,7 +231,7 @@ type globalErrHandler struct {
        quit chan struct{}
 }
 
-// SendErr sends the error on a channel to be handled later.
+// SendError sends the error on a channel to be handled later.
 // This can be used in situations where returning and aborting the current
 // operation isn't practical.
 func (e *globalErrHandler) SendError(err error) {
index e8d8bdecc566ec26044d369ca3a5ebe123861921..50f7920f6b578b2ef94ac68f51592ff90a666f4c 100644 (file)
@@ -117,7 +117,7 @@ func UniqueStringsReuse(s []string) []string {
        return result
 }
 
-// UniqueStringsReuse returns a sorted slice with any duplicates removed.
+// UniqueStringsSorted returns a sorted slice with any duplicates removed.
 // It will modify the input slice.
 func UniqueStringsSorted(s []string) []string {
        if len(s) == 0 {
index 855a821df9f54a4178cc2c6b9af9af57f056286c..5dae3a78aecf221ffcb5d6f32b31b83a4fe7b727 100644 (file)
@@ -85,7 +85,7 @@ func NewFromOld(fs afero.Fs, cfg config.Provider) *Fs {
        return newFs(fs, fs, workingDir, publishDir)
 }
 
-// NewFrom creates a new Fs based on the provided Afero Fss
+// NewFromSourceAndDestination creates a new Fs based on the provided Afero Fss
 // as the source and destination file systems.
 func NewFromSourceAndDestination(source, destination afero.Fs, cfg config.Provider) *Fs {
        workingDir, publishDir := getWorkingPublishDir(cfg)
@@ -178,7 +178,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error)
        return counter, fs.RemoveAll(dir)
 }
 
-// HasOsFs returns whether fs is an OsFs or if it fs wraps an OsFs.
+// IsOsFs returns whether fs is an OsFs or if it fs wraps an OsFs.
 // TODO(bep) make this nore robust.
 func IsOsFs(fs afero.Fs) bool {
        var isOsFs bool
@@ -202,7 +202,7 @@ type FilesystemsUnwrapper interface {
        UnwrapFilesystems() []afero.Fs
 }
 
-// FilesystemsProvider returns the underlying filesystem.
+// FilesystemUnwrapper returns the underlying filesystem.
 type FilesystemUnwrapper interface {
        UnwrapFilesystem() afero.Fs
 }
index 7356cb545c9dc0b517536844e0d1e911764d3646..2e6b6c36fab2f66a524ff245bc7ce3c9c0a94f18 100644 (file)
@@ -146,7 +146,7 @@ func (p *pageState) Eq(other any) bool {
        return p == pp
 }
 
-// GetIdentify is for internal use.
+// GetIdentity is for internal use.
 func (p *pageState) GetIdentity() identity.Identity {
        return identity.NewPathIdentity(files.ComponentFolderContent, filepath.FromSlash(p.Pathc()))
 }
index 6f7d291bc691a7645cba1c9c188fa73b1cff2390..b49669bb66c67cd1abc03afe39a275343bd3c490 100644 (file)
@@ -57,7 +57,7 @@ func (c *PageCollections) AllPages() page.Pages {
        return c.allPages.get()
 }
 
-// AllPages returns all regular pages for all languages.
+// AllRegularPages returns all regular pages for all languages.
 func (c *PageCollections) AllRegularPages() page.Pages {
        return c.allRegularPages.get()
 }
index 033409b807a550846c8b2f6bbaad6e38916e6c65..e73951caff3eb315881dcccb10e93806d783abcf 100644 (file)
@@ -20,7 +20,7 @@ import (
        "sync/atomic"
 )
 
-// NewIdentityManager creates a new Manager starting at id.
+// NewManager creates a new Manager starting at id.
 func NewManager(id Provider) Manager {
        return &identityManager{
                Provider: id,
index 6d7b3ecfd5d628557880da74f0f11e22a36ccff0..2c3c15710d3310dda11d8661650b3544fc14f563 100644 (file)
@@ -123,7 +123,7 @@ func addTranslationFile(bundle *i18n.Bundle, r source.File) error {
        return nil
 }
 
-// Clone sets the language func for the new language.
+// CloneResource sets the language func for the new language.
 func (tp *TranslationProvider) CloneResource(dst, src *deps.Deps) error {
        dst.Translate = tp.t.Func(dst.Conf.Language().Lang)
        return nil
index bfb9c4e0791ff92504bfdbf24f6b06a6786e6d7e..9a25e1e05f4e5e560c00a11479e87554e31ccef5 100644 (file)
@@ -73,7 +73,7 @@ func (ini *Init) Branch(initFn func(context.Context) (any, error)) *Init {
        return ini.add(true, initFn)
 }
 
-// BranchdWithTimeout is same as Branch, but with a timeout.
+// BranchWithTimeout is same as Branch, but with a timeout.
 func (ini *Init) BranchWithTimeout(timeout time.Duration, f func(ctx context.Context) (any, error)) *Init {
        return ini.Branch(func(ctx context.Context) (any, error) {
                return ini.withTimeout(ctx, timeout, f)
index 1409b2783eaeee9800814b63e20bd344705e7b55..4c38fbbbf7b22d3bb8c4c22bb5ab93b7e1d819b1 100644 (file)
@@ -11,7 +11,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Package asciidoc_config holds asciidoc related configuration.
+// Package asciidocext_config holds asciidoc related configuration.
 package asciidocext_config
 
 var (
index 5c7b9692d5687366d7dcc461d63a45b254f8bf6f..c5be4d1f0ce7da481aa2188773dad707dbf6dc87 100644 (file)
@@ -121,7 +121,7 @@ type HeadingContext interface {
 
 // HeadingRenderer describes a uniquely identifiable rendering hook.
 type HeadingRenderer interface {
-       // Render writes the rendered content to w using the data in w.
+       // RenderHeading writes the rendered content to w using the data in w.
        RenderHeading(cctx context.Context, w io.Writer, ctx HeadingContext) error
        identity.Provider
 }
index be5334b5f900b6d531a0a3e3248b56cf9f0c9bf9..829dfcc190d5f28dd66fd6ebd06a879be9dd1a30 100644 (file)
@@ -6,7 +6,7 @@ import (
        "github.com/yuin/goldmark/text"
 )
 
-// Kind is the kind of an Hugo code block.
+// KindCodeBlock is the kind of an Hugo code block.
 var KindCodeBlock = ast.NewNodeKind("HugoCodeBlock")
 
 // Its raw contents are the plain text of the code block.
index f35427ac180b5136b1535351fba724b2ed581149..a6fe0e62413ceb28f500a686fcec7838d6abd466 100644 (file)
@@ -20,7 +20,7 @@ const (
        AutoHeadingIDTypeBlackfriday = "blackfriday"
 )
 
-// DefaultConfig holds the default Goldmark configuration.
+// Default holds the default Goldmark configuration.
 var Default = Config{
        Extensions: Extensions{
                Typographer: Typographer{
index cb0d578dee7debb1b5a6bf0c51f5602118458f3c..e2a4ccdb9f4871ac832f30fa798bc38d2bef4458 100644 (file)
@@ -148,7 +148,7 @@ func (h chromaHighlighter) IsDefaultCodeBlockRenderer() bool {
 
 var id = identity.NewPathIdentity("chroma", "highlight")
 
-// GetIdentify is for internal use.
+// GetIdentity is for internal use.
 func (h chromaHighlighter) GetIdentity() identity.Identity {
        return id
 }
index 09bba5c41f1ef9607a6e1e783d6da4dc3df360d9..d2c8a860f613ce2a7aded78d212dc6551323e565 100644 (file)
@@ -199,7 +199,7 @@ func RenderASTAttributes(w hugio.FlexiWriter, attributes ...ast.Attribute) {
        }
 }
 
-// Render writes the attributes to the given as attributes to an HTML element.
+// RenderAttributes Render writes the attributes to the given as attributes to an HTML element.
 // This is used for the default codeblock rendering.
 // This performs HTML escaping of string attributes.
 func RenderAttributes(w hugio.FlexiWriter, skipClass bool, attributes ...Attribute) {
index 774b5c6cd361c4d681b0c149cec387a68d054f69..5afb36067ca8258a648795550598289a75379287 100644 (file)
@@ -31,7 +31,7 @@ type Builder struct {
        toc *Fragments
 }
 
-// Add adds the heading to the ToC.
+// AddAt adds the heading to the ToC.
 func (b *Builder) AddAt(h *Heading, row, level int) {
        if b.toc == nil {
                b.toc = &Fragments{}
index 1ec56e8cf626609b3e38237a73ba4b08d2ff2409..b1c8671958859deeb285858f3dc82fe693f9684f 100644 (file)
@@ -334,7 +334,7 @@ type PageWithoutContent interface {
        // Used in change/dependency tracking.
        identity.Provider
 
-       // Headings returns the headings for this page when a filter is set.
+       // HeadingsFiltered returns the headings for this page when a filter is set.
        // This is currently only triggered with the Related content feature
        // and the "fragments" type of index.
        HeadingsFiltered(context.Context) tableofcontents.Headings
@@ -373,7 +373,7 @@ type RefProvider interface {
        // RelRef returns a relative URL to a page.
        RelRef(argsm map[string]any) (string, error)
 
-       // RefFrom is for internal use only.
+       // RelRefFrom is for internal use only.
        RelRefFrom(argsm map[string]any, source any) (string, error)
 }
 
index aff7e86fe7ed5fa925f6113d3ae8a1dae1b2ff1e..16e070160a48ecd8d119633018af7cb625594fad 100644 (file)
@@ -128,13 +128,13 @@ type Site interface {
        // For internal use only.
        GetPageWithTemplateInfo(info tpl.Info, ref ...string) (Page, error)
 
-       // BuildDraft is deprecated and will be removed in a future release.
+       // BuildDrafts is deprecated and will be removed in a future release.
        BuildDrafts() bool
 
-       // IsMultilingual reports whether this site is configured with more than one language.
+       // IsMultiLingual reports whether this site is configured with more than one language.
        IsMultiLingual() bool
 
-       // LanguagePrefi returns the language prefix for this site.
+       // LanguagePrefix returns the language prefix for this site.
        LanguagePrefix() string
 }
 
index 5911362ec11685059c0731936b24adde4c501052..93b5c2638540ef62597394871b113f2f0203d9a7 100644 (file)
@@ -55,7 +55,7 @@ func NewPostPublishResource(id int, r resource.Resource) PostPublishedResource {
        }
 }
 
-// postPublishResource holds a Resource to be transformed post publishing.
+// PostPublishResource holds a Resource to be transformed post publishing.
 type PostPublishResource struct {
        prefix   string
        delegate resource.Resource
index f45e6537abdb744887dc28db847435f94147645b..f358b93e5f254086c075b8ae587395ba4cc87f7c 100644 (file)
@@ -11,7 +11,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Package godartsass integrates with the Dass Sass Embedded protocol to transpile
+// Package dartsass integrates with the Dass Sass Embedded protocol to transpile
 // SCSS/SASS.
 package dartsass
 
index 2ef5aacfefaaef9ddb79a4073e9e2b1371ed15b9..907be9b15bfdda77250ee797dc25fe3d62281508 100644 (file)
@@ -197,7 +197,7 @@ func (n *Namespace) Le(first any, others ...any) bool {
        return true
 }
 
-// Lt returns the boolean truth of arg1 < arg2 && arg1 < arg3 && arg1 < arg4.
+// LtCollate returns the boolean truth of arg1 < arg2 && arg1 < arg3 && arg1 < arg4.
 // The provided collator will be used for string comparisons.
 // This is for internal use.
 func (n *Namespace) LtCollate(collator *langs.Collator, first any, others ...any) bool {