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

feat: add options to uniorgStringify to customize handlers #107

Merged
merged 5 commits into from
May 18, 2024

Conversation

Delapouite
Copy link
Contributor

Hi @rasendubi

This PR is a follow-up to the discussions we had last year in #72 about letting the user having more controls about the final output.

I followed your advice and imitated what's already existing with uniorg2rehype. Therefore, uniorgStringify can now accept an optional handlers configuration.

I've added 3 tests to illustrate various situations and also a short documentation in the README.

Don't hesitate to tell me if something is missing. Thanks.

Copy link

changeset-bot bot commented May 18, 2024

🦋 Changeset detected

Latest commit: 53bc625

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
uniorg-stringify Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented May 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
org-blog-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 5:09pm

@rasendubi
Copy link
Owner

Hey @Delapouite. Thanks for the pull request!

I have pushed a couple of commits to your branch — mostly a refactor but there are two behavior changes:

  • Handlers now receive full options (not partial). This shouldn't matter for now but it may help in the future so that defaulting happens only once / in one place.
  • Fixed a case of handler returning an empty string ('') to suppress output. I've allowed handlers to return null to fallback to default handling.

If these sound good to you, we can merge and release.

@Delapouite
Copy link
Contributor Author

Great! Thanks again for taking the time to make these adjustments to my initial attempt.

@rasendubi rasendubi merged commit 1f8686c into rasendubi:master May 18, 2024
4 checks passed
@github-actions github-actions bot mentioned this pull request May 18, 2024
@Delapouite Delapouite deleted the feat/stringify-options branch May 19, 2024 08:56
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.

2 participants