-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: strip upstream frontmatter (#2361)
When generating Pulumi frontmatter, we do not need to obtain the `title` content by parsing the upstream file. We can use the provider name instead. This fixes ~a bug~ behavior where the previous code was interpreting comments inside of the upstream frontmatter as H1. Example: https://github.com/kreuzwerker/terraform-provider-docker/blob/master/docs/index.md?plain=1#L2 - this never made it to actually get filed as a bug; it was discovered during content generation. Additionally, H1 title removal is now done via Goldmark transformer. - **Strip upstream frontmatter by default and use provider name to generate Pulumi frontmatter title. Add tests.** - **Add capitalization**
- Loading branch information
1 parent
902f740
commit bdd39dc
Showing
11 changed files
with
302 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the resources supported by Artifactory. The provider needs to be configured with the proper credentials before it can be used. | ||
|
||
Links to documentation for specific resources can be found in the table of contents to the left. | ||
|
||
This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. You can determine which license you have by accessing the following the URL `${host}/artifactory/api/system/licenses/`. | ||
|
||
You can either access it via API, or web browser - it require admin level credentials. | ||
|
||
```sh | ||
curl -sL ${host}/artifactory/api/system/licenses/ | jq . | ||
{ | ||
"type" : "Enterprise Plus Trial", | ||
"validThrough" : "Jan 29, 2022", | ||
"licensedTo" : "JFrog Ltd" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Artifactory Provider | ||
|
||
The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the resources supported by Artifactory. The provider needs to be configured with the proper credentials before it can be used. | ||
|
||
Links to documentation for specific resources can be found in the table of contents to the left. | ||
|
||
This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. You can determine which license you have by accessing the following the URL `${host}/artifactory/api/system/licenses/`. | ||
|
||
You can either access it via API, or web browser - it require admin level credentials. | ||
|
||
```sh | ||
curl -sL ${host}/artifactory/api/system/licenses/ | jq . | ||
{ | ||
"type" : "Enterprise Plus Trial", | ||
"validThrough" : "Jan 29, 2022", | ||
"licensedTo" : "JFrog Ltd" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
layout: "openstack" | ||
page_title: "Provider: OpenStack" | ||
sidebar_current: "docs-openstack-index" | ||
description: |- | ||
The OpenStack provider is used to interact with the many resources supported by OpenStack. The provider needs to be configured with the proper credentials before it can be used. | ||
--- | ||
|
||
The OpenStack provider is used to interact with the | ||
many resources supported by OpenStack. The provider needs to be configured | ||
with the proper credentials before it can be used. | ||
|
||
Use the navigation to the left to read about the available resources. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
# Define required providers | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
openstack = { | ||
source = "terraform-provider-openstack/openstack" | ||
version = "~> 1.53.0" | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
layout: "openstack" | ||
page_title: "Provider: OpenStack" | ||
sidebar_current: "docs-openstack-index" | ||
description: |- | ||
The OpenStack provider is used to interact with the many resources supported by OpenStack. The provider needs to be configured with the proper credentials before it can be used. | ||
--- | ||
|
||
# OpenStack Provider | ||
|
||
The OpenStack provider is used to interact with the | ||
many resources supported by OpenStack. The provider needs to be configured | ||
with the proper credentials before it can be used. | ||
|
||
Use the navigation to the left to read about the available resources. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
# Define required providers | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
openstack = { | ||
source = "terraform-provider-openstack/openstack" | ||
version = "~> 1.53.0" | ||
} | ||
} | ||
} | ||
``` |
18 changes: 18 additions & 0 deletions
18
pkg/tfgen/test_data/strip-front-matter/artifactory-expected.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Artifactory Provider | ||
|
||
The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the resources supported by Artifactory. The provider needs to be configured with the proper credentials before it can be used. | ||
|
||
Links to documentation for specific resources can be found in the table of contents to the left. | ||
|
||
This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. You can determine which license you have by accessing the following the URL `${host}/artifactory/api/system/licenses/`. | ||
|
||
You can either access it via API, or web browser - it require admin level credentials. | ||
|
||
```sh | ||
curl -sL ${host}/artifactory/api/system/licenses/ | jq . | ||
{ | ||
"type" : "Enterprise Plus Trial", | ||
"validThrough" : "Jan 29, 2022", | ||
"licensedTo" : "JFrog Ltd" | ||
} | ||
``` |
18 changes: 18 additions & 0 deletions
18
pkg/tfgen/test_data/strip-front-matter/artifactory-input.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Artifactory Provider | ||
|
||
The [Artifactory](https://jfrog.com/artifactory/) provider is used to interact with the resources supported by Artifactory. The provider needs to be configured with the proper credentials before it can be used. | ||
|
||
Links to documentation for specific resources can be found in the table of contents to the left. | ||
|
||
This provider requires access to Artifactory APIs, which are only available in the _licensed_ pro and enterprise editions. You can determine which license you have by accessing the following the URL `${host}/artifactory/api/system/licenses/`. | ||
|
||
You can either access it via API, or web browser - it require admin level credentials. | ||
|
||
```sh | ||
curl -sL ${host}/artifactory/api/system/licenses/ | jq . | ||
{ | ||
"type" : "Enterprise Plus Trial", | ||
"validThrough" : "Jan 29, 2022", | ||
"licensedTo" : "JFrog Ltd" | ||
} | ||
``` |
22 changes: 22 additions & 0 deletions
22
pkg/tfgen/test_data/strip-front-matter/openstack-expected.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# OpenStack Provider | ||
|
||
The OpenStack provider is used to interact with the | ||
many resources supported by OpenStack. The provider needs to be configured | ||
with the proper credentials before it can be used. | ||
|
||
Use the navigation to the left to read about the available resources. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
# Define required providers | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
openstack = { | ||
source = "terraform-provider-openstack/openstack" | ||
version = "~> 1.53.0" | ||
} | ||
} | ||
} | ||
``` |
Oops, something went wrong.