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] Expose the whole Node object to to renderFn instances #166

Closed

Conversation

Edo-San
Copy link
Contributor

@Edo-San Edo-San commented Mar 7, 2024

The purpose of this PR is to provide an initial solution to the issue reported on #129
If we let users get the whole Node object inside schema resolver functions, they will be able to use that data (map pieces of content to specific props, use as conditional logic, etc.).

@Edo-San
Copy link
Contributor Author

Edo-San commented Mar 7, 2024

FYI @edvinasjurele This is a simple PoC that should at least provide the very basic functionality needed to handle any custom case. No frills 😅

WDYT?
If that's fine I can add some lines to the README file. Maybe should we get rid of the existing Codeblock so that we can showcase the native Astro Code component as the main use case for this update?

Thank you in advance! 🙏

@edvinasjurele
Copy link
Collaborator

Hi, @Edo-San, thanks, for looking into the code.

@edvinasjurele
Copy link
Collaborator

Hi, made solution on my MR #168. I hope that one will be a good candidate to merge. Wanted to try the descturcture ({ attrs }) possibility and not (node) + node.attrs, thus made TS a little differently.

@edvinasjurele
Copy link
Collaborator

Closing due to #168

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