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

chore(RESOURCES): fix markdown for table formatting #26789

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

qleroy
Copy link
Contributor

@qleroy qleroy commented Jan 24, 2024

Just fixing markdown to restore the preview !

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@john-bodley
Copy link
Member

Thanks @qleroy. I believe the table is auto-formatted via IDEs, which typically makes markdown tables more readable. What do you mean by preview?

@qleroy
Copy link
Contributor Author

qleroy commented Jan 25, 2024

I just removed the last bit |---| on line 2
which was added by mistake some time ago.
It breaks the formatting and you cannot preview it as a table, for example on GitHub.

@john-bodley
Copy link
Member

@qleroy would you mind running tox -e pre-commit locally? I believe that prettier will reformat the table so that the columns are aligned.

cc @michael-s-molina

@qleroy
Copy link
Contributor Author

qleroy commented Jan 25, 2024

Will try.
Sorry for the confusion but the problem is not so the formatting but the additional column |---| only on line 2 that breaks the whole table

@qleroy
Copy link
Contributor Author

qleroy commented Jan 25, 2024

Cc @sfirke

Copy link
Member

@sfirke sfirke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I like how the "before" is all messed up and many screens long and then the "after" is a table again 😁

@sfirke
Copy link
Member

sfirke commented Jan 25, 2024

@john-bodley here is how this .md page is rendering currently:
image

thanks @qleroy for the fix!

@sfirke sfirke merged commit 11f0dd9 into apache:master Jan 25, 2024
21 checks passed
@sfirke
Copy link
Member

sfirke commented Jan 25, 2024

Just confirmed that it's rendering correctly again:

image

@michael-s-molina
Copy link
Member

michael-s-molina commented Jan 25, 2024

@sfirke We should commit using the same output generated by pre-commit. If it's generating this weird preview, we need to fix the formatter. The problem of committing a manually generated format is that every time this file is touched and formatted by pre-commit, we'll get a diff.

@john-bodley
Copy link
Member

@sfirke my comment was related to how the table presented pre-rendering. There's auto-formatters which add whitespace to ensure that the columns align which help when reading the table in an IDE.

I realize that the fix addressed an issue with the markdown structure, but it augmented the formatting and thus whitespace is no longer preserved.

@sfirke
Copy link
Member

sfirke commented Jan 25, 2024

Oops, sorry this wasn't the proper structural fix. I don't completely follow the correct way to address this but would like to learn, maybe by looking at a PR that does it?

I am unfamiliar with maintaining a table like this, I had just noticed it was broken and put out a call in Slack asking for a fix from the community.

@qleroy
Copy link
Contributor Author

qleroy commented Jan 25, 2024

I just checked that the pre-commit hooks pass and pre-commit outputs the same file.
I my fix-md-formatting branch, the first commit that removes |---| is necessary, the second way removing whitespace is not necessary and pre-commit ignores the difference as well
Screenshot 2024-01-25 at 21 38 10

tox -e pre-commit
pre-commit: commands[0]> pre-commit run --all-files
auto-walrus..............................................................Passed
pyupgrade................................................................Passed
pycln....................................................................Passed
isort....................................................................Passed
mypy.....................................................................Passed
pip-compile-multi verify.................................................Passed
check docstring is first.................................................Passed
check for added large files..............................................Passed
check yaml...............................................................Passed
debug statements (python)................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
black....................................................................Passed
prettier.................................................................Passed
Blacklist................................................................Passed

eschutho pushed a commit to preset-io/superset that referenced this pull request Jan 31, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants