Export a complete vault as single html

Makes sense, and I agree, exporting in this way would be great.

You might want to look at this workaround for now: Use R to Convert MD to various document formats (html, docx, epub, pdf etc.). I haven’t used it, but it seems robust

1 Like

For my public website, I use “Obsidian to HTML” to map (part of my) Obsidian Vault to HTML files.

This will create one HTML file per Obsidian file, instead of a single, continuous HTML file. But still, maybe it can help you out.

5 Likes

Thank you @Froodooo, it’s a start. I’ll keep an eye on it. For now, I’ll need to wait until they figure out how to work with the ![[]] embeds, as I use those extensively. But this looks like something others will find useful, too.

Pandoc is the tool for concatenating multiple source documents together and converting them into another format.

As far as dealing with Obsidian’s internal links, I might suggest waiting for the “Export to Standard Markdown” feature on the current roadmap to find its way into the wild. Once that’s available, converting an entire Vault into a single, standalone HTML5 file is just a one-liner shell command.

Edit: It looks the original post was edited at the same time I made this reply. I’m going to amend my post to mention that the requirements now fall well outside of the scope of simplicity in regards to Pandoc.

Interesting, and thanks! I’m just discovering Pandoc and am concerned it’s beyond my pay grade. But I’m willing to take a shot at it. Let me make sure I understand.

You’re saying that when Obsidian’s “Export to Standard Markdown” feature goes live, I’ll be able to export the vault to standard markdown, and send that through Pandoc to make a single HTML5 file. What kind of format would that be? Looking at the beginning documentation, “If multiple input files are given, pandoc will concatenate them all” makes me imagine a long web page type of thing. Would you be able to view one note at a time, or all at once, as if it’s been made into a PDF? What would the framing/interface look like?

Also, how would Pandoc handle Obsidian embeds? The way I do my notes involves up to three or four layers of embeds, which works great within Obsidian, but would that survive the conversion?

Before the original post was edited I mistakenly thought what you needed was, in fact, one long page. What I now believe you’re looking for is the user experience of Publish, with all the bells and whistles, wrapped up into a single downloadable file that can be passed on to clients. That’s far more work than I initially suggested.

As an example, for context, if you have a hundred Markdown files, all named something like 00_Forward.md, 01_Chapter1.md, 02_Chapter2.md, etc. Pandoc can easily combine those hundred files, create a table of contents, and output that copy as whatever format you like, in a single file. What Pandoc cannot do is determine backlinks, create a graph, or any of the other special features that Obsidian and Obsidian Publish can do - Pandoc is strictly a conversion tool.

@0x4A you made a great point when I raised this on Discord, saying that exporting a local “Publish Site” would disrupt the current Obsidian business model. It would be too easy to just post that exported file somewhere and have a similar result.

Out of this conversation I’ve come up with a new solution to my problem, which I’ll post in another Feature Request. Once I’ve done that I’ll post a link here for anyone that’s interested.

1 Like

The article mentions ‘R’ indeeed but the magic happens in pandoc which is indeed a very (very) robust tool. It converts .md-file to any supported export format that pandoc has (and believe me there are fexw ;-)).
Remark - Pandoc can also convert the other way around which can be pretty neat sometimes …

1 Like

Here’s the new Feature Request for Obsidian Viewer: Obsidian Viewer (or View-Only vault setting)

1 Like

I’ve been running into the problem of not being able to share my notes with colleagues. I don’t really mind any format, I just want a quick way to export a note (or group of notes?) in a more readable format for others to follow while I present or talk about them, or for them to be able to add comments and send it back to me. What’s the current best way to do this? An external md to pdf tool?

One quick workaround for now: Copy/Paste from Preview into Word, Google Docs, or whatever. Unfortunately it doesn’t carry over images, though.

Also, people talk about Pandoc being a tool for converting md to pretty-much anything, so maybe that could work?

Yes, that’s a good idea. Thank you!

Thanks @joeshirley for taking time to describe this important feature-request.
I have exactly the same background.
I’m also an old MindJet MindManager user and I have the same workflow with Export of the MindMaps to HTML5 and sharing them.
I currently use RoamResearch, I use Notion ( Sharing Kanban Boards ) , I used CintaNotes for many years and I used SSH & cloud shares with my own folder hierarchy of markdown files.
I use Hugo.io since years for many website projects and I really appreciate the strategy to store the information in plain markdown files.
But Export as HTML / PDF is so important and I’d really prefer to buy this as a module with a single price tag instead of a monthly fee.

1 Like

I wonder if there is a plug or extension for Hugo to make it talk “Obsidian”. Namely generate similar to Publish.

That’s the reason it should be also available as a One Time Payment for a plug in with this capability.
Obsidian has some engine, in the form Static Site Generator (SSG) that speaks “Obsidian” and generate those sites. If we could have it in the form of a plug in, I’d pay for it. So their model could expand into pay per service and pay per feature.

I am in the same situation with you . With thousands of topics in Mindjet Manager which is so unfriendly with search, I switched to OB. After lots of manually linking and embedding, those flavored marks such as ![[ ]], [[ ]], ![[ #^]] are liked to get me kidnaped by OB. In other software or platform , those linkings and embeddings just don’t work , What makes worse is, other than the linking and embedding syntax, I can’t see the content itself of the note.

2 Likes

This feature would be huge. Export to HTML5 that looks just like Obsidian Publish. If it is a problem for the Publish business model, I would happily pay for the feature with some other payment scheme.

For single notes you can use Typora - I’m using it to copy notes as HTML and paste them in WordPress’ back-end.

Similarly, you can merge multiple notes - either using one of the available plugins for Obsidian or manually (combining MarkDown files is the same as combining TXTs and can be done with a single command in a terminal) and then go the Typora route.

Of course, this way you lose any inter-linking between notes, and I don’t think images are supported. However, if that’s what you want, exporting hundreds of linked MarkDown notes as HTML while keeping their internal structure/links, then you need a whole different solution that I don’t think even exists.

This is not exact solution to your query, but look forward to this potential solution:

I recently found Publii. It is an offline CMS (static site generator). But currently don’t support any of the Obsidian features (except markdown input). However, they say they are going to allow extending it through ‘Plugins’.

Hope, it will help us publish Obsidian Vaults through it. Btw, I raised an issue for this specific enhancement on their Github profile. It would be nice if more persons, encourage them to bring such plugin.

Yes, exactly right. Obsidian is not as flexible as one would expect. Officially, it only supports pdf export now, which means that pdfs in dark mode don’t play any role.

pdf means that the complex CSS formatting will be broken.

Exporting with plugins also breaks Obsidian CSS formatting

html would be a great solution

1 Like