Files
grafana/pkg/plugins/codegen/jenny_plugindocs.go
Tania 5f93e67419 Codegen: Generate docs for composable kinds (#61719)
* Generate docs for composable kinds

* Fix getting the kind schema

* Generate composable kinds docs

* Add disclaimer to the generated docs

* Change docs disclaimer
2023-01-22 18:58:49 -05:00

29 lines
538 B
Go

package codegen
import (
"github.com/grafana/codejen"
"github.com/grafana/grafana/pkg/plugins/pfs"
)
func PluginDocsJenny(inner codejen.OneToOne[*pfs.PluginDecl]) codejen.OneToOne[*pfs.PluginDecl] {
return &docsJenny{
inner: inner,
}
}
type docsJenny struct {
inner codejen.OneToOne[*pfs.PluginDecl]
}
func (j *docsJenny) JennyName() string {
return "PluginDocsJenny"
}
func (j *docsJenny) Generate(decl *pfs.PluginDecl) (*codejen.File, error) {
if !decl.HasSchema() {
return nil, nil
}
return j.inner.Generate(decl)
}