Skip to content

Commit

Permalink
Merge pull request #11 from TerraformInDepth/more_docs
Browse files Browse the repository at this point in the history
More documentation updates
  • Loading branch information
tedivm authored Sep 22, 2024
2 parents e0422fe + 407752a commit bee9c9e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
push:
paths-ignore:
- "README.md"
branches:
- main

# Testing only needs permissions to read the repository contents.
permissions:
Expand Down
18 changes: 11 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: |-
---

# mastodon Provider
# Mastodon Provider



Expand All @@ -16,16 +16,20 @@ description: |-
provider "mastodon" {
host = "https://mastodon.social"
}
resource "mastodon_post" "example" {
content = "I'm posting to the Fediverse from Terraform!"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `access_token` (String, Sensitive) Password to use for connecting to the server.
- `client_id` (String) Client ID for Mastodon App.
- `client_secret` (String, Sensitive) Client Secret for Mastodon App.
- `email` (String) Username to connect to the server as.
- `host` (String) Mastodon host to connect to.
- `password` (String, Sensitive) Password to use for connecting to the server.
- `access_token` (String, Sensitive) Password to use for connecting to the server. Can be designated by the `MASTODON_ACCESS_TOKEN` environment variable.
- `client_id` (String) Client ID for Mastodon App. Can be designated by the `MASTODON_CLIENT_ID` environment variable.
- `client_secret` (String, Sensitive) Client Secret for Mastodon App. Can be designated by the `MASTODON_CLIENT_SECRET` environment variable.
- `email` (String) Username to connect to the server as. Can be designated by the `MASTODON_USER_EMAIL` environment variable.
- `host` (String) Mastodon host to connect to. Can be designated by the `MASTODON_HOST` environment variable.
- `password` (String, Sensitive) Password to use for connecting to the server. Can be designated by the `MASTODON_USER_PASSWORD` environment variable.
2 changes: 1 addition & 1 deletion docs/resources/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This resource is used to manage posts on a Mastodon instance.

```terraform
resource "mastodon_post" "example" {
content = "I'm posting!"
content = "What a great day to post to the Fediverse from Terraform!"
}
```

Expand Down
4 changes: 4 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
provider "mastodon" {
host = "https://mastodon.social"
}

resource "mastodon_post" "example" {
content = "I'm posting to the Fediverse from Terraform!"
}
2 changes: 1 addition & 1 deletion examples/resources/mastodon_post/resource.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resource "mastodon_post" "example" {
content = "I'm posting!"
content = "What a great day to post to the Fediverse from Terraform!"
}
12 changes: 6 additions & 6 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,29 @@ func (p *MastodonProvider) Schema(ctx context.Context, req provider.SchemaReques
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"host": schema.StringAttribute{
MarkdownDescription: "Mastodon host to connect to.",
MarkdownDescription: "Mastodon host to connect to. Can be designated by the `MASTODON_HOST` environment variable.",
Optional: true,
},
"client_id": schema.StringAttribute{
MarkdownDescription: "Client ID for Mastodon App.",
MarkdownDescription: "Client ID for Mastodon App. Can be designated by the `MASTODON_CLIENT_ID` environment variable.",
Optional: true,
},
"client_secret": schema.StringAttribute{
MarkdownDescription: "Client Secret for Mastodon App.",
MarkdownDescription: "Client Secret for Mastodon App. Can be designated by the `MASTODON_CLIENT_SECRET` environment variable.",
Optional: true,
Sensitive: true,
},
"email": schema.StringAttribute{
MarkdownDescription: "Username to connect to the server as.",
MarkdownDescription: "Username to connect to the server as. Can be designated by the `MASTODON_USER_EMAIL` environment variable.",
Optional: true,
},
"password": schema.StringAttribute{
MarkdownDescription: "Password to use for connecting to the server.",
MarkdownDescription: "Password to use for connecting to the server. Can be designated by the `MASTODON_USER_PASSWORD` environment variable.",
Optional: true,
Sensitive: true,
},
"access_token": schema.StringAttribute{
MarkdownDescription: "Password to use for connecting to the server.",
MarkdownDescription: "Password to use for connecting to the server. Can be designated by the `MASTODON_ACCESS_TOKEN` environment variable.",
Optional: true,
Sensitive: true,
},
Expand Down
19 changes: 19 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "{{.ProviderShortName}} Provider"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# Mastodon Provider

{{ .Description | trimspace }}

{{ if .HasExample -}}
## Example Usage

{{tffile .ExampleFile }}
{{- end }}

{{ .SchemaMarkdown | trimspace }}

0 comments on commit bee9c9e

Please sign in to comment.