Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/reference/asciidoc-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ generates the following output:

Version: 1.2.3

=== [[module_foobar]] <<module_foobar,foobar>>

Source: [email protected]:module/path

Version: v7.8.9

== Resources

The following resources are used by this module:
Expand Down
1 change: 1 addition & 0 deletions docs/reference/asciidoc-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ generates the following output:
|[[module_bar]] <<module_bar,bar>>|baz|4.5.6
|[[module_baz]] <<module_baz,baz>>|baz|4.5.6
|[[module_foo]] <<module_foo,foo>>|bar|1.2.3
|[[module_foobar]] <<module_foobar,foobar>>|[email protected]:module/path|v7.8.9
|===

== Resources
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ generates the following output:
"name": "foo",
"source": "bar",
"version": "1.2.3"
},
{
"name": "foobar",
"source": "[email protected]:module/path",
"version": "v7.8.9"
}
],
"outputs": [
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/markdown-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ generates the following output:

Version: 1.2.3

### <a name="module_foobar"></a> [foobar](#module\_foobar)

Source: [email protected]:module/path

Version: v7.8.9

## Resources

The following resources are used by this module:
Expand Down
1 change: 1 addition & 0 deletions docs/reference/markdown-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ generates the following output:
| <a name="module_bar"></a> [bar](#module\_bar) | baz | 4.5.6 |
| <a name="module_baz"></a> [baz](#module\_baz) | baz | 4.5.6 |
| <a name="module_foo"></a> [foo](#module\_foo) | bar | 1.2.3 |
| <a name="module_foobar"></a> [foobar](#module\_foobar) | [email protected]:module/path | v7.8.9 |

## Resources

Expand Down
1 change: 1 addition & 0 deletions docs/reference/pretty.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ generates the following output:
module.bar (baz,4.5.6)
module.baz (baz,4.5.6)
module.foo (bar,1.2.3)
module.foobar ([email protected]:module/path,v7.8.9)


resource.null_resource.foo (resource) (https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource)
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ generates the following output:
source = "bar"
version = "1.2.3"

[[modules]]
name = "foobar"
source = "[email protected]:module/path"
version = "v7.8.9"

[[outputs]]
name = "output-0.12"
description = "terraform 0.12 only"
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ generates the following output:
<source>bar</source>
<version>1.2.3</version>
</module>
<module>
<name>foobar</name>
<source>[email protected]:module/path</source>
<version>v7.8.9</version>
</module>
</modules>
<outputs>
<output>
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ generates the following output:
- name: foo
source: bar
version: 1.2.3
- name: foobar
source: [email protected]:module/path
version: v7.8.9
outputs:
- name: output-0.12
description: terraform 0.12 only
Expand Down
4 changes: 4 additions & 0 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ module "baz" {
source = "baz"
version = "4.5.6"
}

module "foobar" {
source = "[email protected]:module/path?ref=v7.8.9"
}
2 changes: 1 addition & 1 deletion internal/format/templates/markdown_table.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
{{- template "resources" . -}}
{{- template "inputs" . -}}
{{- template "outputs" . -}}
{{- template "footer" . -}}
{{- template "footer" . -}}
2 changes: 1 addition & 1 deletion internal/format/templates/markdown_table_modules.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| Name | Source | Version |
|------|--------|---------|
{{- range .Module.ModuleCalls }}
| {{ anchorName "module" .Name }} | {{ .Source }} | {{ .Version }} |
| {{ anchorName "module" .Name }} | {{ .Source }} | {{ .Version | default "n/a" }} |
{{- end }}
{{ end }}
{{ end -}}
6 changes: 6 additions & 0 deletions internal/format/testdata/asciidoc/document-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

=== foobar

Source: [email protected]:module/path

Version: v7.8.9

== Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

===== foobar

Source: [email protected]:module/path

Version: v7.8.9

==== Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ Version: 1.2.3

Source: baz

Version: 4.5.6
Version: 4.5.6

=== foobar

Source: [email protected]:module/path

Version: v7.8.9
6 changes: 6 additions & 0 deletions internal/format/testdata/asciidoc/document-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

=== [[module_foobar]] <<module_foobar,foobar>>

Source: [email protected]:module/path

Version: v7.8.9

== Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

=== foobar

Source: [email protected]:module/path

Version: v7.8.9

== Resources

The following resources are used by this module:
Expand Down
1 change: 1 addition & 0 deletions internal/format/testdata/asciidoc/table-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ followed by another line of text.
|bar|baz|4.5.6
|foo|bar|1.2.3
|baz|baz|4.5.6
|foobar|[email protected]:module/path|v7.8.9
|===

== Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ followed by another line of text.
|bar|baz|4.5.6
|foo|bar|1.2.3
|baz|baz|4.5.6
|foobar|[email protected]:module/path|v7.8.9
|===

==== Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
|bar|baz|4.5.6
|foo|bar|1.2.3
|baz|baz|4.5.6
|foobar|[email protected]:module/path|v7.8.9
|===
1 change: 1 addition & 0 deletions internal/format/testdata/asciidoc/table-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ followed by another line of text.
|[[module_bar]] <<module_bar,bar>>|baz|4.5.6
|[[module_foo]] <<module_foo,foo>>|bar|1.2.3
|[[module_baz]] <<module_baz,baz>>|baz|4.5.6
|[[module_foobar]] <<module_foobar,foobar>>|[email protected]:module/path|v7.8.9
|===

== Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ followed by another line of text.
|bar|baz|4.5.6
|foo|bar|1.2.3
|baz|baz|4.5.6
|foobar|[email protected]:module/path|v7.8.9
|===

== Resources
Expand Down
3 changes: 2 additions & 1 deletion internal/format/testdata/common/sort-NoSort.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"modules": [
"bar-baz",
"foo-bar",
"baz-baz"
"baz-baz",
"[email protected]:module/path"
],
"outputs": [
"unquoted",
Expand Down
3 changes: 2 additions & 1 deletion internal/format/testdata/common/sort-SortByName.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"modules": [
"bar-baz",
"baz-baz",
"foo-bar"
"foo-bar",
"[email protected]:module/path"
],
"outputs": [
"output-0.12",
Expand Down
3 changes: 2 additions & 1 deletion internal/format/testdata/common/sort-SortByRequired.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"modules": [
"bar-baz",
"baz-baz",
"foo-bar"
"foo-bar",
"[email protected]:module/path"
],
"outputs": [
"output-0.12",
Expand Down
3 changes: 2 additions & 1 deletion internal/format/testdata/common/sort-SortByType.golden
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"modules": [
"foo-bar",
"bar-baz",
"baz-baz"
"baz-baz",
"[email protected]:module/path"
],
"outputs": [
"output-0.12",
Expand Down
5 changes: 5 additions & 0 deletions internal/format/testdata/json/json-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
"name": "baz",
"source": "baz",
"version": "4.5.6"
},
{
"name": "foobar",
"source": "[email protected]:module/path",
"version": "v7.8.9"
}
],
"outputs": [
Expand Down
5 changes: 5 additions & 0 deletions internal/format/testdata/json/json-EscapeCharacters.golden
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@
"name": "baz",
"source": "baz",
"version": "4.5.6"
},
{
"name": "foobar",
"source": "[email protected]:module/path",
"version": "v7.8.9"
}
],
"outputs": [
Expand Down
5 changes: 5 additions & 0 deletions internal/format/testdata/json/json-OnlyModulecalls.golden
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"name": "baz",
"source": "baz",
"version": "4.5.6"
},
{
"name": "foobar",
"source": "[email protected]:module/path",
"version": "v7.8.9"
}
],
"outputs": [],
Expand Down
6 changes: 6 additions & 0 deletions internal/format/testdata/markdown/document-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

### foobar

Source: [email protected]:module/path

Version: v7.8.9

## Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

### foobar

Source: [email protected]:module/path

Version: v7.8.9

## Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

##### foobar

Source: [email protected]:module/path

Version: v7.8.9

#### Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ Version: 1.2.3

Source: baz

Version: 4.5.6
Version: 4.5.6

### foobar

Source: [email protected]:module/path

Version: v7.8.9
6 changes: 6 additions & 0 deletions internal/format/testdata/markdown/document-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

### <a name="module_foobar"></a> [foobar](#module_foobar)

Source: [email protected]:module/path

Version: v7.8.9

## Resources

The following resources are used by this module:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ Source: baz

Version: 4.5.6

### foobar

Source: [email protected]:module/path

Version: v7.8.9

## Resources

The following resources are used by this module:
Expand Down
1 change: 1 addition & 0 deletions internal/format/testdata/markdown/table-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ followed by another line of text.
| bar | baz | 4.5.6 |
| foo | bar | 1.2.3 |
| baz | baz | 4.5.6 |
| foobar | [email protected]:module/path | v7.8.9 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the main problem mentioned at #427 (comment), is that this will become a "clickable email" address. The following for makrdown and asciidoc is preferred:

Suggested change
| foobar | [email protected]:module/path | v7.8.9 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! yes, it's a bit hard to implement, but I'll try! tks!


## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ followed by another line of text.
| bar | baz | 4.5.6 |
| foo | bar | 1.2.3 |
| baz | baz | 4.5.6 |
| foobar | [email protected]:module/path | v7.8.9 |

## Resources

Expand Down
Loading