Best way to format Task Descriptions for reddit's display syntax?
HOW TO SOLUTION:
-
Download and Import This Task XML (for detailed instructions on how to import a Task - see the sidebar of r/TaskerFiles)
-
When you are ready to share any of your Profile/Task/Scene in reddit for any purpose - long click it inside of Tasker in the respective Tab, and from the Tasker menu (3 dots) choose: Export > Description To Clipboard
-
Now run The Above Task
-
The description code will be formatted for display in reddit and put back in your clipboard, ready to paste here into reddit.
In essence it just reads the clipboard, puts newlines and indent spacing where needed to properly display in reddit, and then puts the text back in the clipboard. Saves you a whole lot of manual effort putting carriage returns and proper spacing in to make your code appear correctly in your submission.
There still may be a few text lines here and there that you may need to adjust, but this is quite automated and works very well.
EXTRA SOLUTION: For an online based reddit-formatting solution that can format outside of Tasker, u/plepleus came up with this excellent web based solution whereby you take your exported Task Description text, paste it into the lower right box at the above link, click "FORMAT", and it will format for reddit, in a very readable multi-line format. Try them both!!
Original Post
I was noticing that when using Tasker's "Export>Description To Clipboard" it uses a tab as indent at beginning of each line, and only a single newline between Actions.
And when putting it into reddit, reddit seems to require 4 spaces in front of line (and yes often just the first line, but sometimes the code breaks) and also the single newline makes it more difficult to read rather than double spaced.
Just wondering if when posting Task Description code if anyone is using any particular method, or just cut&paste typically and then manually replacing tabs with 4 spaces and so forth. Was thinking of writing a quick Task to auto-format the Task Description Exports specifically for viewing in reddit...
EDIT: I created a solution within Tasker itself for making reddit-ready Task Descriptions in regards to formatting. Read posts below for the info and XML download here. After Importing this Task, anytime you use "Export>Description to Clipboard", run this Task. It will take your Task Description from the Clipboard, format it, and then put the newly reddit-formatted text back in the Clpboard, ready to paste here.
Fellow redditor plepeus also has an online based solution that is linked to below as well.
Posted Apr 30, 2015, 5:46 AM UTC · edited