docs: Regenerate docs helper

This commit is contained in:
Bjørn Erik Pedersen 2020-07-13 11:01:38 +02:00
parent 9df98ec49c
commit 25e3da3343
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 92 additions and 1 deletions

View file

@ -1488,6 +1488,19 @@
"skipHTML": false, "skipHTML": false,
"footnoteAnchorPrefix": "", "footnoteAnchorPrefix": "",
"footnoteReturnLinkContents": "" "footnoteReturnLinkContents": ""
},
"asciidocExt": {
"backend": "html5",
"docType": "article",
"extensions": [],
"attributes": {},
"noHeaderOrFooter": true,
"safeMode": "unsafe",
"sectionNumbers": false,
"verbose": true,
"trace": false,
"failureLevel": "fatal",
"workingFolderCurrent": false
} }
}, },
"minify": { "minify": {
@ -1572,6 +1585,16 @@
"toml" "toml"
] ]
}, },
{
"type": "application/typescript",
"string": "application/typescript",
"mainType": "application",
"subType": "typescript",
"delimiter": ".",
"suffixes": [
"ts"
]
},
{ {
"type": "application/xml", "type": "application/xml",
"string": "application/xml", "string": "application/xml",
@ -1664,6 +1687,16 @@
"html" "html"
] ]
}, },
{
"type": "text/jsx",
"string": "text/jsx",
"mainType": "text",
"subType": "jsx",
"delimiter": ".",
"suffixes": [
"jsx"
]
},
{ {
"type": "text/plain", "type": "text/plain",
"string": "text/plain", "string": "text/plain",
@ -1674,6 +1707,16 @@
"txt" "txt"
] ]
}, },
{
"type": "text/tsx",
"string": "text/tsx",
"mainType": "text",
"subType": "tsx",
"delimiter": ".",
"suffixes": [
"tsx"
]
},
{ {
"type": "text/x-sass", "type": "text/x-sass",
"string": "text/x-sass", "string": "text/x-sass",
@ -3189,6 +3232,21 @@
"Examples": [] "Examples": []
} }
}, },
"debug": {
"Dump": {
"Description": "Dump returns a object dump of val as a string.\nNote that not every value passed to Dump will print so nicely, but\nwe'll improve on that. We recommend using the \"go\" Chroma lexer to format the output\nnicely.\nAlso note that the output from Dump may change from Hugo version to the next,\nso don't depend on a specific output.",
"Args": [
"val"
],
"Aliases": null,
"Examples": [
[
"{{- $m := newScratch -}}\n{{- $m.Set \"Hugo\" \"Rocks!\" -}}\n{{- $m.Values | debug.Dump | safeHTML -}}",
"map[string]interface {}{\n \"Hugo\": \"Rocks!\",\n}"
]
]
}
},
"encoding": { "encoding": {
"Base64Decode": { "Base64Decode": {
"Description": "Base64Decode returns the base64 decoding of the given content.", "Description": "Base64Decode returns the base64 decoding of the given content.",
@ -3505,6 +3563,14 @@
] ]
} }
}, },
"js": {
"Build": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": null
}
},
"lang": { "lang": {
"Merge": { "Merge": {
"Description": "", "Description": "",
@ -3735,6 +3801,14 @@
] ]
} }
}, },
"openapi3": {
"Unmarshal": {
"Description": "",
"Args": null,
"Aliases": null,
"Examples": []
}
},
"os": { "os": {
"FileExists": { "FileExists": {
"Description": "FileExists checks whether a file exists under the given path.", "Description": "FileExists checks whether a file exists under the given path.",
@ -4229,6 +4303,20 @@
"Aliases": null, "Aliases": null,
"Examples": null "Examples": null
}, },
"Count": {
"Description": "Count counts the number of non-overlapping instances of substr in s.\nIf substr is an empty string, Count returns 1 + the number of Unicode code points in s.",
"Args": [
"substr",
"s"
],
"Aliases": null,
"Examples": [
[
"{{\"aabab\" | strings.Count \"a\" }}",
"3"
]
]
},
"CountRunes": { "CountRunes": {
"Description": "CountRunes returns the number of runes in s, excluding whitepace.", "Description": "CountRunes returns the number of runes in s, excluding whitepace.",
"Args": [ "Args": [
@ -4767,7 +4855,7 @@
] ]
}, },
"Unmarshal": { "Unmarshal": {
"Description": "Unmarshal unmarshals the data given, which can be either a string\nor a Resource. Supported formats are JSON, TOML, YAML, and CSV.\nYou can optionally provide an options map as the first argument.", "Description": "Unmarshal unmarshals the data given, which can be either a string, json.RawMessage\nor a Resource. Supported formats are JSON, TOML, YAML, and CSV.\nYou can optionally provide an options map as the first argument.",
"Args": [ "Args": [
"args" "args"
], ],

View file

@ -25,6 +25,9 @@ import (
// New returns a new instance of the js-namespaced template functions. // New returns a new instance of the js-namespaced template functions.
func New(deps *deps.Deps) *Namespace { func New(deps *deps.Deps) *Namespace {
if deps.ResourceSpec == nil {
return &Namespace{}
}
return &Namespace{ return &Namespace{
client: js.New(deps.BaseFs.Assets, deps.ResourceSpec), client: js.New(deps.BaseFs.Assets, deps.ResourceSpec),
} }