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
This commit is contained in:
Tania
2023-01-23 00:58:49 +01:00
committed by GitHub
parent 65127d4913
commit 5f93e67419
20 changed files with 483 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
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)
}