-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add common conversion traits for Node types. #2
Conversation
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.
just a few notes, but these look extremely helpful for making the api easier to use, thank you very much for your contributions!
i apologize for not recognizing this pr sooner, i completely missed it in my github notifications.
Ok, I've added a new commit with the final update I need at the moment, which is better support for inserting CSS content. Check out the new I've tried to make sure that all the relevant documentation has also been updated, but let me know if something isn't clear. Version has been bumped to And no worries about missing the PR for a bit, we've all got lives! |
@Conner-PYS, would it be possible to move css changes to a new pr? there is some further discussion that would be had there, which I don't want blocking the conversion changes. these css changes look great btw! |
Pulled the CSS macro out; I'll put up another PR with it soon. I'd love to hear if you have any ideas on improving the ergonomics of writing CSS in Rust tokens. |
CSS macro draft PR is here: #3 Simply reverts the last commit from this PR at the moment. |
Thanks for putting this library together! I've been testing it out over the last day or so and found myself wanting easier from/into conversions for some of the Node types and strings.
This PR adds the following impls:
on
Node
:From<Comment>
From<Doctype>
From<Fragment>
From<Element>
From<Text>
From<UnsafeText>
on
Comment
,Doctype
,Text
,UnsafeText
:From<T: Into<String>>
Subsequent commits have reorganized the node types into separate sub-modules; the single file was becoming a little to bloated.
Also, added a pretty-printing wrapper behind a
pretty
feature-flag; this wrapper is always formatted with the alternate formatter.