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

Skip to content

Make module source urls clickable in Markdown output #571

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tomasaschan
Copy link

The main reason this was not already implemented, as outlined in #504 and linked discussions, was that modules sourced from git repositories, with urls like [email protected]:..., was rendered by Markdown as URL to an email address, if the url was just shown as [.source](.source).

The approach here is to detect if the module source starts with "git@", and, if so, replace that prefix with "https://", as well as replacing the first ":" with a "/".

Fixes #504.

I have:

  • Read and followed terraform-docs' [contribution process].
  • All tests pass when I run make test.

How has this code been tested

The change includes updates to test data, that show case the new behavior and ensure it stays correct.

The main reason this was not already implemented, as outlined in terraform-docs#504 and
linked discussions, was that modules sourced from git repositories, with
urls like `[email protected]:...`, was rendered by Markdown as URL to an
email address, if the url was just shown as `[.source](.source)`.

The approach here is to detect if the module source starts with "git@",
and, if so, replace that prefix with "https://", as well as replacing the
first ":" with a "/".

Signed-off-by: Tomas Aschan <[email protected]>
@tomasaschan tomasaschan force-pushed the clickable-module-source branch from 1c0ad4f to ced2aed Compare October 1, 2021 10:59
@tomasaschan tomasaschan force-pushed the clickable-module-source branch from c54f2a3 to 3dbb1a9 Compare October 1, 2021 16:25
Signed-off-by: Tomas Aschan <[email protected]>
@tomasaschan tomasaschan force-pushed the clickable-module-source branch from 52bb210 to cc9569e Compare October 1, 2021 20:16
AmirStha pushed a commit to AmirStha/terraform-docs that referenced this pull request Jan 21, 2022
@khos2ow khos2ow removed this from v0.19 Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make source in module table clickable links
1 participant