Skip to content

Commit

Permalink
Fix table rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Dec 2, 2024
1 parent 2dca5ca commit b95b5f5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ All resources and functions have been tested with the following releases.
|-----------------|---------|
| Catalyst SD-WAN | 20.9 |
| Catalyst SD-WAN | 20.12 |
## Getting Started

The following guides with examples exist to demonstrate the use of the provider:

- Getting Started
- Updating Templates
- Configuration Groups
## Example Usage

{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
Expand Down
29 changes: 29 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package provider

import (
"bytes"
"context"
"fmt"
"path/filepath"
Expand All @@ -27,6 +28,7 @@ import (
pf "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen"
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"

"github.com/pulumi/pulumi-sdwan/provider/pkg/version"
Expand Down Expand Up @@ -83,6 +85,7 @@ func Provider() tfbridge.ProviderInfo {
TFProviderVersion: "0.4.1",
Version: version.Version,
Config: map[string]*tfbridge.SchemaInfo{},
DocRules: &tfbridge.DocRuleInfo{EditRules: docEditRules},
Resources: map[string]*tfbridge.ResourceInfo{
"sdwan_activate_centralized_policy": {ComputeID: StaticID("sdwan:activateCentralizedPolicy")},
"sdwan_attach_feature_device_template": {ComputeID: StaticID("sdwan:attachFeatureDeviceTemplate")},
Expand Down Expand Up @@ -140,3 +143,29 @@ func Provider() tfbridge.ProviderInfo {

return prov
}

func docEditRules(defaults []tfbridge.DocsEdit) []tfbridge.DocsEdit {
return append(
defaults,
trimWhitespace,
skipGettingStartedSection,
)
}

// Removes a blank line at the beginning of the doc
var trimWhitespace = tfbridge.DocsEdit{
Path: "index.md",
Edit: func(_ string, content []byte) ([]byte, error) {
return bytes.TrimSpace(content), nil
},
}

// Strips an upstream Getting Started section
var skipGettingStartedSection = tfbridge.DocsEdit{
Path: "index.md",
Edit: func(_ string, content []byte) ([]byte, error) {
return tfgen.SkipSectionByHeaderContent(content, func(headerText string) bool {
return headerText == "Getting Started"
})
},
}

0 comments on commit b95b5f5

Please sign in to comment.