diff --git a/docs/reference/markdown-document.md b/docs/reference/markdown-document.md
index b614611e..b09c92c0 100644
--- a/docs/reference/markdown-document.md
+++ b/docs/reference/markdown-document.md
@@ -133,25 +133,25 @@ generates the following output:
### [bar](#module\_bar)
- Source: baz
+ Source: [baz](baz)
Version: 4.5.6
### [baz](#module\_baz)
- Source: baz
+ Source: [baz](baz)
Version: 4.5.6
### [foo](#module\_foo)
- Source: bar
+ Source: [bar](bar)
Version: 1.2.3
### [foobar](#module\_foobar)
- Source: git@github.com:module/path
+ Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/docs/reference/markdown-table.md b/docs/reference/markdown-table.md
index f3775a85..6eff4a0b 100644
--- a/docs/reference/markdown-table.md
+++ b/docs/reference/markdown-table.md
@@ -124,10 +124,10 @@ generates the following output:
| Name | Source | Version |
|------|--------|---------|
- | [bar](#module\_bar) | baz | 4.5.6 |
- | [baz](#module\_baz) | baz | 4.5.6 |
- | [foo](#module\_foo) | bar | 1.2.3 |
- | [foobar](#module\_foobar) | git@github.com:module/path | v7.8.9 |
+ | [bar](#module\_bar) | [baz](baz) | 4.5.6 |
+ | [baz](#module\_baz) | [baz](baz) | 4.5.6 |
+ | [foo](#module\_foo) | [bar](bar) | 1.2.3 |
+ | [foobar](#module\_foobar) | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/templates/markdown_document_modules.tmpl b/format/templates/markdown_document_modules.tmpl
index fc0a5a93..65254796 100644
--- a/format/templates/markdown_document_modules.tmpl
+++ b/format/templates/markdown_document_modules.tmpl
@@ -13,7 +13,7 @@
{{ indent 1 "#" }} {{ anchorNameMarkdown "module" .Name }}
- Source: {{ .Source }}
+ Source: [{{ .Source }}]({{ moduleURL .Source }})
Version: {{ .Version }}
diff --git a/format/templates/markdown_table_modules.tmpl b/format/templates/markdown_table_modules.tmpl
index 891778c2..8f19ad4e 100644
--- a/format/templates/markdown_table_modules.tmpl
+++ b/format/templates/markdown_table_modules.tmpl
@@ -11,7 +11,7 @@
| Name | Source | Version |
|------|--------|---------|
{{- range .Module.ModuleCalls }}
- | {{ anchorNameMarkdown "module" .Name }} | {{ .Source }} | {{ .Version | default "n/a" }} |
+ | {{ anchorNameMarkdown "module" .Name }} | [{{ .Source }}]({{ moduleURL .Source }}) | {{ .Version | default "n/a" }} |
{{- end }}
{{ end }}
{{ end -}}
\ No newline at end of file
diff --git a/format/testdata/markdown/document-Base.golden b/format/testdata/markdown/document-Base.golden
index 0d5801c2..3e4371eb 100644
--- a/format/testdata/markdown/document-Base.golden
+++ b/format/testdata/markdown/document-Base.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-EscapeCharacters.golden b/format/testdata/markdown/document-EscapeCharacters.golden
index 1203ff24..9c0a6270 100644
--- a/format/testdata/markdown/document-EscapeCharacters.golden
+++ b/format/testdata/markdown/document-EscapeCharacters.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-IndentationOfFour.golden b/format/testdata/markdown/document-IndentationOfFour.golden
index f09c3401..096f891f 100644
--- a/format/testdata/markdown/document-IndentationOfFour.golden
+++ b/format/testdata/markdown/document-IndentationOfFour.golden
@@ -68,25 +68,25 @@ The following Modules are called:
##### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
##### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
##### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
##### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-OnlyModulecalls.golden b/format/testdata/markdown/document-OnlyModulecalls.golden
index 3903e55a..8969373c 100644
--- a/format/testdata/markdown/document-OnlyModulecalls.golden
+++ b/format/testdata/markdown/document-OnlyModulecalls.golden
@@ -4,24 +4,24 @@ The following Modules are called:
### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
\ No newline at end of file
diff --git a/format/testdata/markdown/document-WithAnchor.golden b/format/testdata/markdown/document-WithAnchor.golden
index da9ac435..16f93199 100644
--- a/format/testdata/markdown/document-WithAnchor.golden
+++ b/format/testdata/markdown/document-WithAnchor.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### [bar](#module_bar)
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### [foo](#module_foo)
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### [baz](#module_baz)
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### [foobar](#module_foobar)
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-WithRequired.golden b/format/testdata/markdown/document-WithRequired.golden
index 555b376e..c41b3811 100644
--- a/format/testdata/markdown/document-WithRequired.golden
+++ b/format/testdata/markdown/document-WithRequired.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-WithoutHTML.golden b/format/testdata/markdown/document-WithoutHTML.golden
index 0d5801c2..3e4371eb 100644
--- a/format/testdata/markdown/document-WithoutHTML.golden
+++ b/format/testdata/markdown/document-WithoutHTML.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### bar
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foo
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### baz
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### foobar
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/document-WithoutHTMLWithAnchor.golden b/format/testdata/markdown/document-WithoutHTMLWithAnchor.golden
index da9ac435..16f93199 100644
--- a/format/testdata/markdown/document-WithoutHTMLWithAnchor.golden
+++ b/format/testdata/markdown/document-WithoutHTMLWithAnchor.golden
@@ -68,25 +68,25 @@ The following Modules are called:
### [bar](#module_bar)
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### [foo](#module_foo)
-Source: bar
+Source: [bar](bar)
Version: 1.2.3
### [baz](#module_baz)
-Source: baz
+Source: [baz](baz)
Version: 4.5.6
### [foobar](#module_foobar)
-Source: git@github.com:module/path
+Source: [git@github.com:module/path](https://github.com/module/path)
Version: v7.8.9
diff --git a/format/testdata/markdown/table-Base.golden b/format/testdata/markdown/table-Base.golden
index 21ef339e..483dc009 100644
--- a/format/testdata/markdown/table-Base.golden
+++ b/format/testdata/markdown/table-Base.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/testdata/markdown/table-EscapeCharacters.golden b/format/testdata/markdown/table-EscapeCharacters.golden
index bb82f742..e47fb53c 100644
--- a/format/testdata/markdown/table-EscapeCharacters.golden
+++ b/format/testdata/markdown/table-EscapeCharacters.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/testdata/markdown/table-IndentationOfFour.golden b/format/testdata/markdown/table-IndentationOfFour.golden
index 19c86fd8..169b2e67 100644
--- a/format/testdata/markdown/table-IndentationOfFour.golden
+++ b/format/testdata/markdown/table-IndentationOfFour.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
#### Resources
diff --git a/format/testdata/markdown/table-OnlyModulecalls.golden b/format/testdata/markdown/table-OnlyModulecalls.golden
index 233c728e..66303249 100644
--- a/format/testdata/markdown/table-OnlyModulecalls.golden
+++ b/format/testdata/markdown/table-OnlyModulecalls.golden
@@ -2,7 +2,7 @@
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
\ No newline at end of file
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
\ No newline at end of file
diff --git a/format/testdata/markdown/table-WithAnchor.golden b/format/testdata/markdown/table-WithAnchor.golden
index a1aaaccc..1d25acfd 100644
--- a/format/testdata/markdown/table-WithAnchor.golden
+++ b/format/testdata/markdown/table-WithAnchor.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| [bar](#module_bar) | baz | 4.5.6 |
-| [foo](#module_foo) | bar | 1.2.3 |
-| [baz](#module_baz) | baz | 4.5.6 |
-| [foobar](#module_foobar) | git@github.com:module/path | v7.8.9 |
+| [bar](#module_bar) | [baz](baz) | 4.5.6 |
+| [foo](#module_foo) | [bar](bar) | 1.2.3 |
+| [baz](#module_baz) | [baz](baz) | 4.5.6 |
+| [foobar](#module_foobar) | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/testdata/markdown/table-WithRequired.golden b/format/testdata/markdown/table-WithRequired.golden
index 08ed2ee3..c4f70c41 100644
--- a/format/testdata/markdown/table-WithRequired.golden
+++ b/format/testdata/markdown/table-WithRequired.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/testdata/markdown/table-WithoutHTML.golden b/format/testdata/markdown/table-WithoutHTML.golden
index 6840055f..0fd97d14 100644
--- a/format/testdata/markdown/table-WithoutHTML.golden
+++ b/format/testdata/markdown/table-WithoutHTML.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| bar | baz | 4.5.6 |
-| foo | bar | 1.2.3 |
-| baz | baz | 4.5.6 |
-| foobar | git@github.com:module/path | v7.8.9 |
+| bar | [baz](baz) | 4.5.6 |
+| foo | [bar](bar) | 1.2.3 |
+| baz | [baz](baz) | 4.5.6 |
+| foobar | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/format/testdata/markdown/table-WithoutHTMLWithAnchor.golden b/format/testdata/markdown/table-WithoutHTMLWithAnchor.golden
index dfaadf1d..ff90f5e9 100644
--- a/format/testdata/markdown/table-WithoutHTMLWithAnchor.golden
+++ b/format/testdata/markdown/table-WithoutHTMLWithAnchor.golden
@@ -59,10 +59,10 @@ followed by another line of text.
| Name | Source | Version |
|------|--------|---------|
-| [bar](#module_bar) | baz | 4.5.6 |
-| [foo](#module_foo) | bar | 1.2.3 |
-| [baz](#module_baz) | baz | 4.5.6 |
-| [foobar](#module_foobar) | git@github.com:module/path | v7.8.9 |
+| [bar](#module_bar) | [baz](baz) | 4.5.6 |
+| [foo](#module_foo) | [bar](bar) | 1.2.3 |
+| [baz](#module_baz) | [baz](baz) | 4.5.6 |
+| [foobar](#module_foobar) | [git@github.com:module/path](https://github.com/module/path) | v7.8.9 |
## Resources
diff --git a/template/template.go b/template/template.go
index ee6d71c8..ff3d248c 100644
--- a/template/template.go
+++ b/template/template.go
@@ -209,6 +209,17 @@ func builtinFuncs(config *print.Config) gotemplate.FuncMap { // nolint:gocyclo
"anchorNameAsciidoc": func(prefix string, value string) string {
return CreateAnchorAsciidoc(prefix, value, config.Settings.Anchor, config.Settings.Escape)
},
+
+ // resolving module urls
+ "moduleURL": func(s string) string {
+ if !strings.HasPrefix(s, "git@") {
+ return s
+ }
+
+ patched := strings.TrimPrefix(s, "git@")
+ patched = strings.Replace(patched, ":", "/", 1)
+ return "https://" + patched
+ },
}
}