Re: Possible enhancement for the eucode tag
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Mar 28, 2007
- 691 views
Robert Craig wrote: > > CChris wrote: > > It just occurred to me that, since keywords and library routines are > > highlighted inside the eucode tag, the highlighting > > could be made into a link to the relevant section of library.htm or > > refman.htm. > > > > And perhaps this scheme could be extended to some well known libraries > > that appear frequently enough in posts in the forum. First candidates > > could be wxEuphoria, win32lib and euSQL, and more as need grows. > > > > This could, I think, help newcomers better understand the code snippets > > which are posted here, and make their discovery of migration to Eu easier. > > > > A problem might arise if the same routine name is used in several libraries. > > In that case, parsing the include statements that appear in the text should > > often disambiguate the identifier. If this fails, then highlight without > > a link. > > > > Would that be a good idea? RDS: would that be a reasonably implementable > > idea? > > Yes, I've thought about doing things like that, > but the more html tags I try to add, the more > complicated everything gets. Witness the fact that > the RSS file had syntax errors in it today that > stopped it from working. (A bug triggered by your > message with a tag in the subject - not your fault! ) > > Regards, > Rob Craig > Rapid Deployment Software > <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a> I could read that indeed (couldn't get RSS working anyway). The e,ha,cement I was suggesting does not concern titles, but the way text inside an }}} <eucode>...</eucode> {{{ is rendered. I assume the highlighting there is done using HTML tags, so there are tags there already. The point would be to turn text a coloring tag into the color parameter of a <a href=...> tag. The transformation doesn't have to be after highlighting - that would probably create subtle bugs -, but in whatever renders the }}} <eucode> tag. Consider the following line, taken from your recent news.exu post, and reformatted for clarity: <br><pre> <font color="#FF00FF"> printf </font> <font color="#330033"> (1, </font> <font color="#00A033"> "\n1. my task id is rubbish: %g\n" </font> </pre> <br> Since "printf" is recognised as an Euphoria keyword, it currently gets a formatting tag around it. What I was suggesting is not to add tags, but change the current one. The change would be: <br><pre> <a href="www.rapideuphoria.com/lib_p_r.htm#printf"> printf </a> <font color="#330033"> (1, </font> <font color="#00A033"> "\n1. my task id is rubbish: %g\n" </font> </pre> <br> The other tags do not refer to keywords and do not need any change. The trick here is to replace coloring by a link. Using CSS, you can further customise the appearance of the link, adding a <div style=...> marker around the link in replacement of the current <font> one. Did I miss anything? CChris