Closed kepano closed 1 year ago
Please note that OneNote has different versions and @lishid was stuck in one of the older versions like OneNote 2015 or something. I think we'll only offer importing from the latest export formats.
Need it!
Have you had any thoughts about platforms this would need to run on?
The linked tool requires Windows.
OneNote also runs on Macs, iPhone and iPad, for example.
Have you had any thoughts about platforms this would need to run on?
The solution must work on macOS and Windows. Importer is not currently available for mobile (see #4)
I'm currently working on another format, but I'm very interested in this one. In preparation for whoever takes it up, it might be worth considering which aspects of OneNote are definite ins and outs for this bounty.
I do a lot of pen based note taking on my iPad in OneNote and have been meaning to explore whether drawings are exposed to the API. Even if they are, they'll be a significant task to parse and translate to Excalidraw (I think that's the only option?) And it would also create a dependency on Excalidraw.
My guess for inclusion would be text, images, audio recordings, embedded files (if as easy as audio recordings), and tables. I doubt drawings could be included as my guess is it would blow this out, but just noting all these for discussion (Not an exhaustive list).
Thatโs a really good point. I had thought I would migrate all my OneNote notes in to Obsidian.
I understand why drawings would be hard, but without them, itโs not a complete migration and I would just leave everything in OneNote.
There will likely be many people who never had tablet devices, for whom this would be no problem, I think.
One other thought, if it were doable to export an image of each drawing, such as a PNG, might that be a half-way house?
Or might the Excalidraw author elect to collaborate on the import?
I think the png option would only be worth it if it was a easy. I suspect Obsidian users wouldn't lean toward being happy with a read-only transfer of some of their content.
But I agree, I think those who draw in OneNote are probably minority.
My usecase for this is slightly different from usual; for me, onenote only contains drawings, as I use it on my tablet as paper.
Exporting these as PDF (as opposed to png) is the only slightly viable option (note: for me.) This would allow me to use any PDF editor on my tablet to keep writing on them.
Another point to take into consideration (again, my usecase): onenote has the option of an "infinite canvas" - I struggle to see any good solution on converting that to any format compatible with obsidian.
Perhaps as a "first version" it should just ignore drawings completely, as it's unclear what a desired export would look like?
Perhaps as a "first version" it should just ignore drawings completely, as it's unclear what a desired export would look like?
If it does ignore/discard any data during a first export, it would be helpful to understand how that data might be reunited in a later version.
Such as, could the first version include some kind of reference, name or URL at each such position in the converted file, so users are at least aware that there was something in that location in OneNote originally - both for info, and in case it can be migrated later.
There is also one note in corporate land where you have to use the Microsoft graph API, not sure if that would be in scope of what you want
Hello, I'd love to apply for making this converter :)
I have a lot of experience with OneNote as I was a heavy user of that app before I switched to Obsidian. Regarding my experience with Obsidian, I've also made a few plugins for it, mostly private and custom made for my vault (such as word cloud or OCR) using the Obsidian and Node.js APIs, although I do have one public which is a fork of Custom Sort with a few minor changes :)
While thinking about this specific converter, I found a few things to keep in mind:
OneNote has 2 ways to access notebooks which both have their upsides and downsides:
.one files They are fully local, although they are fairly hard to open as they are a custom binary format (sadly not a zip). Going off my quick ideas, opening those files would require the OneNote app installed.
Microsoft Graph API
The API is way easier to use from TypeScript as it only requires a few fetch()
requests to open a page or section. Also, using this API would allow for opening some corporate/work notebooks, since they usually are fully online and not local. However, it doesn't allow opening fully local/unsynced notebooks.
Sidenote: local OneNote .one files have 2 revisions, AFAIK the file format changed around OneNote 2013, but I assume we won't focus on the older one
What we may want to consider is that by using .one files we may possibly step into some copyright issues as it's a proprietary format? Also, the Graph API will definitely work on Obsidian iOS/Android unlike .one files.
A big part of OneNote is drawing. For this plugin, I assume we'll just convert them into .png/.svg. This approach isn't 100% perfect though, as some people may use drawings for arrows or highlighting text, which would look very out of context. A possible fix which was mentioned in this thread would be to convert notes with drawings into .pdf but this seems outside the scope of this plugin.
I'll admit that I never used this feature in OneNote... It seems like it possibly encrypts the actual content of sections? If that's the case, after importing notes is done, we should notify the user that there was an locked section which we weren't able to convert.
OneNote has some other misc features like rule lines, page colors, and similar things. They don't seem that important and in my previous attempts of making an OneNote to Markdown converter I just skipped those aspects. If anyone really needs that, we could possibly add these as properties to frontmatter like this:
---
page-color: yellow
rule-line: largeGrid
---
Let me know if you have any other questions! This comment is really long but I wanted to include everything related to this topic that I could think of :)
@p3rid0t You are assigned! Please make sure to submit your PR by end of day (GMT) on August 7th, 2023. Thanks!
Join the #plugin-dev/importer channel if you have any questions: https://discord.gg/obsidianmd
Awesome, thank you very much! I'm glad I could have a positive impact on Obsidian and support the community ๐
I have a fair amount of notes with PDFs either embedded or as attachments. I'll be curious to see how those can be imported. I'm fairly new to Obsidian but I've been using OneNote for a long, long time.
I have a fair amount of notes with PDFs either embedded or as attachments. I'll be curious to see how those can be imported. I'm fairly new to Obsidian but I've been using OneNote for a long, long time.
Sure! Once it's ready to test you can try your export. Come to our Discord in the #Importer thread to stay updated about the progress.
An importer from onenote would be very much appreciated ๐. I recently went through the exercise of trying to convert to markdown but there is no good option for exporting from macOS and I had to to forgo the switch to obsidian.
I'm considering changing how the OneNote importer works...
As of now, the OneNote importer works with plain .one files โ but that approach comes with a lot of issues since it's a proprietary format, which needs to be implemented with reading literal hex & bytes.
While the current version does work for the most basic stuff like pages, plain text, and partly images, it completely fails at the things which are sadly undocumented in the .one file specs like drawings (and those are a fairly big thing of OneNote...).
So I got an idea which would work on both Mac & Windows plus probably the Web โ make an OneNote plugin. It would work like this:
OneNote plugins get access to whole notebooks as well as drawings in .html format, which means all we would need to do afterwards is to use the htmlToMarkdown()
function! Less code is always better.
OneNote plugins are just web apps. This means the plugin would need its own node_modules and HTML files. Preferably, it would go into its own repo (but obviously, this depends on the Obsidian team)
Another issue is possible confusion by the users. To prevent this, we could add a little callout banner, mentioning that .one files are impossible to import and they need to use the plugin first. I made a demo UI for that:
Just like always, I'd really appreciate feedback from the community and the Obsidian team! :)
Hi @p3rid0t ,
User installs our OneNote plugin inside OneNote
My understanding is that onenote for Mac doesn't allow any plugins, so this would be a Windows only solution?
Have you looked into using the onenote api, iterating over notebooks and notes, and converting the html webpage to markdown.
I haven't personally used the API but theoretically think this could work. I think the user would need to setup app permissions in their microsoft account to enable. Not sure if this is the best route, just an idea.
Microsoft documents are just zips with XML files right? We should be able to support both unzipping and XML parsing as utilities soon.
no, unfortunately the onenote notebooks are a .one file which is a proprietary file format that cannot be easily parsed.
Microsoft documents are just zips with XML files right? We should be able to support both unzipping and XML parsing as utilities soon.
That's true for most Office apps like Word or Excel, but sadly OneNote notebooks are a proprietary format :/
My understanding is that onenote for Mac doesn't allow any plugins, so this would be a Windows only solution?
@pgrennin You can install plugins on OneNote Mac. Check out this article.
Edit: I'm actually not that sure if OneNote Mac supports plugins... I don't have access to my MacBook right now, the article only mentions Word, Excel & Outlook. If anyone here is a Mac user with OneNote installed, let me know if plugins are a thing
Yikes... It's a binary format with a 100-page manual. I guess there goes the idea of parsing from the .one file directly :/
@lishid I actually managed to add basic functionality using .one files by reading bytes directly, but it's horribly painful and not maintainable at all... Like I mentioned before, the manual is also missing documentation for drawings (no idea what kind of format they even are...)
I'd really love to do the plugin idea but this completely depends on the fact whether OneNote Mac has support for plugins/add-ins
Update: Apparently OneNote Web supports add-ins? Why does the Web version support these but not the Mac one... This makes ZERO sense (classic Microsoft...)
I use Onenote for mac and there definitely is NOT support for add-ins.
I can also confirm that onenote web does support add-ons.
So I think okay if users just use the onenote web plugins. Is it possible to check if your plugin works in onenote web?
Here is another approach where they used they used Microsoft Graph API, and it export to html: https://github.com/danmou/onenote_export
We considered the Microsoft Graph API but decided to temporarily reject the idea due to the fact that it requires an API token and it's a horrible idea to embed that in a client side plugin like Obsidian Importer.
I'm waiting for reply from anyone on the Obsidian team regarding the OneNote plugin idea. I think the OneNote plugin is the way to go, since it seems to allow exporting everything easily into HTML without weird workarounds
Sounds good. Thanks. Looking forward to this.
one more note, I see the option to upload your own add-in in onenote online by going to insert > office add-ins > manage my add-ins
Definitely am super interested! What is the latest on this?
Definitely am super interested! What is the latest on this?
See the PR: https://github.com/obsidianmd/obsidian-importer/pull/51
Making steady progress!
Please upvote this issue if you would like to see OneNote as an import format.
Bounty
See the Contribution guidelines for how to claim this bounty.
Bounty: $1,000 USD Timeframe: 10 days
Requirements
Current solutions