A life in the day

3/30/2005

Milestone?

Filed under: — site admin @ 10:40 pm

Or just an inchpebble?

Nice round number in the weight loss project. As you may know, I’m trying to lose a significant amount of weight. The doctor told me I should lose 75 pounds (2.2 pounds = 1 kg.) That was ten months ago. As of yesterday, I’ve lost 50 of them. My personal goal is another 15 pounds beyond what the doctor recommended, so I have between 25 and 40 pounds to go.

I also am off one of my medicines. I ran out of one prescription for a day or two, but once I’d refilled it I noticed that my blood sugar was remaining steady, so I never started it back up. I’m seeing the doctor next week and will double-check with her then. But for now, I’m down to one diabetes medicine. And I’m hoping to get off that one too next time. My dosage is already pretty small. If that works, I will be managing my diabetes with nothing but diet and exercise!

I haven’t checked my blood pressure lately, but my blood sugar is staying in reasonable ranges. I think I’m licking this thing!

3/15/2005

Stylesheets Plugin

Filed under: — site admin @ 12:52 pm

I’ve created my first WordPress plugin. It allows you to add your own stylesheets independent of the chosen theme. You can download it at http://scott.sauyet.com/php/wp-plugins/stylesheets/. Install is the standard, unzip, drop it in the plugins directory, and activate. It adds a panel to the managment page.

The genesis of this plugin was a little itch I had to scratch: I’ve been playing with themes for my blog. Someday I’ll get around to writing my own, but for now I’m working with many of the beautiful options available online. The trouble is that I kept having to patch the stylesheets with a little extra CSS that I was using on my site. I have some health issues that I’m tracking with markup that looks like this:

    I’m at <strong class="good reading">78</strong>, which is in the
    target range of below <strong class="target reading">100</strong>.

which in this blog looks like:

I’m at 78, which is in the target range of below 100.

and of course sometimes there’s a "class='bad reading'" too. :-( To go along with this, I’d been adding a tiny bit of CSS to the stylesheet for each theme I tested. This is tedious and error-prone, and seems to be against the spirit of WordPress.

So when I started to understand the plugin architecture, I created a tiny plugin that added the necessary CSS to the head of the document. Then I switched to an extenal call to the stylesheet. After that, I arranged for the call to the stylesheet to call through the plugin itself. At this point I realized that these techniques could be useful to others. So I’ve generalized it quite a bit, and tried to reasonably bulletproof it.

I think it’s straightforward to use, and self-documenting. It allows you to create as many separate stylesheets as you like, each one including as much CSS as you choose, linked or imported (maybe later I’ll add the option to include the CSS directly in the head), and associated with whatever collection of media you wish. You can also choose to hide any of these stylesheets.

I’m pretty happy with the results, but so far I am the only user. I would love to hear feedback from WordPress users.
(more…)

Powered by WordPress