mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
28
pkg/plugins/codegen/jenny_plugindocs.go
Normal file
28
pkg/plugins/codegen/jenny_plugindocs.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user