Giter Site home page Giter Site logo

Comments (30)

kepano avatar kepano commented on May 25, 2024 4

@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

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024 3

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 :)

Requirements

While thinking about this specific converter, I found a few things to keep in mind:

File formats

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.

Drawings

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.

Locked sections

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.

Miscellaneous

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 :)

from obsidian-importer.

claremacrae avatar claremacrae commented on May 25, 2024 2

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?

from obsidian-importer.

kepano avatar kepano commented on May 25, 2024 1

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)

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024 1

Awesome, thank you very much!
I'm glad I could have a positive impact on Obsidian and support the community πŸ’

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024 1

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

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024 1

Sounds good. Thanks. Looking forward to this.

from obsidian-importer.

ericaxu avatar ericaxu commented on May 25, 2024

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.

from obsidian-importer.

Quorafind avatar Quorafind commented on May 25, 2024

Need it!

from obsidian-importer.

claremacrae avatar claremacrae commented on May 25, 2024

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.

from obsidian-importer.

daledesilva avatar daledesilva commented on May 25, 2024

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).

from obsidian-importer.

daledesilva avatar daledesilva commented on May 25, 2024

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.

from obsidian-importer.

dbarenholz avatar dbarenholz commented on May 25, 2024

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?

from obsidian-importer.

claremacrae avatar claremacrae commented on May 25, 2024

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.

from obsidian-importer.

mgrandi avatar mgrandi commented on May 25, 2024

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

from obsidian-importer.

ChrisRomp avatar ChrisRomp commented on May 25, 2024

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.

from obsidian-importer.

ericaxu avatar ericaxu commented on May 25, 2024

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.

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024

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.

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024

I'm considering changing how the OneNote importer works...

Why?

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...).

Solution

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:

  1. User installs our OneNote plugin inside OneNote
  2. User clicks "export" button in plugin UI
  3. User is prompted to choose an location of the export – a .zip file containing .html files of the notes + attachments
  4. User opens Obsidian Importer and chooses "OneNote (.zip)"
  5. Done! Pretty much everything from OneNote, including drawings, internal links, etc. is imported.

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.

Issues

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:
OneNote importer dialog with a banner on top


Just like always, I'd really appreciate feedback from the community and the Obsidian team! :)

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024

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.

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

Microsoft documents are just zips with XML files right? We should be able to support both unzipping and XML parsing as utilities soon.

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024

no, unfortunately the onenote notebooks are a .one file which is a proprietary file format that cannot be easily parsed.

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024

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

from obsidian-importer.

lishid avatar lishid commented on May 25, 2024

Yikes... It's a binary format with a 100-page manual. I guess there goes the idea of parsing from the .one file directly :/

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024

@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

from obsidian-importer.

p3rid0t avatar p3rid0t commented on May 25, 2024

Screenshot of OneNote Web extension store
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...)

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024

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

from obsidian-importer.

pgrennin avatar pgrennin commented on May 25, 2024

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


image

from obsidian-importer.

jdogcoder avatar jdogcoder commented on May 25, 2024

Definitely am super interested! What is the latest on this?

from obsidian-importer.

ericaxu avatar ericaxu commented on May 25, 2024

Definitely am super interested! What is the latest on this?

See the PR: #51

Making steady progress!

from obsidian-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.