diff options
Diffstat (limited to 'build/posts/macos-convert-to-html')
-rw-r--r-- | build/posts/macos-convert-to-html/index.html | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/build/posts/macos-convert-to-html/index.html b/build/posts/macos-convert-to-html/index.html index b45f0a2..47985c0 100644 --- a/build/posts/macos-convert-to-html/index.html +++ b/build/posts/macos-convert-to-html/index.html @@ -18,7 +18,7 @@ <main> <h1 id="convert-files-to-html-with-macos-automator-quick-actions">Convert Files to HTML with macOS Automator Quick Actions</h1> <p>2022-01-28</p> -<p>Since a few people have reached out and thanked me for my previous post <a href="/batch-webp-conversion">Batch Converting Images to webp with macOS Automator</a>, I thought I would continue to share more of my own custom Automator Quick Actions. Today’s post will cover the ability to convert <em>any</em> text-based document into pure HTML.</p> +<p>Since a few people have reached out and thanked me for my previous post <a href="/posts/batch-webp-conversion">Batch Converting Images to webp with macOS Automator</a>, I thought I would continue to share more of my own custom Automator Quick Actions. Today’s post will cover the ability to convert <em>any</em> text-based document into pure HTML.</p> <p>I know - there are over 6 billion conversion apps that do this very same thing. But our way of doing it is <em>cooler</em>. Our conversion tool:</p> <ul> <li>Will run directly inside macOS Finder (right-click actions FTW)</li> @@ -47,13 +47,15 @@ <p>Wait for everything to finish and you’re done!</p> <h2 id="our-custom-automator-quick-action">Our Custom Automator Quick Action</h2> <p>Next you’ll want to open the macOS Automator app and create a new “Quick Action” when given the prompt to do so.</p> +<p><img src="/public/images/new-automator.webp" alt="Toggle prompt for new automation in macOS Automator" /></p> +<p><em>After opening Automator, select “Quick Action” from the menu</em></p> <p>Now do the following (reference the image further below to make sure your parameters match):</p> <ol> -<li>Set “Workflow receives current” to documents in any application</li> +<li>Set “Workflow receives current” to <strong>documents</strong> in <strong>any application</strong></li> <li>In the search bar type in “Run Shell Script”</li> <li>Drag-and-drop the “Run Shell Script” from the left pane into the right pane</li> -<li>Set the “Shell” parameter to /bin/bash</li> -<li>Set “Pass input” as as arguments</li> +<li>Set the “Shell” parameter to <strong>/bin/bash</strong></li> +<li>Set “Pass input” as <strong>as arguments</strong></li> </ol> <p>Once all that is done, simply paste the following in the open text field within the “Run Shell Script” item:</p> <pre><code>for f in "$@" @@ -62,16 +64,23 @@ do done </code></pre> <p>If you’ve done everything correctly it should look something like this:</p> +<p><img src="/public/images/new-automator-2.webp" alt="Automator quick action details for converting to HTML" /></p> <p>Save this new Quick Action (Name is something like “Convert to HTML” to keep things simple). That’s it! Amazing, right?</p> <h2 id="time-to-convert">Time to Convert</h2> <p>Now it is finally time to see our Quick Action is <em>action</em>! Navigate to any document file in a Finder window and follow along.</p> <ol> -<li>First, right-click on the file you wish to convert. (<a href="#fig-1">Figure 1</a>)</li> +<li>First, right-click on the file you wish to convert. See Fig.1)</li> <li>In the pop-up container, scroll down and hover over <code>Quick Actions</code>.</li> -<li>A secondary pop-out will appear. Look for the action <code>Convert File to HTML</code> and click it. (<a href="#fig-2">Figure 2</a>)</li> +<li>A secondary pop-out will appear. Look for the action <code>Convert File to HTML</code> and click it. See Fig.2)</li> </ol> +<p><img src="/public/images/macos-convert-1.webp" alt="A markdown file in macOS Finder" /></p> +<p><em>Fig 1: Finding and right-clicking on your desired file</em></p> +<p><img src="/public/images/macos-convert-2.webp" alt="Convert to HTML action selection" /></p> +<p><em>Fig 2: From the “Quick Actions” menu, select “Convert to HTML”</em></p> <p>If everything was set up properly (and depending on the size of the file) you should see your converted HTML file show up right next to your existing document. Time to celebrate!</p> <p>Don’t forget - you can also <em>batch</em> convert multiple files and multiple file <em>types</em> at once. The possibilities are endless!</p> +<p><img src="/public/images/macos-convert-3.webp" alt="Finder window showing a Markdown file and an HTML file" /></p> +<p><em>Our converted document is now available in HTML. Absolutely glorious.</em></p> <h2 id="no-limits">No Limits</h2> <p>Although this article has mainly focused on converting documents to HTML, <code>pandoc</code> is so powerful you could do any number of conversions. Re-using these steps above, you have the ability to make as many different conversion quick actions as your heart desires!</p> <p>Have fun converting!</p> |