[Standards] Message Styling Go implementation and personal retrospective

Sam Whited sam at samwhited.com
Tue Nov 17 14:06:59 UTC 2020


Hi all,

I realized today that this might be interesting to some folks here, so I
wanted to send a link to my personal retrospective on Message Styling:

https://blog.samwhited.com/2020/11/message-styling/

It's not likely to be of any particular use right now, but if we ever
have a clean break and design our own styling system in the future these
are some of the things I'd want to keep in mind.

I also finally actually cleaned up (more or less) the implementation of
styling I started along with the spec 3 years ago but never released. If
you'd like to play with styling yourself and; are comfortable with Go,
or just want to borrow some unit tests for your own implementation this
one should be complete and compliant with the standard:

https://pkg.go.dev/mellium.im/xmpp/styling

I'd still like to add an AST for constructing messages and guaranteeing
their correctness at a later date, and maybe some nice methods on the
style method to access individual bits in a readable way without needing
to think about bitwise operations, but overall I'm pretty happy with how
small and simple the package is right now.

Here is a quick usage example (converting to HTML in a jank way) from
the docs that you can run:

https://play.golang.org/p/_dZcs2yZf52

—Sam

-- 
Sam Whited


More information about the Standards mailing list