docs: Regenerate docs helper
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 13 Jul 2020 09:01:38 +0000 (11:01 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 13 Jul 2020 09:01:38 +0000 (11:01 +0200)
docs/data/docs.json
tpl/js/js.go

index 2a2a0bf520043a1b3b6d395993db719ee04b5a37..440ba0fd469321714968d4f505141db86fd87cb1 100644 (file)
         "skipHTML": false,
         "footnoteAnchorPrefix": "",
         "footnoteReturnLinkContents": ""
+      },
+      "asciidocExt": {
+        "backend": "html5",
+        "docType": "article",
+        "extensions": [],
+        "attributes": {},
+        "noHeaderOrFooter": true,
+        "safeMode": "unsafe",
+        "sectionNumbers": false,
+        "verbose": true,
+        "trace": false,
+        "failureLevel": "fatal",
+        "workingFolderCurrent": false
       }
     },
     "minify": {
           "toml"
         ]
       },
+      {
+        "type": "application/typescript",
+        "string": "application/typescript",
+        "mainType": "application",
+        "subType": "typescript",
+        "delimiter": ".",
+        "suffixes": [
+          "ts"
+        ]
+      },
       {
         "type": "application/xml",
         "string": "application/xml",
           "html"
         ]
       },
+      {
+        "type": "text/jsx",
+        "string": "text/jsx",
+        "mainType": "text",
+        "subType": "jsx",
+        "delimiter": ".",
+        "suffixes": [
+          "jsx"
+        ]
+      },
       {
         "type": "text/plain",
         "string": "text/plain",
           "txt"
         ]
       },
+      {
+        "type": "text/tsx",
+        "string": "text/tsx",
+        "mainType": "text",
+        "subType": "tsx",
+        "delimiter": ".",
+        "suffixes": [
+          "tsx"
+        ]
+      },
       {
         "type": "text/x-sass",
         "string": "text/x-sass",
           "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": {
         "Base64Decode": {
           "Description": "Base64Decode returns the base64 decoding of the given content.",
           ]
         }
       },
+      "js": {
+        "Build": {
+          "Description": "",
+          "Args": null,
+          "Aliases": null,
+          "Examples": null
+        }
+      },
       "lang": {
         "Merge": {
           "Description": "",
           ]
         }
       },
+      "openapi3": {
+        "Unmarshal": {
+          "Description": "",
+          "Args": null,
+          "Aliases": null,
+          "Examples": []
+        }
+      },
       "os": {
         "FileExists": {
           "Description": "FileExists checks whether a file exists under the given path.",
           "Aliases": 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": {
           "Description": "CountRunes returns the number of runes in s, excluding whitepace.",
           "Args": [
           ]
         },
         "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"
           ],
index 4dc97a707655578c68fbd5e033a09c51cde66ee0..2232d8be77d1b76d5d8ddbd1dc99e94beec74e96 100644 (file)
@@ -25,6 +25,9 @@ import (
 
 // New returns a new instance of the js-namespaced template functions.
 func New(deps *deps.Deps) *Namespace {
+       if deps.ResourceSpec == nil {
+               return &Namespace{}
+       }
        return &Namespace{
                client: js.New(deps.BaseFs.Assets, deps.ResourceSpec),
        }