Based on what we thought this was initially about, and my suggestions, I thought what the hey, let’s try it. I’ve come up with something that isn’t perfect. There’s a small amount of manual effort involved, but it feels workable.
The latest version of the ThoughtAsylum Action Group has a section (currently at the bottom of the list), called Draft Embedding. It includes three actions.
TAD-Embed a Draft
- Create a refreshable embed block in a draft that includes another draft’s content.
TAD-Refresh Embeds of this Drafts
- Searches all other non-trashed drafts for an embed block for the current draft and refreshes them to include the current content of the draft.
TAD-Refresh Embeds in this Draft
- Refreshes the content of all embed blocks in the current draft.
Let me explain a little further what happens.
The first action is used to make an initial insertion of two placeholder markers, and the current content of another draft. The placeholders are written as HTML comment, so they won’t appear in Markdown/HTML rendered previews. The comments also contain UUID based wiki links to let the other actions know which draft to reference as the content source, and give you an easy way to navigate directly to it.
A block looks something like this:
Some content in the original draft
<!-- EMBED : [[u:10715A17-F4CB-4B29-B780-103568651D42]] -->
Content here is taken from another draft.
It isn't updated automatically, but we can use some other actions to force a refresh.
<!-- [[u:10715A17-F4CB-4B29-B780-103568651D42]] : EMBED -->
Some more content in the original draft
The second and third actions carry out refreshes, but from opposite directions.
The second action would be run when your source draft is loaded in the drafts editor. It searches through all of your non-trashed drafts and finds any embeds for the current draft. For each one it finds, it refreshes the content of this source draft into that draft.
The third action would be run when you are in a draft containing one or more embeds and you want to ensure that they have the latest content. The action scans the draft for all embed blocks. For each of the blocks it refreshes it, fetching the current content from its source draft.
Without being able to hook this into any sort of version saving event in Drafts, this was the best option I could come up with.
Hopefully folks will find some use in it.