Embed Spreadsheet (Microsoft Excel or Numbers) in Markdown

I am slowly embracing Markdown as my default editor in DT/DTTG.

I like that I can embed image and PDF within a markdown file via
![](item-link)

I also recently learned that I can embed Markdown in Markdown via Transclusion.

If I have a Spreadsheet (be it Excel or Numbers) as an item in DT, it will display the contents. Is there any way that I can display the content within Markdown?

1 Like

If you do really merely want to see the content (as opposed to working with it) the way I do it is to include a screenshot of the relevant sheet (actually from Numbers in my case, but the principle is the same).

Stephen

As @Stephen_C noted, you can take a screenshot of your table and include that. But you might want to read other posts here in the forum concerning images in MD files – you might run into problems that you do not expect when doing that naively.

Also, there was a thread recently where I posted a proof of concept script
that creates a data URI from a DT link and inserts it into an MD file.

In the Markdown document, I simply just want to see the content. However, the spreadsheet has to be updated daily. I am ok to open external editor (Excel or Numbers) to update it.

I am very comfortable in embedding images in my Markdown file. In fact, I do that almost daily. I have many Markdown file with embedded images. However, taking a screenshot of the table every day is something I hope to avoid.

The spreadsheet is simply a table of a few rows to ten+ rows. I started exploring using Table in Markdown. However, it is difficult to edit Table in DT built-in Markdown editor. I even tried external Markdown editor such as Panda and Typora. It is still not easy to update Table in Markdown.

Since DT is able to display the spreadsheet (both Excel and Numbers) Table nicely, I am reverting back to use Excel/Numbers to maintain the Table. It is so, so much easy to update Table in Excel/Numbers.

If I cannot embed spreadsheet in Markdown, can I include a clickable link for the spreadsheet in Markdown? I tried different way to include the link. It does not seems to be working. The Preview does not has an clickable link, though the Edit mode has the Item link.

DT relies on Quicklook here, it simply has no idea at all what it is displaying.

There’s a document type “table” in DT, though I suppose it is quite limited, i.e. probably no formulas.

If Excel and/or Pages provide their own URL scheme (like DT does with x-devonthink-item://), it might be possible. Check out this page for that

Otherwise, I don’t think so.

Are you sure? I suppose you rather embed links to your images.

No formulas yet but transclusion will support DEVONthink’s sheets too in the next release.

4 Likes

The reason you are not seeing the hyperlink is that you are using syntax for transclusion for the spreadsheets.

Remove the leading exclamation mark:

![This is a transclusion](URL...)

[This is a hyperlink](URL...)

While we are at it, once you click on the link, it takes you to the spreadsheet, and if all you want is a quick glance, just use the back arrow at the top of the preview pane to go back to the original document (I find the keyboard short cut ⌘[ quirky).

Back Arrow

Alternatively, if you want to keep flitting between the original document and the spreadsheet, you can use tabbed browsing and open the file in a new tab (by ⌘-click or right-clicking and selecting “Open in new tab”; but only if you have enabled tabbed browsing in Preferences > General > Interface) and using ⌘{ and ⌘} to move between them quickly.

HTH.

Edit: I have got the syntax for transclusion wrong here - please see follow-up comments below.

1 Like

Thank you very much. That solves my problem. And the additional tips of navigating between original document and the spreadsheet is very useful.

What you quoted there looks like an image link to me. The OP used ![[]] (i.e. two square brackets).

You are of course right. (Serves me right for late nights…):

![This is an image link](x-devonthink-item:...)

[This is a hyperlink](x-devonthink-item:...)

![[x-devonthink-item:...]]    <- Transclusion

@TonyLim, please note my mistake earlier on syntax.

Thanks for the update. Since Transclusion is not supported for spreadsheet, I am using the hyperlink syntax.

If you need to edit large Markdown tables regularly, take a look at TableFlip . You can copy and past from Excel, do any trimming, and the paste straight into Markdown documents.

There are various Excel export methods as well, but I’ve always found Tableflip the easiest fit with my workflows.

3 Likes

Thanks for your recommendation. I just tried. It really amazing. I open a markdown file which contains a table using Open With TableFlip, it can recognise just the table and load it for editing. As soon as I save, the markdown table is automatically updated. This is good! Not sure if there will be an iOS (at least for iPad) version soon.

Actually that’s Obsidian syntax. The native transclusion syntax is {{someDocument}}.

Yes, that is correct – Fletcher Penny’s original MultiMarkdown transclusion syntax is to use double braces.

1 Like