Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make module source urls clickable in Markdown output #571

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/reference/markdown-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,25 @@ generates the following output:

### <a name="module_bar"></a> [bar](#module\_bar)

Source: baz
Source: [baz](baz)

Version: 4.5.6

### <a name="module_baz"></a> [baz](#module\_baz)

Source: baz
Source: [baz](baz)

Version: 4.5.6

### <a name="module_foo"></a> [foo](#module\_foo)

Source: bar
Source: [bar](bar)

Version: 1.2.3

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

Source: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/markdown-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ generates the following output:

| Name | Source | Version |
|------|--------|---------|
| <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 |
| <a name="module_bar"></a> [bar](#module\_bar) | [baz](baz) | 4.5.6 |
| <a name="module_baz"></a> [baz](#module\_baz) | [baz](baz) | 4.5.6 |
| <a name="module_foo"></a> [foo](#module\_foo) | [bar](bar) | 1.2.3 |
| <a name="module_foobar"></a> [foobar](#module\_foobar) | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

## Resources

Expand Down
2 changes: 1 addition & 1 deletion format/templates/markdown_document_modules.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{{ indent 1 "#" }} {{ anchorNameMarkdown "module" .Name }}

Source: {{ .Source }}
Source: [{{ .Source }}]({{ moduleURL .Source }})

Version: {{ .Version }}

Expand Down
2 changes: 1 addition & 1 deletion format/templates/markdown_table_modules.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-EscapeCharacters.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-IndentationOfFour.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-OnlyModulecalls.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,25 @@ The following Modules are called:

### <a name="module_bar"></a> [bar](#module_bar)

Source: baz
Source: [baz](baz)

Version: 4.5.6

### <a name="module_foo"></a> [foo](#module_foo)

Source: bar
Source: [bar](bar)

Version: 1.2.3

### <a name="module_baz"></a> [baz](#module_baz)

Source: baz
Source: [baz](baz)

Version: 4.5.6

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

Source: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-WithRequired.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/document-WithoutHTML.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,25 @@ The following Modules are called:

### <a name="module_bar"></a> [bar](#module_bar)

Source: baz
Source: [baz](baz)

Version: 4.5.6

### <a name="module_foo"></a> [foo](#module_foo)

Source: bar
Source: [bar](bar)

Version: 1.2.3

### <a name="module_baz"></a> [baz](#module_baz)

Source: baz
Source: [baz](baz)

Version: 4.5.6

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

Source: [email protected]:module/path
Source: [[email protected]:module/path](https://github.com/module/path)

Version: v7.8.9

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-Base.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]:module/path | v7.8.9 |
| bar | [baz](baz) | 4.5.6 |
| foo | [bar](bar) | 1.2.3 |
| baz | [baz](baz) | 4.5.6 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

## Resources

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-EscapeCharacters.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]:module/path | v7.8.9 |
| bar | [baz](baz) | 4.5.6 |
| foo | [bar](bar) | 1.2.3 |
| baz | [baz](baz) | 4.5.6 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

## Resources

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-IndentationOfFour.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]:module/path | v7.8.9 |
| bar | [baz](baz) | 4.5.6 |
| foo | [bar](bar) | 1.2.3 |
| baz | [baz](baz) | 4.5.6 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

#### Resources

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-OnlyModulecalls.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Name | Source | Version |
|------|--------|---------|
| bar | baz | 4.5.6 |
| foo | bar | 1.2.3 |
| baz | baz | 4.5.6 |
| foobar | [email protected]:module/path | v7.8.9 |
| bar | [baz](baz) | 4.5.6 |
| foo | [bar](bar) | 1.2.3 |
| baz | [baz](baz) | 4.5.6 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-WithAnchor.golden
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ followed by another line of text.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_bar"></a> [bar](#module_bar) | baz | 4.5.6 |
| <a name="module_foo"></a> [foo](#module_foo) | bar | 1.2.3 |
| <a name="module_baz"></a> [baz](#module_baz) | baz | 4.5.6 |
| <a name="module_foobar"></a> [foobar](#module_foobar) | [email protected]:module/path | v7.8.9 |
| <a name="module_bar"></a> [bar](#module_bar) | [baz](baz) | 4.5.6 |
| <a name="module_foo"></a> [foo](#module_foo) | [bar](bar) | 1.2.3 |
| <a name="module_baz"></a> [baz](#module_baz) | [baz](baz) | 4.5.6 |
| <a name="module_foobar"></a> [foobar](#module_foobar) | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

## Resources

Expand Down
8 changes: 4 additions & 4 deletions format/testdata/markdown/table-WithRequired.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]:module/path | v7.8.9 |
| bar | [baz](baz) | 4.5.6 |
| foo | [bar](bar) | 1.2.3 |
| baz | [baz](baz) | 4.5.6 |
| foobar | [[email protected]:module/path](https://github.com/module/path) | v7.8.9 |

## Resources

Expand Down