Possible to provide a few illustrative examples? #235
-
First, let me say this ecosystem looks awesome and it's going to solve my use case perfectly. So thank you for creating it. But... The documentation is brutal. I have only been able to find a few examples that show how the most popular plugins and utilities can work together. Most of them just show one example of a plugin or utility used in isolation, and often without enough context to reproduce without a little trial and error. If anybody could point me to some detailed examples online, that would be greatly appreciated. Or if you have something nice and lengthy from your own code, say a bunch of different plugins and utilities chained together, or composed according to a recommended pattern - pasting it here would be really helpful. With or without comments, either way is fine. It doesn't even have to be an efficient way of doing things, sometimes the long way around is a good way to learn. As long as the example works and I see 2-3 of them I can probably infer most of what I need to know. If it helps to narrow down, I am most interested in how to assign specific classnames to a set of search results for an HTML document that is fed to rehype-react. I want to decorate the results in batches but only cause a single rerender. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Heya! Every repo has an example. Every repo also has tons of tests. They all work. There are more than 500 repos, a bunch of sites, we use our own tools, so you should be able to find what you want. But spend some more time researching and reading and tryhing. These projects relate to complex computer science topics. Parsers and ASTs. Folks study those topics for years. It’s not something you can get by copy/pasting an example. There are also many reasons people come to these projects: to build new things that can’t be made in other ways. There are many different ways to combine 700+ packages. We can’t make an example for most of those cases. Your practical question is extremely niche. Nobody has ever asked that to my knowledge before. Perhaps you can spend time framing your question. It’s much easier to help you if you spend more time on your question. |
Beta Was this translation helpful? Give feedback.
-
Hey, |
Beta Was this translation helpful? Give feedback.
-
For the record, this is what I was trying to do. Without punching holes through the virtual DOM. Screen-2024-02-28-164645.mp4Seems to be exactly what I was looking for. |
Beta Was this translation helpful? Give feedback.
Adding on there is some potentially related discussion in https://github.com/orgs/unifiedjs/discussions/109
This does feel pretty niche.
There are some foundational examples in https://unifiedjs.com/learn/
and many example of different rehype plugins in https://github.com/rehypejs/rehype/blob/main/doc/plugins.md
I'd also second the recommendation
https://github.com/unifiedjs/.github/blob/main/support.md has some good advice.
I'd also consider reading https://whatwg.org/faq#adding-new-features especially #1-4 as another guide for framing.