Desktop: Support importing .one files from OneNote 2016#13391
Merged
laurent22 merged 45 commits intolaurent22:devfrom Oct 16, 2025
Merged
Desktop: Support importing .one files from OneNote 2016#13391laurent22 merged 45 commits intolaurent22:devfrom
.one files from OneNote 2016#13391laurent22 merged 45 commits intolaurent22:devfrom
Conversation
4677eb7 to
52ed1f9
Compare
License information is already included in LICENSE.
Applying suggestions from `cargo clippy`, removing an unused field
Due to a problematic merge, the Rust edition was reset to 2018 for the parser package. (The other packages use Rust 2024)
…ix native file API path resolution issue
Currently, only used in the Rust tests (and not in CI)
… errors Debugging import failures with one of the sample InteropTestSuites files
Owner
|
There's a conflict on lib.rs |
Collaborator
Author
|
I've found a bug related to how the parser handles . I'm currently encountering the following error when trying to import this file from the OfficeDev/InteropTestSuites and this other file from the Apache Tika test suites: I'm converting this to a draft until the bug is fixed. Edit: Notes:
|
Collaborator
Author
There was a problem hiding this comment.
Renamed from src/parser/reader.rs, with the following changes: Added tests, added absolute_offset, advance, and with_updated_bounds methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds support for importing OneNote 2016/OneNote desktop
.onefiles from the desktop app.Background
The desktop app previously only supported importing alternate format notebooks downloaded directly from SharePoint or OneDrive.
These notebooks are imported with a fork of
msiemens/onenote.rs, rendered to HTML withmsiemens/one2html, then imported into Joplin in HTML format. Themsiemens/onenote.rsparser, however, as stated in theone2htmlreadme,onenote.rslacks support for files created by the OneNote desktop app:This pull request updates the forked
onenote.rsto support parsing OneNote 2016-format notebooks.Import process
Although this pull request makes it possible to import data from OneNote 2016/OneNote desktop, the process is still somewhat complicated. For possible improvements, see the "Follow-up tasks" section.
To import a
.onefile:.onefiles into a folder..zipfile..zipfile from Joplin's File > Import > ZIP dialog.To import a
.onepkgfile:.onepkgfile.onepkgfiles are CAB archives. On Windows, it may be possible to extract theonepkgfile by first changing the extension to.cab..zipfile containing the.oneand.onetoc2files from step 1..zipfile from step 2 using Joplin's file > import menu.Change summary
local_onestoremodule and moved the previous alternate format parsing logic intofsshttpb_onestore.local_onestore.onestoremodule with adapter logic.onenote-converterinto multiple sub-packages (managed with cargo workspaces).renderer,parser,parser-macros, andparser-utils.#[derive(...)]macro to simplify parsing binary data. For why this needs to be in a separate package, see the relevant section of the Rust book.Possible follow-up tasks
.onefiles from the OneNote importer dialog. Currently, only.zipfiles can be selected..onepkgfiles from the OneNote importer dialog.onepkgfiles are CAB archives containing.oneand.onetoc2files. Joplin would need support for extracting theonefiles from theonepkgarchive.Testing
Automated testing
An automated test has been created that uses a sample
.onefile from OfficeDev/Interop-TestSuites. At present, it must be run manually withcargo testfrompackages/onenote-converterand does not run in CI.Manual testing
It has been verified that the OneNote importer can successfully import a user-provided
.onepkgfile by:.onepkgfile to a.zipfile..zipfile from Joplin.