jzoller Posted August 8, 2011 Report Share Posted August 8, 2011 Inspired by this idea, these are just a few, one-day-of-coding functions that implement a simple, regex based markup for string controls. For those not familiar with it, markup allows inline text to modify the displayed properties of the text. For instance, **bold** becomes bold, _italics_ becomes italics, etc. The code currently supports: Bold Italic Underline Colors (in #XXXXXX format) Text sizes (verysmall, small, large, verylarge) Strikethrough Some font setting Of course, it's still limited by the string control capabilities (no hyperlinks, no superscripts, no embedded lists). If people think it's worthwhile, I'll develop it into a somewhat more complete solution (or, of course, they can!). An X-control that supports it seems like an obvious extension, but I'm open to ideas. Note: this was developed in LV2011, and back-ported to LV2009. If you spot a problem with it, please notify me. Use: open and run LVMark_TestString.vi for a demonstration. Thanks, Joe Z. LVMark2009.zip 2 Quote Link to comment
Ton Plomp Posted August 8, 2011 Report Share Posted August 8, 2011 Based on the title, is this meant to be MarkDown compatible? That would be very nice! Ton 1 Quote Link to comment
jzoller Posted August 8, 2011 Author Report Share Posted August 8, 2011 Based on the title, is this meant to be MarkDown compatible? That would be very nice! Ton I think it could be (and I would like it to be!), but there are some fundamental differences in how they work. For instance, Markdown doesn't support underlining, and focuses pretty heavily on linking. I would like to end up closer to the Markdown spec than it is now, but there's a good bit of work yet to go. Joe Z. Quote Link to comment
asbo Posted August 8, 2011 Report Share Posted August 8, 2011 In LV2009 (Win7 SP1 32-bit), it seems that small and very small text do not work. I don't think your code is to blame, I manually cranked it down to 2pt Courier and it didn't change size whatsoever. I think MarkDown support would be pretty cool too, and BBCode and CSS while you're at it! Quote Link to comment
Wouter Posted August 9, 2011 Report Share Posted August 9, 2011 (edited) Hmmm I just checked it out. It looks good but I don't really like the codes... such as **bold** etc... rather would have [b]bold[/b] , with a clear opening and closing bracket but that can proberbly be changed easily. Also I would have implemented differently because now you loop threw the whole text each time for every style element and afterwards applying the style, you can do all of this in just 1 loop. Edited August 9, 2011 by Wouter Quote Link to comment
Ton Plomp Posted February 8, 2013 Report Share Posted February 8, 2013 If you like Markdown, I have created a library to use the LabVIEW report toolkit. See at Bitbucket Ton 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.