{"id":22728,"date":"2018-09-11T15:52:41","date_gmt":"2018-09-11T19:52:41","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=22728"},"modified":"2018-09-11T15:52:41","modified_gmt":"2018-09-11T19:52:41","slug":"compiling-and-exporting-ios-review-chapters-with-drafts","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/09\/11\/compiling-and-exporting-ios-review-chapters-with-drafts\/","title":{"rendered":"Compiling and Exporting iOS Review Chapters With Drafts"},"content":{"rendered":"<p><a href=\"https:\/\/www.macstories.net\/ios\/compiling-and-exporting-chapters-for-my-ios-12-review-with-drafts-5\/\">Federico Viticci<\/a> (<a href=\"https:\/\/twitter.com\/viticci\/status\/1039526967639502853\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.macstories.net\/ios\/compiling-and-exporting-chapters-for-my-ios-12-review-with-drafts-5\/\">\n<p>At the same time, I also wanted to simplify my process so that I wouldn&rsquo;t end up writing my review in an app and editing it in another. For the past few years, I&rsquo;ve experimented with Scrivener and Ulysses for this, but neither of them is well suited for the unique mix of longform writing and heavy Markdown automation I&rsquo;m looking for. Drafts 5 felt like the spiritual successor to Editorial that I could fully script and customize to my needs. So for the past three months, I&rsquo;ve been writing and editing my upcoming iOS 12 review entirely in Drafts.<\/p>\n<p>[&#8230;]<\/p>\n<p>One function of the <a href=\"http:\/\/reference.getdrafts.com\/objects\/Draft.html\">Draft object<\/a> in Drafts 5 is the ability to retrieve an array of drafts by querying the app for items that match a specific search string, filter, or tag (or combination of all three). Essentially, this allows you to search Drafts 5 for items that match specific conditions; items can then be iterated upon in JavaScript for additional manipulation. My action involves querying Drafts 5 with a tag filter, which returns an array of drafts that can be read in a repeat loop and appended (one after the other) to a new variable, which then becomes the .md file to share with other apps.<\/p>\n<p>[&#8230;]<\/p>\n<p>Finally, because iOS doesn&rsquo;t have a way to save data directly into another app&rsquo;s container, saving the .md file to a GitHub repository in <a href=\"https:\/\/itunes.apple.com\/us\/app\/id965019520?at=10l6nh&amp;ct=ms_weekly\">Working Copy<\/a> is done via the share sheet.<\/p>\n<\/blockquote>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2018\/04\/18\/drafts-5\/\">Drafts 5<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Federico Viticci (tweet): At the same time, I also wanted to simplify my process so that I wouldn&rsquo;t end up writing my review in an app and editing it in another. For the past few years, I&rsquo;ve experimented with Scrivener and Ulysses for this, but neither of them is well suited for the unique mix [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-09-11T19:52:43Z","apple_news_api_id":"d0ceb492-1d08-4375-9682-dab2f0f0bfa8","apple_news_api_modified_at":"2018-09-11T19:52:43Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A0M60kh0IQ3WWgtqy8PC_qA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[],"tags":[427,377,31,1610,26,346,337,1730],"class_list":["post-22728","post","type-post","status-publish","format-standard","hentry","tag-drafts","tag-git","tag-ios","tag-ios-12","tag-iosapp","tag-javascript","tag-markdown","tag-working-copy"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=22728"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22728\/revisions"}],"predecessor-version":[{"id":22729,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22728\/revisions\/22729"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=22728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=22728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=22728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}