Viewing Bike files in browsers

If I drag a Bike file onto the Safari icon in the macOS dock, it shows me the human-legible (rendered) layer of the document.

The Safari view is best, of course, with UTF8 as the default encoding:

Safari > Preferences > Advanced > Default encoding > Unicode (UTF-8)


Chrome responds differently, showing me the HTML markup text.

Not quite sure why Chrome shows the markup layer – perhaps it only renders files with an explicit .html extension ?

In any case, quite useful to have two different instruments for quick views (rendered and mark-up), even on systems on which Bike is not installed.

For the next release I’ll change Bike (and opml) saving to include encoding like this:

<?xml version="1.0" encoding="utf-8"?>
<html>
  <head>
    <meta charset="utf-8"/>
  </head>
  ...

Hopefully that means you’ll never need to mess with Safari settings.

I’m unsure why Chrome doesn’t detect and show HTML. I also tried setting DOCTYPE, but that didn’t seem to make a difference. I guess Safari is noticing that the UTType “bike” is a subtype of “html”, so maybe that’s what it shows HTML in that case.

If you notice any changes (besides file extension) that can be made to Bike format so that it opens in Chrome as HTML let me know and I’ll make them.

1 Like

Something I’d like to eventually do is provide a default stylesheet so the outline looks like a Bike outline. And even better a javascript to expand/collapse items. Longer term project, but that would make publishing outlines really nice I think.

2 Likes