Skip to content

Commit e0422fe

Browse files
authored
Merge pull request #10 from TerraformInDepth/doc_updates
More documentation improvements
2 parents c7e19e3 + 4f80b53 commit e0422fe

File tree

7 files changed

+72
-9
lines changed

7 files changed

+72
-9
lines changed

docs/data-sources/account.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "mastodon_account Data Source - mastodon"
44
subcategory: ""
55
description: |-
6-
Account data source
6+
This data source can be used to look up accounts in the Fediverse.
77
---
88

99
# mastodon_account (Data Source)
1010

11-
Account data source
11+
This data source can be used to look up accounts in the Fediverse.
1212

1313
## Example Usage
1414

docs/resources/post.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,35 @@
33
page_title: "mastodon_post Resource - mastodon"
44
subcategory: ""
55
description: |-
6-
Post resource
6+
This resource is used to manage posts on a Mastodon instance.
77
---
88

99
# mastodon_post (Resource)
1010

11-
Post resource
11+
This resource is used to manage posts on a Mastodon instance.
1212

13+
## Example Usage
1314

15+
```terraform
16+
resource "mastodon_post" "example" {
17+
content = "I'm posting!"
18+
}
19+
```
20+
21+
### Preserve on Destroy
22+
23+
```terraform
24+
resource "mastodon_post" "example" {
25+
content = "A new EC2 instance has deployed! ID: ${aws_instance.example.id}"
26+
preserve_on_destroy = true
27+
28+
lifecycle {
29+
replace_triggered_by = [
30+
aws_instance.example.id
31+
]
32+
}
33+
}
34+
```
1435

1536
<!-- schema generated by tfplugindocs -->
1637
## Schema
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource "mastodon_post" "example" {
2+
content = "I'm posting!"
3+
}

examples/resources/scaffolding_example/resource.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/provider/account_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (d *AccountDataSource) Metadata(ctx context.Context, req datasource.Metadat
4040
func (d *AccountDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
4141
resp.Schema = schema.Schema{
4242
// This description is used by the documentation generator and the language server.
43-
MarkdownDescription: "Account data source",
43+
MarkdownDescription: "This data source can be used to look up accounts in the Fediverse.",
4444

4545
Attributes: map[string]schema.Attribute{
4646
"username": schema.StringAttribute{

internal/provider/post_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (r *PostResource) Metadata(ctx context.Context, req resource.MetadataReques
4848
func (r *PostResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
4949
resp.Schema = schema.Schema{
5050
// This description is used by the documentation generator and the language server.
51-
MarkdownDescription: "Post resource",
51+
MarkdownDescription: "This resource is used to manage posts on a Mastodon instance.",
5252

5353
Attributes: map[string]schema.Attribute{
5454
"id": schema.StringAttribute{

templates/resources/post.md.tmpl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
9+
# {{.Name}} ({{.Type}})
10+
11+
{{ .Description | trimspace }}
12+
13+
{{ if .HasExample -}}
14+
## Example Usage
15+
16+
{{tffile .ExampleFile }}
17+
{{- end }}
18+
19+
### Preserve on Destroy
20+
21+
```terraform
22+
resource "mastodon_post" "example" {
23+
content = "A new EC2 instance has deployed! ID: ${aws_instance.example.id}"
24+
preserve_on_destroy = true
25+
26+
lifecycle {
27+
replace_triggered_by = [
28+
aws_instance.example.id
29+
]
30+
}
31+
}
32+
```
33+
34+
{{ .SchemaMarkdown | trimspace }}
35+
{{- if .HasImport }}
36+
37+
## Import
38+
39+
Import is supported using the following syntax:
40+
41+
{{codefile "shell" .ImportFile }}
42+
{{- end }}

0 commit comments

Comments
 (0)