Jan 082019
 

Markdown discovery

In August 2018 a work colleague sent me some notes in the form of a .md file and corresponding PDF. I looked up fileinfo and learnt that this was Markdown. As a long time note taker in ASCII file the idea of formatting text simply so it could be later converted to HTML was very appealing, I could not believe I had not heard of it before or thought about it myself. When doing web pages I’ve always striven to have readable HTML – e.g. save a word file to html and look at the source to see an example of unreadable html.

Syntax highlighting

I immediately started using Markdown and reading about it myself. It was released by John Gruber in 2004. I have used Editpad as my text editor for many years and I am used to opening files in it and they being syntax colour highlighted, e.g. for HTML, XML, JSON. My .md file were not syntax highlighted. EdiPpad has a Syntax Coloring Scheme Editor which I downloaded and thinking better of the effort needed I went back to Google! I found a syntax highlighter on Github for EditPad, which works great. I then found out that I had not updated to the latest EditPad as Markdown support was added in EditPad Pro 7.6.2 🙂

What is Markdown though?

After a week of so of note taking with Markdown I figured it would be nice to see some output, have a table of contents and see all my pages together. Reading the EditPad Pro 7.6.2 release notes I was wondering about how to print to HTML and I even emailed support asking when I go to print the .md file to a PDF it does not convert to the expected formatted file and what I needed to do! The ever patient Jan Goyvaerts explained to me that an editor like EditPad allows you to edit Markdown but it cannot render markdown as a formatted page. He added that this is similar to allowing you to edit HTML, but not being able to render the HTML as a formatted page. I could not believe I had not made the same conclusion!

I’ve been using Markdown for over 4 months now and only in writing this article today did I learnt that Markdown is also a tool for converting the Markdown syntax to HTML! If I had taken in all of Jan’s email at the start he diligently explained that another application is needed to convert Markdown to PDF, or one can use the original Markdown.pl Perl script to convert Markdown to HTML and print that to PDF with your browser. Indeed, In Gruber’s readme, he says:

“Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).
Thus, “Markdown” is two things: a plain text markup syntax, and a software tool, written in Perl, that converts the plain text markup to HTML.”

So, the download contains the pearl script, Markdown.pl, and refers to Gruber’s webpage for the Markdown syntax.

Converting Markdown to HTML

I wanted to render the documents to generate HTML from multiple files, i.e. create a table of contents of pages and join them together outputting HTML. I discovered Pandoc and learnt you could use it to convert Markdown to HTML. It works well.
pandoc *.md > markdown_book.html
will merge all the files in the execution directory alphabetically prior to translating to HTML. Of course there’s no auto generated table of contents.

The manual does suggest you need to do
pandoc -f markdown -t html5 -o myfile.html myfile.md
but the more simple options works fine:
pandoc myfile.md > myfile.html

There is one gotcha however, the markdown file must first be in UTF-8, otherwise you get the error:
pandoc: Cannot decode byte ‘\x92’: Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream
My editor (EditPad) had a real handy option to convert the text encoding to Unicode UTF-8, you can then resave the file. Alternatively you can convert the file from the PowerShell command line using the not very convenient:
Get-Content .\myfile.md | Set-Content -Encoding utf8 myfile.utf-8.md
Pandoc can also be run from PowerShell rather than cmd.

Markdown alternatives

Researching more for options I found out that that (arguably) the main Markdown alternatives are a massive rabbit hole and there’s loads others too…Creole, Textile briefly had me excited…

You can find blog posts on all the alternatives which extol their virtues, e.g. asciidoc: an awesome markdown alternative. Then, you will also find “When comparing reStructuredText vs AsciiDoc, the Slant community recommends reStructuredText for most people”. Another religious topic methinks!

DokuWiki

It started to really annoy me that there are so many variants of markup syntax all over the place! I started to think about DokuWiki which I have used as a personal wiki since the mid naughties, it has it’s own markup syntax too. Could I not use DokuWiki syntax independent of the wiki? On the DokuWiki forumn I learnt that this was not possible. I found out about Zim, most of Zim’s syntax is DokuWiki syntax, and you can use it like a notebook and also export to a joined up website.

I also learnt that Pandoc had support for DokuWiki but it was for output only, that is Pandoc can convert to DokuWiki syntax. It turned out there was an open issue for the last 4 years to add Pandoc DokuWiki reader support, I added a comment with my use case. Coincidentally, the issue was closed today and will be included in the next Pandoc release 🙂

Markdown cheatsheet

The Markdown alternatives lead me back to, well Markdown, though I hope to remain curious. I guess there is a reason Markdown has not been updated since 2004. As Gruber says
“Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is not to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a publishing format; Markdown is a writing format. Thus, Markdown’s formatting syntax only addresses issues that can be conveyed in plain text.”

I wanted a typical one page cheat sheet I could hang on my wall. None of the cheat sheets were ideal for me, they were too long or missing information like how to deal with nested lists\code blocks. The one I settled on is from Ahre code.

Alernative to HTML generation

For wiki pages and clog posts there are options to generating output from your Markdown.

Confluence has it’s own markup sytax of course though is WYSIWYG now. There are a number of ways to use Markdown inc a confluence page but they simplest is via Insert > Markup & select Markdown.

If you have your own WordPress.org site you can use a plugin WP-Markdown that works great to Allows you to use paste your MarkDown into a new post. I used Markdown for this post in August 2018 as well as this page itself which is published via the wp-markdown plugin. Have a look at the Markdown used for this page in side-by-side view with the HTML.

Trying Markdown

Gruber has a sandbox where you can try Markdown and you can use Pandoc online to render it to HTML.

Alternatively there are loads of online Markdown editors such as stackedit.io In-browser Markdown editor & Markdowner. I like the side by side view where you can see the markup in one pan and the HTML output in another, hackmd.io as shown above works great for this, with each edit also getting it’s own URL.

Dec 072018
 

So at the train\bus station, one can no longer get a parking ticket from a machine. If your phone is set up with the App it can be convenient but if not it can be definitely a case of saying to yourself well old school was better. It’s like having the tape desk to record just a short thing off the radio impromptu, it was so quick. Now you have to remember what time you heard it, go and see if there is a podcast…

So there I was on a dark bus I frustratingly I had to do the below on my phone:

  1. I downloaded the Apcoa Connect App
  2. I needed a password to login, it was over a year since I had used the service. I checked KeyPass on my phone and found ParkByText, remembering this was the old name for the service. However, the password I had recorded did not work 🙁
  3. I entered my phone number in the app and clicked on forgot password.
  4. I checked Gmail where my external email is added, nothing…did it go to spam? Gmail shows my spam folder but whenever I try and read it, it jumps back to the inbox. Sigh 🙁
  5. In chrome I login to my webmail and go to the spam directory, there is the recovery email. By the way typing in my email address is painful, no gliding, and not having the option to add unrecognised words on the fly to the dictionary like you could in Swype has frustrated me in Gboard. Update: If you go into keyboard setting, select Gboard you can add to the dictionary, I added my email address and a shortcut of _em_ now when I type em anywhere my email address comes up to select!
  6. My webmail does not show HTML email, it just shows the source, so I can’t see the reset link 🙁 I forward the email to my Gmail address.
  7. I switch to my Gmail in the app and click on the reset link, the resulting Apcoa screen also looks for my first name and last name.
  8. Now finally I could login to Apcoa. I had to add my card details before being able to pay. Finally, it was done.

Aug 242018
 

Four weeks ago, in July 2018, my smartphone was fatally water damaged when placed inside a supposedly waterproof drybag. Not having an available budget to replace I decided to see if I could survive without one.

I’ve been a big Android user for many years. I used a lot of Apps, so it will be a challenge.

Photos

Probably the biggest reason to have a smartphone; to be able to take a picture of your kids whenever you want, grab a picture of any information you see anywhere is super convenient. Not being able to do this is… well different, actually inconvenient, I’m used to be able to take a picture of a whiteboard at work and send it to a dummy WhatsApp group (everyone removed from the group) so I can then access it on my laptop.

Garmin Connect

I run regularly and the first thing I missed was being able to wirelessly sync from my Garmin Forerunner watch to my phone, and consequently, Garmin connect. The very manageable workaround is to:

  1. Connect the Garmin to your computer via USB
  2. Login to the Garmin connect web app
  3. Go to Import Data
  4. Select Browse and navigate to the folder on your phone containing the activity files, e.g. F: Garmin\Activity, you will see a .FIT file here cretaed at the time and date of your activity, you can select multiple files
  5. Select Import Data on the web app page
  6. If you have Endomonso or Strava intergrartion enabled the activities will auto sync to those apps immediately

WhatsApp

I don’t use Facebook except to thank people for birthday wishes one a year and I only use Twitter when I occasionally attend a conference so I thought I did not do Social Media! My wife explained to me that you know all the groups I was involved with on WhatsApp? Well, that’s social media, so don’t be fooling yourself!

WhatsApp has replaced texting and email in a lot of cases, though not all, for me. I tried emailing some people who I knew would reply to me quickly on WhatsApp and they did not reply! It was awkward being involved in some community stuff without WhatsApp, I was missing out on stuff I wanted and should be aware of. People said can you not just use WhatsApp on the web, but you need to have WhatsApp installed on your phone to do that, so you need a SmartPhone to use WhatsApp. Or do you! I googled how to use WhatsApp without a smartphone. I learned about android emulators which simulate an android device on your computer.

There are a lot of Android emulators available, the most common usage seems to be to access Android games. Most of the emualators use VirtualBox to host the emaultor (see more on virtualisation).

  1. I started with Bluestacks, it installed and I added the downloaded WhatsApp android file from the WhatsApp site. I had loading error messages but eventually, all did install. I had a backup on my google drive from 3 weeks before the water damage – I had been on vacation and the backup must not have been running, though I had set it up to ran daily whether on wi-fi or not. The backup restored and then 470 messages came in in 25 conversations, I was back! Or so I thought. I was not able to get WhatsApp open again on Bluestacks 🙁 I also tried installing on a Windows 10 machine but that had similar problems and never loaded at all. Time to move on.
  2. I tried the free version of YouWave, YouWave-Android-Free-3-31.exe, but when I tried to run it I got the message that it can’t exist with VirtualBox already installed on your machine. I used the later for development, so time to move on again.
  3. I next tried Memu Play. I clicked on Google Play and had to login. I have 2 step verification setup so a code was texted to my brick as well as a similar g-code. I then was able to install WhatsApp as normal on my phone and restore the old backup again. It has worked seamlessly on my Windows 7 machine since then. BTW, Memu shows in google by default as a Samsung Galaxy 7 edge.

Using WhatsApp an annoying thing was not being able to paste a screenshot/picture. The workaround I am using means you need to save the screenshot to a temporary file first, not a deak breaker.

  1. From Google Play install Amaze file manager and turn on Root Explorer in the setting of the App.
  2. Memu creates a download folder called Memu Download in your download folder on your windows machine, more info.
  3. To load a picture/file into WhatsApp, select Attach | Document | Browse Other Docs, then select Show SD card from the 3 dot menu in the top right-hand hand corner, this adds Internal storage to the top left list, select this and you will then see the Download folder and in that see any file you have saved there on your PC, available for loading into WhatsApp.
  4. Pictures received on WhatsApp can be accessed via Amaze by navigating to /storage/emulated/0/WhatsApp/Media/WhatsApp Images. Click on the thumnail to select pictures and then press the copy icon on the top, move to /storage/emulated/0/Download and select paste. Your photos are then accessible in the MEmu Download sub-folder of your download directory in Windows. From here you can attach them to a calendar event in google calendar and they will be autoloaded into Google photos.

Issues:

  • Ideally I would install the emulator on both home and work machines but an issue is syncing WhatsApp between both, one could force a backup (via WhatsApp Settings | Chat | Chat backup) before leaving work and a restore when you get home but that is a pain and not manageable so I just use the one instance.
  • The sound notification for WhatsApp messages in the emulator was annoying and I could not turn it off for some reason

WebApps

I can access a lot of my apps as WebApps, the ones I have accessed since the damage are:

  • Endomondo
  • Strava
  • Trello
  • Yr.no
  • Trip Advisor

Other Apps

Currently, the only apps I am really missing are:

  1. Our Groceries which we share for groceries list, so not having this is a pain
  2. Beep’n’go – this had all my store cards 🙁 Discontinued app but here’s how to install it if you have a smartphone!
  3. Keepass2Android means I can access all personal info from passwords to passport number
  4. Podcast Addict
    • Podcast addict & also recently Audible which I currently have a subscription for – I formerly used both running. I can access both from my Kindle at home – it’s relatively easy to install Google Play on your Kindle, but it’s not practical to run with a kindle!
  5. CamScanner A great app for scanning text, easily sizing it correctly and autosaving to the cloud.

I will continue for now and see if I can adapt.