joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Desktop: Add support for OneNote importer

Open pedr opened this issue 10 months ago • 1 comments

This is still a draft PR.

I'm adding a new package library that will be used to convert OneNote exports into Joplin Notes.

The onenote-converter is based on the implementations found in: https://github.com/msiemens/one2html https://github.com/msiemens/onenote.rs

We will be compiling the Rust code to wasm with the package wasm-pack to output a Node package that can be imported in our codebase.

Command to create node package

yarn dlx wasm-pack build ./packages/onenote-converter --target nodejs --scope joplin --debug yarn dlx wasm-pack build ./packages/onenote-converter --target nodejs --scope joplin --release


Todos:

  • [x] Try to find a better way for the first install of project
    • ~Right now the easiest solution to this is to ask for the user to run the CLI command to build the package before running yarn install~
    • We just use a package.json to point to the real files that don't exist yet
    • [ ] fix error in CI
  • [ ] Disable import in app-cli

pedr avatar Apr 03 '24 13:04 pedr

Some failures on CI:

2024-04-03T13:45:29.7543910Z ➤ YN0000: ┌ Resolution step
2024-04-03T13:45:29.7545630Z ##[group]Resolution step
2024-04-03T13:45:30.7137160Z ➤ YN0001: │ Error: onenote-converter@file:../onenote-converter/pkg::locator=%40joplin%2Flib%40workspace%3Apackages%2Flib: ENOENT: no such file or directory, lstat '/Users/runner/work/joplin/joplin/packages/onenote-converter/pkg'
2024-04-03T13:45:30.7346050Z ##[endgroup]
2024-04-03T13:45:30.7351150Z ➤ YN0001: Error: onenote-converter@file:../onenote-converter/pkg::locator=%40joplin%2Flib%40workspace%3Apackages%2Flib: ENOENT: no such file or directory, lstat '/Users/runner/work/joplin/joplin/packages/onenote-converter/pkg'
2024-04-03T13:45:30.7355690Z ➤ YN0000: └ Completed in 0s 957ms
2024-04-03T13:45:30.7357660Z ➤ YN0000: Failed with errors in 0s 966ms
2024-04-03T13:45:30.7632990Z Yarn installation failed. Search for 'exit code 1' in the log for more information.
2024-04-03T13:45:30.7652800Z ##[error]Process completed with exit code 1.
2024-04-03T13:45:30.7811060Z Post job cleanup.

laurent22 avatar Apr 03 '24 18:04 laurent22

What is missing at this point:

  • [ ] Create resources from the SVG tags after the note is converted to HTML
  • [ ] Remove the feature from mobile. Find a way to disable the option
  • [ ] Find a way to build the onenote-converter package.
    • One option discussed was that we build the binary on CI, with "two paths", dev and prod, dev only existing on the developer machine. When the developer is making a change to the project he can modify the file pointing to the dev binary that he is building
    • Maybe it is easier to just add the new dependencies to Joplin (rustup, wasm-pack)

pedr avatar Jun 13 '24 13:06 pedr