-
Notifications
You must be signed in to change notification settings - Fork 15
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
refactor(utils): use build-md for markdown formatting #755
Conversation
Code PushUp🤨 Code PushUp report has both improvements and regressions – compared target commit 0dfbb15 with source commit d45213d. 🏷️ Categories🗃️ Groups👍 2 groups improved, 👎 1 group regressed
17 other groups are unchanged. 🛡️ Audits👍 4 audits improved, 👎 5 audits regressed, 14 audits changed without impacting score
486 other audits are unchanged. |
Really good!! It's funny that I thought about that area yesterday. |
packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts
Show resolved
Hide resolved
I built this library in my free time, and it has applications beyong Code PushUp (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markdown composition is much more readable now 👏
packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md
Outdated
Show resolved
Hide resolved
packages/utils/src/lib/reports/generate-md-report-category-section.unit.test.ts
Show resolved
Hide resolved
packages/utils/src/lib/reports/generate-md-report-categoy-section.ts
Outdated
Show resolved
Hide resolved
...es/utils/src/lib/reports/__snapshots__/generate-md-report-category-section.unit.test.ts.snap
Show resolved
Hide resolved
packages/utils/src/lib/reports/__snapshots__/report-diff-unchanged.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
I've published a library called
build-md
for dynamically rendering Markdown documents 🚀I refactored our Markdown rendering logic to use this library. The advantage is our logic now focuses on document semantics, and is no longer concerned with Markdown formatting rules (like where to add separator lines and what to indent). The library's Markdown output is better formatted (fewer Markdown lint violations) - HTML is only used when necessary (context-sensitive rendering), there are no extra or missing separator lines, and the table columns are automatically aligned (as if by Prettier).
The reason I want this to be a standalone library is because it's applicable to other projects as well like
@code-pushup/eslint-config
(migrated in code-pushup/eslint-config@8ac8793) orzod2md
(migration planned).