6464)
6565
6666type generator struct {
67- legacySidebar bool
68- tfVersion string
67+ ignoreDeprecated bool
68+ legacySidebar bool
69+ tfVersion string
6970
7071 providerName string
7172 renderedProviderName string
@@ -85,10 +86,11 @@ func (g *generator) warnf(format string, a ...interface{}) {
8586 g .ui .Warn (fmt .Sprintf (format , a ... ))
8687}
8788
88- func Generate (ui cli.Ui , legacySidebar bool , providerName , renderedProviderName , renderedWebsiteDir , examplesDir , websiteTmpDir , websiteSourceDir , tfVersion string ) error {
89+ func Generate (ui cli.Ui , legacySidebar bool , providerName , renderedProviderName , renderedWebsiteDir , examplesDir , websiteTmpDir , websiteSourceDir , tfVersion string , ignoreDeprecated bool ) error {
8990 g := & generator {
90- legacySidebar : legacySidebar ,
91- tfVersion : tfVersion ,
91+ ignoreDeprecated : ignoreDeprecated ,
92+ legacySidebar : legacySidebar ,
93+ tfVersion : tfVersion ,
9294
9395 providerName : providerName ,
9496 renderedProviderName : renderedProviderName ,
@@ -319,6 +321,10 @@ func (g *generator) renderMissingProviderDoc(providerName string, schema *tfjson
319321func (g * generator ) renderMissingDocs (providerName string , providerSchema * tfjson.ProviderSchema ) error {
320322 g .infof ("generating missing resource content" )
321323 for name , schema := range providerSchema .ResourceSchemas {
324+ if g .ignoreDeprecated && schema .Block .Deprecated {
325+ continue
326+ }
327+
322328 err := g .renderMissingResourceDoc (providerName , name , "Resource" , schema ,
323329 websiteResourceFileTemplate ,
324330 websiteResourceFallbackFileTemplate ,
@@ -332,6 +338,10 @@ func (g *generator) renderMissingDocs(providerName string, providerSchema *tfjso
332338
333339 g .infof ("generating missing data source content" )
334340 for name , schema := range providerSchema .DataSourceSchemas {
341+ if g .ignoreDeprecated && schema .Block .Deprecated {
342+ continue
343+ }
344+
335345 err := g .renderMissingResourceDoc (providerName , name , "Data Source" , schema ,
336346 websiteDataSourceFileTemplate ,
337347 websiteDataSourceFallbackFileTemplate ,
0 commit comments