mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Add some missing doc comments
As pointed out by the linter, some exported functions and types are missing doc comments. The linter warnings have been reduced from 194 to 116. Not all missing comments have been added in this commit though.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9891c0fb0e
commit
81c13171a9
@@ -19,14 +19,19 @@ import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// DocProviders contains all DocProviders added to the system.
|
||||
var DocProviders = make(map[string]DocProvider)
|
||||
|
||||
// AddDocProvider adds or updates the DocProvider for a given name.
|
||||
func AddDocProvider(name string, provider DocProvider) {
|
||||
DocProviders[name] = provider
|
||||
}
|
||||
|
||||
// DocProvider is used to save arbitrary JSON data
|
||||
// used for the generation of the documentation.
|
||||
type DocProvider func() map[string]interface{}
|
||||
|
||||
// MarshalJSON returns a JSON representation of the DocProvider.
|
||||
func (d DocProvider) MarshalJSON() ([]byte, error) {
|
||||
return json.MarshalIndent(d(), "", " ")
|
||||
}
|
||||
|
Reference in New Issue
Block a user