feat: document plain values (#12)

* feat: document plain values

Adds `d.val` to attach type and help information to plain Jsonnet
values, apart from specially treated `fn` and `obj`.

* feat: defaults
This commit is contained in:
sh0rez 2020-07-27 16:59:04 +02:00 committed by GitHub
parent 4c6f532e05
commit 2f9dcb2d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 99 additions and 11 deletions

View file

@ -24,12 +24,13 @@ func main() {
outputJSON := root.Flags().Bool("json", false, "print loaded docsonnet as JSON")
outputRaw := root.Flags().Bool("raw", false, "don't transform, dump raw eval result")
urlPrefix := root.Flags().String("urlPrefix", "/", "url-prefix for frontmatter")
jpath := root.Flags().StringSliceP("jpath", "J", []string{"vendor"}, "Specify an additional library search dir (right-most wins)")
root.Run = func(cmd *cli.Command, args []string) error {
file := args[0]
log.Println("Extracting from Jsonnet")
data, err := docsonnet.Extract(file)
data, err := docsonnet.Extract(file, docsonnet.Opts{JPath: *jpath})
if err != nil {
log.Fatalln("Extracting:", err)
}