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

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]>
Signed-off-by: Tomas Aschan <[email protected]>
AmirStha pushed a commit to AmirStha/terraform-docs that referenced this pull request Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Make source in module table clickable links
1 participant