Yes, I understand that this might not be easy to implement.
This layout serves an academic purpose, as it allows the original document and its corresponding transcription to be displayed side by side for comparison and study.
Won’t the original document be too small to read with this layout?
Opening the image in a document window, with the transcription in the annotations inspector—like in your first screenshot—seems much more functional to me. Why the PDF? (If it’s for sharing, why include the file path and item link?)
Could you provide some context and share a bit of your reasoning?
…like what?
Even though I’m not convinced of the utility of your desired output, I found the technical aspects interesting enough to give it a go. Here is a proof of concept. We can generate the PDF from a markdown document with a style sheet tailored for the purpose.
Markdown template
I guess there’s more raw HTML than markdown, but using markdown does make it easy to add the annotation via transclusion. It also simplifies writing tables, which I chose to do for the metadata.
Thank you so much troejgaard for taking the time to create this script!
The layout works exactly the way I wanted.
I agree that some of the metadata might not be that useful when sharing the PDF, but thanks to the base you’ve provided, I can now try making a few tweaks myself.
The script works perfectly for a single image. How could I apply it to multiple selected images?
You could use `# {imgName}` to get rid of the <p class=title> (which is not very semantical, either).
In the CSS, most of the &, perhaps even all of them, are not needed (anymore). nth-of-type(1) looks more complicated to me than first-of-type.
And I suggest a grid for the body element with two columns. Something like
With this code, the image gets put in a figure element.
If DT rendered a transcluded document in a section or so, the div in the MD wouldn’t be needed. Alas… as it stands, one has no chance to see that content was transcluded in the final HTML. Something like <section data-url="url of transcluded file">the file's content</section>, and then one could write section {grid-area: annotation;}
Scrap that: The transcluded text will be inserted first, and then the whole MD document is processed. Just read it up in the MMD6 documentation.
You’re welcome. I’m glad you find it useful!
I’m still curious for some context, I would like to understand why it is useful.
It was a proof of concept, so I just wrote it to work with the currently displayed document (contentRecord). You could loop through all selected images like this:
As for the layout, it might be debatable, but I find it useful. I do genealogical research and use a genealogy program where I now can upload these PDFs and have a compact information about the document with both the transcription and the image, even if just a kind of a large thumbnail version.
Ah, that makes more sense to me. Thank you for adding some context! I didn’t doubt that you found it useful—I just got a bit confused when you said the purpose was to display the original and the transcription side-by-side “for comparison and study”, academically. The PDF output seemed suboptimal for that, so I assumed I was missing something.
Another reason I asked is that DEVONthink can be used in so many ways. Examples like yours can serve as inspiration and give other people ideas
I actually thought it was an interesting idea. I can see the utility if one wants to just “look” at something without dealing with menus, sidebars, etc. Not of use to me but I get it. And I don’t even think OP intended it that way.