mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2025-12-11 22:10:13 +01:00
feat: add newSub (#44)
This commit is contained in:
parent
b5a6b0e838
commit
5e45c19fbe
3 changed files with 35 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -7,6 +7,7 @@ release:
|
|||
goreleaser release --rm-dist
|
||||
|
||||
docs:
|
||||
jsonnet -S -c -m doc-util/ \
|
||||
-e "(import 'doc-util/main.libsonnet').render(import 'doc-util/main.libsonnet')"
|
||||
cd doc-util && \
|
||||
jsonnet -S -c -m . \
|
||||
-e "(import './main.libsonnet').render(import './main.libsonnet')"
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ local d = import "github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet"
|
|||
* [`obj T`](#obj-t)
|
||||
* [`obj package`](#obj-package)
|
||||
* [`fn new(name, url, help, filename='', version='master')`](#fn-packagenew)
|
||||
* [`fn newSub(name, help)`](#fn-packagenewsub)
|
||||
|
||||
## Fields
|
||||
|
||||
|
|
@ -202,3 +203,17 @@ Arguments:
|
|||
* `filename` for the import, defaults to blank for backward compatibility
|
||||
* `version` for jsonnet-bundler install, defaults to `master` just like jsonnet-bundler
|
||||
|
||||
|
||||
#### fn package.newSub
|
||||
|
||||
```ts
|
||||
newSub(name, help)
|
||||
```
|
||||
|
||||
`newSub` creates a package without the preconfigured install/usage templates.
|
||||
|
||||
Arguments:
|
||||
|
||||
* given `name`
|
||||
* `help` text
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,23 @@
|
|||
'local %(name)s = import "%(import)s"'
|
||||
),
|
||||
|
||||
'#newSub':: d.fn(|||
|
||||
`newSub` creates a package without the preconfigured install/usage templates.
|
||||
|
||||
Arguments:
|
||||
|
||||
* given `name`
|
||||
* `help` text
|
||||
|||, [
|
||||
d.arg('name', d.T.string),
|
||||
d.arg('help', d.T.string),
|
||||
]),
|
||||
newSub(name, help)::
|
||||
{
|
||||
name: name,
|
||||
help: help,
|
||||
},
|
||||
|
||||
withUsageTemplate(template):: {
|
||||
usageTemplate: template,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue