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

0.8.0-alpha - poor formatting #138

Closed
1 task
grimm26 opened this issue Dec 23, 2019 · 8 comments · Fixed by #164
Closed
1 task

0.8.0-alpha - poor formatting #138

grimm26 opened this issue Dec 23, 2019 · 8 comments · Fixed by #164

Comments

@grimm26
Copy link

grimm26 commented Dec 23, 2019

Prerequisites

Put an x into the box that applies:

  • [ x] This issue describes a bug.
  • This issue describes a feature request.

For more information, see the Contributing Guidelines.

Description

I tried out 0.8.0-alpha and the formatting was less than ideal. The content in the Type and Default columns are wrapped with code and pre so the rows are very long when there are complex types and defaults. I removed the pre tags to avoid this. I also had a default that was a one element list of "*" which should be escaped.

The variables file, the original generated md table, and my modified md table are in this gist https://gist.github.com/grimm26/a0ced6cdfb0f8d6ec5377abe2ca5ba3f

Version

terraform-docs version v0.8.0-alpha darwin/amd64 BuildDate: 2019-12-23T10:16:00-06:00

@khos2ow
Copy link
Member

khos2ow commented Dec 23, 2019

Thank you @grimm26 for the feedback, and specially for providing the full config example to work with. I'll take a look later today.

@khos2ow
Copy link
Member

khos2ow commented Jan 5, 2020

Sorry for the delayed response. I found something interesting. It seems the issue is not with the way terraform-docs generates the result, rather than the different markdown engines processes them, which unfortunately makes it even harder to solve.

I've used your example config to generate the table output, and

  1. VS Code markdown preview mode: shows 100% correct
  2. GitLab Markdown engine: shows almost correct
  3. GitHub Markdown engine: messes up the content
  4. Shoved generated md file into a Hugo site: shows nearly 100% correct

I tried something else to generate fully html based table rather than mixing html tags inside markdown table, which unfortunately didn't make any difference.

So at the moment I'm a bit out of options and trying to understand the difference between these markdown renderer engines. But I wanted to ask you, in the meantime, to give it a try with markdown document command (as a test), I know this is inconvenient but it can help narrowing down the issue to only table format and not markdown in general.

@grimm26
Copy link
Author

grimm26 commented Jan 6, 2020

@khos2ow I added the output using the document option to my gist. The result is definitely cleaner, but I'd much rather have a table format.

@khos2ow khos2ow added this to the v0.8.0 milestone Jan 6, 2020
@khos2ow
Copy link
Member

khos2ow commented Jan 7, 2020

@grimm26 yeah I completely understand, I was only trying to see if the issue is within the markdown as a whole or it's limited to markdown table. I'll try to come up with a fix.

@khos2ow
Copy link
Member

khos2ow commented Jan 16, 2020

@grimm26 Can you take a look at this? This seems to be rendered properly.

https://gist.github.com/khos2ow/2dea709aac2b5b3d02198130dc3160e2 and its raw file.

I took the same approach as you did, but instead of removing <pre> I removed the <code> which seems to be the answer. This seems to be fine in at least both GitHub and GitLab.

@grimm26
Copy link
Author

grimm26 commented Jan 16, 2020

@khos2ow Yes, that is MUCH better!

@khos2ow
Copy link
Member

khos2ow commented Jan 16, 2020

Great, I'm going to open a PR and cut another RC today, please test it out and give us the feedback.

@khos2ow
Copy link
Member

khos2ow commented Jan 16, 2020

Feel free to reopen this ticket if you still face the issue after using the v0.8.0-rc.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants