diff --git a/plugins/.snapshots/TestGenerateSourcePluginDocs-README.md b/plugins/.snapshots/TestGenerateSourcePluginDocs-README.md index ac529d63b3..a3d5f68165 100644 --- a/plugins/.snapshots/TestGenerateSourcePluginDocs-README.md +++ b/plugins/.snapshots/TestGenerateSourcePluginDocs-README.md @@ -1,5 +1,5 @@ # Source Plugin: test ## Tables -| Name | Description | -| ------------- | ------------- | -|test_table|Description for test table| +| Name | Relations | Description | +| ------------- | --------- | ------------- | +| [test_table](test_table.md)| [relation_table](relation_table.md)
[relation_table2](relation_table2.md)| Description for test table| diff --git a/plugins/.snapshots/TestGenerateSourcePluginDocs-test_table.md b/plugins/.snapshots/TestGenerateSourcePluginDocs-test_table.md index 7bfd607057..1cdd65135c 100644 --- a/plugins/.snapshots/TestGenerateSourcePluginDocs-test_table.md +++ b/plugins/.snapshots/TestGenerateSourcePluginDocs-test_table.md @@ -7,6 +7,7 @@ The composite primary key for this table is (**id_col**, **id_col2**). ## Relations The following tables depend on `test_table`: - [`relation_table`](relation_table.md) + - [`relation_table2`](relation_table2.md) ## Columns | Name | Type | diff --git a/plugins/source_docs_test.go b/plugins/source_docs_test.go index df1e5573d8..79fa65ed8b 100644 --- a/plugins/source_docs_test.go +++ b/plugins/source_docs_test.go @@ -41,6 +41,16 @@ var testTables = []*schema.Table{ }, }, }, + { + Name: "relation_table2", + Description: "Description for second relational table", + Columns: []schema.Column{ + { + Name: "string_col", + Type: schema.TypeString, + }, + }, + }, }, }, } diff --git a/plugins/templates/all_tables.go.tpl b/plugins/templates/all_tables.go.tpl index cda0512772..de52fdfea0 100644 --- a/plugins/templates/all_tables.go.tpl +++ b/plugins/templates/all_tables.go.tpl @@ -1,7 +1,7 @@ # Source Plugin: {{.Name}} ## Tables -| Name | Description | -| ------------- | ------------- | +| Name | Relations | Description | +| ------------- | --------- | ------------- | {{- range $table := $.Tables }} -|{{$table.Name}}|{{$table.Description }}| +| [{{$table.Name}}]({{$table.Name}}.md)| {{range $index, $rel := $table.Relations}}{{if $index}}
{{end}}[{{$rel.Name}}]({{$rel.Name}}.md){{end}}| {{$table.Description }}| {{- end }} \ No newline at end of file