muFORTH

Blog‎ > ‎

I'm supposed to be working on muFORTH

posted 12 Dec 2008 19:43 by Xenotrash Firemonster   [ updated 12 Dec 2008 20:00 ]
But it seems I'm spending time, instead, farting around with this silly site, and silly Sites.

I discovered that I can subvert, to some degree, the lack of an editable stylesheet, by embedding some style info in my elements. A good example is the markup for Forth words in MuforthReadme. I generated this page using the code that used to run my wiki site. It's a Perl script that mostly rewrites the wiki markup into HTML, and wraps the body in some boilerplate. It was pretty easy to confuse it – by setting a few environment vars – into thinking it was running as a CGI, and to "render" pages by spewing them out stdout. I'd simply select the text, copy it, and paste it into the Sites page editor. It's clumsy, but I'm not planning to do this very much.

The markup that script generates, for a Forth word, is
   <code class="forth">word</code>
Since the Sites editor strips out class attributes, I added a style attribute and tried to style the text the way my CSS sheet would:
   <code style="font: monospace 100% bold; margin: 0 0.2em; color: #800000">word</code>
That sort of worked, but the font bits were stripped out. Their stylesheet renders <code> elements as monospace already, so all I needed was to make it bold. Easy: wrap the whole in a <b> element.

So I edited my script, re-generated the page, uploaded, and voilà.