Ooh, I knew about the basic syntax but I didn't know about the spaces thing! Should definitely same some time and hassle. Also makes copy-pasting the text much nicer, since the ruby text goes after each bracket grouping which is pretty terrible if you've marked up each individual character.
The one potential downside is that this approach doesn't add additional space between each group if the ruby text is long and spills over to neighboring groups. Compare these two results, where the top uses the spaces approach and the bottom individually marks each word/particle:
{猪蛋蛋上的粪便 | Zhū dàn dàn shàng de fèn biàn}
{猪|Zhū}{蛋蛋|dàndàn}{上|shàng}{的|de}{粪便|fènbiàn}
You can see that some extra space is left around 上 so that shàng can remain centered over it. However, there's a separate downside to this: it appears that while it will prevent ruby text from outright overlapping, it doesn't actually try to insert any space between adjacent groupings. So if I use the same pinyin style as your original post, the result around dàn dàn is not great:
{猪|Zhū}{蛋蛋|dàn dàn}{上|shàng}{的|de}{粪便|fèn biàn}
You can combat this by adding trailing spaces as needed, but it will look a bit haphazard because the space is included in the width when centering the ruby text, making everything look shifted to the left (here I put spaces after Zhū and dàn dàn):
{猪|Zhū }{蛋蛋|dàn dàn }{上|shàng}{的|de}{粪便|fèn biàn}
Unless the text is so long that it becomes difficult to understand which reading goes with which character(s), it's more of an aesthetic choice than anything; personally I like having the extra space, but I could see some not liking the irregularity. Probably less of an issue for Chinese than it is for Japanese where furigana can be much longer than the word, especially with some kun'yomi or wonky stuff used in fiction.