Building a document from a Drafts template


#1

I helped a student teacher out with a Drafts related query over on the Automators.fm forum. I’m posting a link here as it had some useful bits and pieces in it, and I figured it might be useful to have a cross-reference in the Drafts forum.

Just converting Markdown didn’t seem to be enough to do the job - the formatting didn’t look to permit that. It utilises a standardised input structure, template tags, HTML output, and a Shortcuts custom shortcut to generate a PDF at the end of the process.

Hope folks find it useful.


#2

I’m sat here clapping :grinning: Well done.

This may be a daft question, but how did you formulate the HTML for the template? Was it a ‘simple’ conversion/export from the Word doc or was more work/knowledge involved?


#3

I started with saving the Word document as HTML. Then I ran it through a formatter. After that I stripped out all the CSS and added back in the CSS I found it actively using. Finally I “corrected” the HTML as I worked through and tested the processing - as the OP noted, the original template was somewhat imperfect.


#4

Great. Thanks for clarifying.


#5

It might’ve been simpler to create the HTML by hand. :slight_smile:


#6

Hands up if you’ve done exactly that so many more times than you wish you had had to.

:raising_hand_man:t2:

Word and I have a love hate relationship. I personally really like Word (not as much as Excel, obviously) and for 99% of the things I ever want it to do, I can make it do it pretty well. What I don’t like are the garbage templates and lack of standardised formatting that I receive from “others”. They drive me :face_with_symbols_over_mouth: insane at times. It often takes me as long to fix the blasted document as to complete it.


#7

This is precisely why I author everything in Markdown or a similar text-based language.

(Recently, whenever I’m refurbishing a presentation, it’s my standard practice to convert it to Markdown - for my special PowerPoint pptx maker.)


#8

That’s just a little bit awesome!


#9

Just curious, but what would be the easiest way you would recommend to create the HTML by hand? Would it be a WYSIWIG tool or pure coding? Genuinely interested to hear.


#10

Personally, I’d do it by hand.

But note that Drafts itself could get you a long way. Not just turning Markdown syntax into HTML but note that Markdown can contain embedded HTML. So form elements might be embedded in Markdown as HTML.

And I’m sure there are tons of tools out there but for this one off case I probably wouldn’t bother.