feat(docs): add custom badge generator#2152
Merged
ghostdevv merged 22 commits intonpmx-dev:mainfrom Mar 21, 2026
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧭 Context
In the last npmx meetup, we were discussing the idea of adding a generator inside the docs for custom badges to simplify the process of getting the Markdown content.
So I played around with the idea a little bit and landed on this implementation, which I find pretty useful.
📚 Description
I moved the custom badges docs to their dedicated page because they are like 50% of the features page and I think since there are many subheadings, it makes sense to be able to see them in the ToC (therefore the dedicated page).
And then I created a little
BadgeGenerator.vuewhich let's the user input the package name and the type of info they wanna have in the badge with a little preview.Feel free to suggest reverts or further ideas for this improvement.
I also played around a bit with updating the package in the ## Examples section dynamically to what the user currently has typed in the input, but I couldn't figure out a clean way to create the code block like this with a component, which sucks a little bit. Therefore, I dropped this, but if you know how we could do that, feel free to guide me to a possible solution.
Here is a deployment preview of the right page: https://docsnpmxdev-git-fork-trueberryless-feature-docs-cus-74ef86-npmx.vercel.app/guide/badges