mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2026-02-02 15:45:12 +01:00
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:
parent
4c6f532e05
commit
2f9dcb2d21
8 changed files with 99 additions and 11 deletions
|
|
@ -18,6 +18,7 @@ local d = import "github.com/sh0rez/docsonnet/doc-util"
|
|||
* [`fn fn(help, args)`](#fn-fn)
|
||||
* [`fn obj(help, fields)`](#fn-obj)
|
||||
* [`fn pkg(name, url, help)`](#fn-pkg)
|
||||
* [`fn val(type, help, default)`](#fn-val)
|
||||
* [`obj argument`](#obj-argument)
|
||||
* [`fn new(name, type, default)`](#fn-argumentnew)
|
||||
* [`obj func`](#obj-func)
|
||||
|
|
@ -29,6 +30,8 @@ local d = import "github.com/sh0rez/docsonnet/doc-util"
|
|||
* [`fn withFields(fields)`](#fn-objectwithfields)
|
||||
* [`obj package`](#obj-package)
|
||||
* [`fn new(name, url, help)`](#fn-packagenew)
|
||||
* [`obj value`](#obj-value)
|
||||
* [`fn new(type, help, default)`](#fn-valuenew)
|
||||
|
||||
## Fields
|
||||
|
||||
|
|
@ -64,6 +67,14 @@ pkg(name, url, help)
|
|||
|
||||
`new` is a shorthand for `package.new`
|
||||
|
||||
### fn val
|
||||
|
||||
```ts
|
||||
val(type, help, default)
|
||||
```
|
||||
|
||||
`val` is a shorthand for `value.new`
|
||||
|
||||
## obj argument
|
||||
|
||||
Utilities for creating function arguments
|
||||
|
|
@ -134,4 +145,16 @@ The `withFields` modifier overrides the fields property of an already created ob
|
|||
new(name, url, help)
|
||||
```
|
||||
|
||||
new creates a new package with given `name`, `import` URL and `help` text
|
||||
new creates a new package with given `name`, `import` URL and `help` text
|
||||
|
||||
## obj value
|
||||
|
||||
Utilities for documenting plain Jsonnet values (primitives)
|
||||
|
||||
### fn value.new
|
||||
|
||||
```ts
|
||||
new(type, help, default)
|
||||
```
|
||||
|
||||
new creates a new object of given type, optionally with description and default value
|
||||
Loading…
Add table
Add a link
Reference in a new issue