

It should contain the HTML markup and the text explanation that you’d like to enhance your playground with. Create a new HTML file in the Documentation folder.Add a new folder named “Documentation”.playground file, and choose “Show Package Contents”. Create yourself a playground (and note where you save it)._įor this post, I wanted to take a simple example (the File -> New Playground playground) and convert the comment-style documentation into “fancy” documentation. I think using this documentation technique has the potential to enhance the Playground experience even more to create professional, sharp-looking educational material_. The read-example-experiment loop is so easy in the Playground environment. I’m already a believer in using Playgrounds for teaching. I figured I’d go ahead and share my discoveries alongside the official documentation from Apple.

I (as usual) did it the hard way and hacked my way through it. I didn’t know it at the time of this publication, but apparently Apple has some pre-release documentation out on, detailing how all this is done. Of course, my immediate question / thought was, “How’d they do that?! Can I do that? I want to do that!”. It’s like an interactive book, reminiscent of the Swift Programming Language iBook! Here’s a snippet of what their Playground looks like: Rather than create the documentation as comment blocks, they managed to put in sharp-looking notes and explanations before each code example / experiment.

As I opened Apple’s latest “Patterns Playground” blog post, I was impressed with the look and feel.
