| 1 |
# Rust OneNoteĀ® File Parser |
| 2 |
|
| 3 |
A parser for Microsoft OneNoteĀ® files implemented in Rust. |
| 4 |
|
| 5 |
## Status |
| 6 |
|
| 7 |
Work in progress. Right now it can parse most of OneNote file contents but only |
| 8 |
if the files are in the FSSHTTP packaging format [\[MS-ONESTORE\] 2.8]. OneNote files |
| 9 |
as created and stored by the OneNote 2016 desktop application are not yet |
| 10 |
supported. |
| 11 |
|
| 12 |
## Goals |
| 13 |
|
| 14 |
- Read OneNote files available through both the OneNote 2016 application as |
| 15 |
well as through OneDrive download |
| 16 |
- Convert OneNote notebooks and sections into HTML (see the [one2html] project) |
| 17 |
|
| 18 |
## Non-Goals |
| 19 |
|
| 20 |
- The ability to write OneNote files |
| 21 |
|
| 22 |
## Architecture |
| 23 |
|
| 24 |
The code organization and architecture follows the OneNote file format which is |
| 25 |
build from several layers of encodings: |
| 26 |
|
| 27 |
- `fsshttpb/`: This implements the FSSHTTP binary packaging format as specified |
| 28 |
in [\[MS-FSSHTTPB\]: Binary Requests for File Synchronization via SOAP Protocol]. |
| 29 |
This is the lowest level of the file format and specifies how objects and their |
| 30 |
relationships are encoded (and decoded) from a binary stream (in our case a file). |
| 31 |
- `onestore/`: This implements the OneStore format as specified in |
| 32 |
[\[MS-ONESTORE\]: OneNote Revision Store File Format] which describes how a |
| 33 |
OneNote revision store file (also called OneStore) containing all OneNote objects |
| 34 |
is stored in a FSSHTTP binary packaging file. This also includes the file header |
| 35 |
([\[MS-ONESTORE\] 2.8]) and then how the OneNote revision store is built from the |
| 36 |
FSSHTTP objects and revisions ([\[MS-ONESTORE\] 2.7]). |
| 37 |
- `one/`: This implements the OneNote file format as specified in [\[MS-ONE\]: |
| 38 |
OneNote File Format]. This specifies how objects in a OneNote file are parsed |
| 39 |
from a OneStore revision file. |
| 40 |
- `onenote/`: This finally implements an API that provides access to the data |
| 41 |
stored in a OneNote file. It parses the FSSHTTPB data, the revision store |
| 42 |
data and then constructs the objects contained by the OneNote file. This includes |
| 43 |
resolving all references, e.g. looking up page's paragraphs. |
| 44 |
|
| 45 |
## Related Resources |
| 46 |
|
| 47 |
- [\[MS-ONESTORE\]: OneNote Revision Store File Format] |
| 48 |
- [\[MS-ONE\]: OneNote File Format] |
| 49 |
- [\[MS-FSSHTTPB\]: Binary Requests for File Synchronization via SOAP Protocol] |
| 50 |
- [LibMsON]: A work in progess OneNoteĀ® revision store file parser in C++ |
| 51 |
- [FSSHTTP - parser tools for protocol FSSHTTP/B/D]: A FSSHTTPB data parser |
| 52 |
|
| 53 |
## Disclaimer |
| 54 |
|
| 55 |
This project is neither related to nor endorsed by Microsoft in any way. The |
| 56 |
author does not have any affiliation with Microsoft. |
| 57 |
|
| 58 |
[\[MS-ONESTORE\] 2.7]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-onestore/189f186c-84ea-4892-afca-633c22bf9389 |
| 59 |
[\[MS-ONESTORE\] 2.8]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-onestore/c65f7aa8-4f0e-45dc-aabd-96db97cedbd4 |
| 60 |
[\[MS-ONESTORE\]: OneNote Revision Store File Format]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-onestore/ae670cd2-4b38-4b24-82d1-87cfb2cc3725 |
| 61 |
[\[MS-ONE\]: OneNote File Format]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-one/73d22548-a613-4350-8c23-07d15576be50 |
| 62 |
[\[MS-FSSHTTPB\]: Binary Requests for File Synchronization via SOAP Protocol]: https://docs.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-fsshttpb/f59fc37d-2232-4b14-baac-25f98e9e7b5a |
| 63 |
[LibMsON]: https://github.com/blu-base/libmson/ |
| 64 |
[FSSHTTP - parser tools for protocol FSSHTTP/B/D]: https://github.com/marx-yu/FSSHTTP |
| 65 |
[one2html]: https://github.com/msiemens/one2html |