Keepin’ it Swift
This is a Swift blog after all, so I would be remiss if I didn’t somehow tie-in a Swift easter egg here. The ever-amazing Swift evangelist, @ericasadun has written a great article on using Markdown in Xcode 7 comments to beautifully format your Swift header documentation (she even shows how to add images to your header docs that can be previewed in Quick Help).
Highly recommended, as are all of her great posts.
Swift header documentation in Xcode 7 by Erica Sadun.
The wrong way?
I use iA Writer as my goto Markdown editor & I highly recommend it. I find it odd however that in their non-pro version of the software (at least), adding images isn’t readily accessible. Furthermore, their online documentation gives an erroneous description on how to do this:
Currently only web-accessible image URLs are supported. On export to RTF or .docx, currently the image’s alt text is added, but the image is not embedded. You can add images via the following syntax:
<figure><img src="http://example.com/image.jpg" alt="image"></figure>
iA Writer Markdown Guide
The right way?
The correct syntax – that allows you to preview your images alongside your markdown (
Cmd + T) in iA Writer – seems to be the following:
![The Creation of Adam. Painted by Michelangelo at the Sistine Chapel.](http://i.imgur.com/p8UWPVF.jpg)
A link (http…), preceded by a bang (!) & the image’s title text within square brackets.
This post may be short-sighted, and there’s a good chance I’m missing something. If that’s the case, please let me know in the comments below, and I’ll make the necessary corrections.