me@

alexmuir

.com

The eternal HTML vs Markdown vs Text dilemma

on 18 April 2015

I’ve just been working on adding SVG images to How a Car Works.

As usual, I feel like I’m banging my head against the wall on the best way to store and edit the content of the articles. I’ve tried HTML, Markdown, HTML again with Redactor as the editor, now I’m finding once again that redactor is mangling my HTML source.

“Ahaa!”, I just thought, “I’ll store the articles as HTML files and then I can edit them in VIM or wherever I want.” But not being stored in the database means the articles won’t be searchable.

So now I’m thinking the optimal workflow might be to store all the articles as HTML files. And then each time a file changes, I repopulate the DB with a plaintext version. This allows me to put the articles in version control and to run batch jobs against them. They’d also be synched between my local machine and the production system - at the moment I don’t sync the two DBs.

I’m going to have a bath and think about it.

Markdown

on 10 April 2015

I’m writing this post in Markdown. Markdown is a language for formatting a piece of writing simply. For example, if I surround something with two asterisks *like this* then it is put in italic. Doing the same thing in HTML requires me to type <i>much more</i>. And visually, in its raw format, markdown makes a lot more sense.

The articles on How a Car Works have gone back-and-forth between HTML and Markdown with every redesign. I’m not even sure what they are stored as now… It’s HTML.

This afternoon I was coding up a system for articles on FrontendHQ and made the decision to go for HTML there too.

I just saw Markdownify, which is a new WYSIWYG-style markdown editor. It made me think that while I love the simplicity of markdown, I’ve given up using it in most use scenarios.

Images

I want control over how my images display in my content. And I usually want them to display in a <figure> tag. Markdown makes both of these hard and hacky.

I also usually want to reference an image from a local library - I don’t want tying in to a absolute URLs. The most recent way I’ve solved this problem is using a custom markdown image tag. For example, in this blog I use {class:something} which just starts to get ridiculous.

Why not HTML?

  1. It’s much more hassle to write by hand. <p> tags are easy but <strong> tags start to get a bit much. So I need a WYSIWYG editor but…
  2. WYSWYG editors still produce mostly horrible markup, and extending them with something like the custom image syntax above becomes a nightmare. That said, I use Redactor on How a Car Works and it works flawlessly and has a nice code mode. But..
  3. WYSIWYG editing is a terrible experience on mobile, and markdown is very efficient.

As ever, it’s horses for courses but this post has reminded me that I really prefer HTML to markdown. I think markdown is solving two problems:

  1. Limiting the set of available formatting (which we then bypass by using html tags directly).
  2. Producing clean HTML markup at the end.

I’m going to explore the latest version of Redactor to see how well it works on mobile.

Google kicks malware off Firefox result pages

Google kicks malware off Firefox result pages

on 7 April 2015

Hopefully we’re about to see an end to using Adwords to trick users into downloading crapware-filled versions of free desktop software like Firefox, uTorrent and Chromium.

Google is allowing free software developers to specify their official website in order to prevent peddlars of malware from buying Adwords slots and hawking their cloned, often barely functional, versions filled with whatever nasties they can pack into them.

Even Google products were being clickjacked
And Firefox too.

This is something that has been complained about for a long time. From late-April advertisers will only be able to promote free desktop software downloads from the designated primary distribution source of that software. Project developers are being asked to provide their official download domains.

The full email to advertisers is below. It’s a good solution.

Dear AdWords Advertiser,

We’re writing to let you know about a change to Google’s advertising policies that might affect your AdWords account. Around late April, the Google AdWords policy on unsupported content will change to include additional requirements related to free desktop software downloads. If you don’t promote free desktop software, this change shouldn’t impact you.

After this change, you won’t be allowed to promote free desktop software unless the ad explicitly names the promoted software and leads to the designated primary distribution source for the software.

If you advertise free desktop software, please make sure that your ads and landing pages meet the following standards:

— The ad includes the promoted software’s name

— The ad directs to a landing page on the site that’s designated as the software’s primary distribution source

Google will be providing software developers an opportunity to designate their primary distribution source for use with these ads.

Advertisers will be required to comply with the new AdWords “unsupported content” policy around late April. After the new policy goes into effect, you’ll see details at https://support.google.com/adwordspolicy/answer/6023676?hl=en#uc

Sincerely,

The Google AdWords Team

Yes, I know uTorrent isn’t open source and is basically officially filled with malware now. But I don’t stand a chance at drawing the Firefox logo.

Lego: The toy with no end-of-life

Lego: The toy with no end-of-life

on 5 April 2015

Such is life: You’re about to finish the battlements on your Police Pirate Space Castle and you’re one Lego brick short. Fortunately, you can use any brick produced since 1958. Lego was standardised before the metric system left Europe and a decade before shipping containers would be similarly settled.

Lego is the most environmentally friendly toy on the market. It literally has no end-of-life. It doesn’t break, it doesn’t wear out, and there’s a ready market for it as an alternative to the trash.

Every brick that Lego make is another one in the global stockpile - now 90 bricks for every person on the planet. And despite moulding plastic non-stop since the 1950’s, the price of Lego remains as buoyant as ever - both new and used. I honestly don’t know where all that Lego goes, but we can say that the amount being landfilled is effectively zero.

Think how unique this is among toys with their fleeting licensing deals, brittle and irreparable plastic structures, and zero resale value.

Getting greener

The LEGO Group made a commitment to run its operations on 100% renewable energy by 2020. And it’s on course - in 2013 it invested €400m into a North Sea windfarm which is now 50% operational.

They have also put things in smaller boxes, although boxes are often still about twice the size they need to be. I understand: The size of the box directly equates to the number of hours of tranquility a parent is going to enjoy.

But the company has a problem getting fully green: 90% of carbon emissions lie in its supply chain, and over 30% is from the raw material that goes into Lego bricks: crude oil.

Lego used 68,000 tonnes of plastic pellets in 2013.

The company plans to come up with a sustainable alternative material for bricks by 2030. LEGO bricks are made from a type of plastic called acrylonitrile butadiene styrene or ABS. It can be recycled, but that’s irrelevant because only a complete idiot would recycle Lego.

Any replacement material will have to match some formidable properties:

A squashed Lego brick. Required 430kg of weight to achieve.
  • Clutch power. This is a critical property that sets Lego apart from its cheap clones (the last Lego patent expired in 1989.) There is a fine tolerance that lets a block be easily joined, remain attached, and then be disassembled without tools.
  • Colourfastness. There are 23 colors of lego brick. They shouldn’t fade.

The LEGO Economy

Raw

Lego’s raw material, ABS plastic pellets, cost $3 per kg when bought in huge bulk.

New

Lego increase the value of that raw material by at least 20x when it lands on the shelf. The best value set on a piece-by-piece basis is the Detective’s Office (epic in its own right). It contains 2,262 pieces and weighs 2.6kg. So Lego transform $7.80 worth of pellets into an RRP of $160. New lego costs a minimum of $60 per kg.

Used

Once it’s been built, dismantled, jumbled up chewed and the instructions eaten, it might get put into plastic bags and flogged on eBay. Used Lego, unsorted in bags, sells for $10 to $20 per kg.

Most used sets sell for around 70-80% of their RRP. Some sets become collectible and then sell for a fortune: like the Ultimate Collector’s Millennium Falcon which was $500 new and now sells for $1,500 to $2,000. Or any sort of monorail.

A Monorail. Nothing more needs to be said.

This means that once a Lego brick has been moulded it will never be worth less than 6 times the value of raw material that went into it. This has to be unique among mass market products.

car.how

car.how

on 3 April 2015

I received an email yesterday from a How a Car Works visitor who helpfully tipped me off that the domain name car.how is available. It’s a fantastic name, and a great fit.

The .how TLD is managed by Google Registry. This list of Google’s TLDs, and the accompanying blurb, looks like it’s lifted been from a 1999 NADAQ list of IPOs. Check out these Web 1.0 gems:

.DAD

Fathers know best - A home for ideas, products, services, and info about fathers and fatherhood.

.FOO

Developers welcome - If you know what “foo” means, you’ll find your web dev, prototyping, and beta sites here.

.MEME

Viral content - The term “meme” connotes the echoing of a cultural idea. This domain houses viral phenomena, from ideas to images to videos.

Unfortunately, and rightly, the car.how domain has been designated as premium by Google, so it costs $620 per year. To be clear, that’s an annual ongoing cost.

I wasn’t aware of this new pricing model for recent top level domains. Up to now domains cost a flat rate per year, so it’s $10 for toys.com and $10 for someobscurenameyoudneverwant.com. There’s a decent argument that this low pricing has led to high levels of domain squatting.

So I can appreciate the logic behind premium pricing set up at the registry level. It discourages domain squatters, and encourages productive usage.

I’m on the fence as to whether it’s worth registering and moving How a Car Works over. If it was a one-off cost I’d do it in a flash, but annualised I’m not sure. I’d be effectively paying rent and I don’t like that one bit. I doubt there will be any SEO benefit, and users might be confused by the unfamiliar format of this name. Plus I’d lose a keyword from the domain because visitors often search terms like how car brakes work.

For now it’s a no - the existing domain is good. And, as ever, I’m fearful of rocking the SEO boat.

Older posts