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

Add support for controlling the indentation of Markdown headers #120

Merged
merged 2 commits into from
Sep 23, 2019

Conversation

khos2ow
Copy link
Member

@khos2ow khos2ow commented Aug 18, 2019

Prerequisites

Put an x into the box(es) that apply:

  • This pull request fixes a bug.
  • This pull request adds a feature.
  • This pull request enhances existing functionality.
  • This pull request introduces breaking change.

For more information, see the Contributing Guide.

Description

This PR adds support for controlling indentation of Markdown headers by adding --indent flag to markdown document and markdown table commands. The available values are 1, 2, 3, 4, 5, 6, 7 and the default value is 2. Any value outside of this range will default to 2.

Issues Resolved

Fixes #89

Checklist

Put an x into all boxes that apply:

Tests

  • I have added tests to cover my changes.
  • All tests pass when I run make test.

Documentation

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Code Style

  • My code follows the code style of this project.

@khos2ow
Copy link
Member Author

khos2ow commented Aug 18, 2019

@metmajer I marked this as WIP because it depends on #119. Although to be fair it's not a hard dependency, it means we can proceed with either one and I'm gonna rebase the other, but in terms of git log history I prefer to proceed with 119 first.

@khos2ow khos2ow changed the title [WIP] Add support for controlling the indentation of Markdown headers Add support for controlling the indentation of Markdown headers Aug 22, 2019
@khos2ow
Copy link
Member Author

khos2ow commented Aug 23, 2019

According to Markdown guide, it seems the maximum depth of header is 6, and considering that we're going one level deeper when rendering markdown document, I think it'll be a good idea to change the maximum --indent level to 5.

This is an example of content being rendered on GitHub:

image

What do you think @metmajer ?

@metmajer
Copy link
Member

@khos2ow Hmm. What if we support the markdown standard on alignment levels from 0 to 6 and simply adjust the default value for markdown document as needed? This would decouple the implementation from the layout.

@khos2ow
Copy link
Member Author

khos2ow commented Aug 29, 2019

Hmm, I didn't quite get your point. But to be fair going five levels deep would be more than enough and I really don't think it ever happens for that matter. So instead of adjusting indentation value for one specific layout, we can just easily define a maximum depth of 5 which covers everything.

@metmajer
Copy link
Member

Never mind, @khos2ow. Do you as you wish. Do you want to deliver this one before #115?

@khos2ow
Copy link
Member Author

khos2ow commented Sep 11, 2019

It really doesn't matter. We can proceed with this one first since it's smaller in size.

@khos2ow khos2ow mentioned this pull request Sep 12, 2019
2 tasks
@metmajer
Copy link
Member

Great job @khos2ow and thanks for adding the final update!

@metmajer metmajer merged commit ffeb72c into terraform-docs:master Sep 23, 2019
@khos2ow khos2ow deleted the md-indent branch September 23, 2019 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for controlling the indentation level of headers when rendering Markdown
2 participants