Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: Add support for OneNote importer #10255

Draft
wants to merge 63 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d8fbf7c
bringing converter to project
pedr Apr 1, 2024
6650d5c
making it work on desktop
pedr Apr 1, 2024
947835e
allow to execute more than one time
pedr Apr 1, 2024
d184ece
using workspaces to link the dependency
pedr Apr 3, 2024
34e067b
process zip file from onenote exporter
pedr Apr 3, 2024
e9ec561
improving ux of developer with onenote dependecy
pedr Apr 4, 2024
9d08fd1
Merge remote-tracking branch 'upstream/dev' into add-onenote-parser-lib
pedr Apr 4, 2024
472399c
remove workflow files
pedr Apr 4, 2024
d03ba41
allow to import more than one notebok at the time
pedr Apr 4, 2024
50d6d33
Merge remote-tracking branch 'upstream/dev' into add-onenote-parser-lib
pedr Apr 6, 2024
f96b3b1
moving build step to package script
pedr Apr 6, 2024
8e1ae98
remove generated files from eslint rule
pedr Apr 6, 2024
51a7619
add generated file to correct eslint ignore
pedr Apr 6, 2024
221be30
add lib dependecy to Dockerfile
pedr Apr 8, 2024
112e3f4
add rust dependecy
pedr Apr 8, 2024
644c8cc
Merge branch 'dev' into add-onenote-parser-lib
laurent22 Apr 10, 2024
fa728f1
adding onenote-converter build package to version control
pedr Apr 10, 2024
0cc1e4b
cleaning up logs
pedr Apr 10, 2024
1196e10
fix a bug where files that don't exist are trying to be read
pedr Apr 10, 2024
e0f3687
add wasm-pack as a dependecy to speed up building
pedr Apr 10, 2024
0702216
include rust analyzer to rust package on vscode
pedr Apr 11, 2024
0ea2e14
Merge remote-tracking branch 'refs/remotes/origin/add-onenote-parser-…
pedr Apr 11, 2024
0a4a7c8
running cargo fmt
pedr Apr 11, 2024
ef21ac1
refactoring log macro
pedr Apr 17, 2024
4ec43d8
new build artfects
pedr Apr 17, 2024
f49887f
add a new html importer to modify onenote embed links
pedr Apr 18, 2024
c13f313
a better implementation of embed to anchor
pedr Apr 18, 2024
7ab9876
removing duplicated implementation
pedr Apr 18, 2024
73f6ef2
changing error type to log information about the type error
pedr Apr 30, 2024
b06c4df
fix problem when trying to find files that don't exist/are too long
pedr Apr 30, 2024
cee6389
implementing read dir in js
pedr Apr 30, 2024
124a7ad
trying to find a workaround for the line_spacing implementation
pedr Apr 30, 2024
e9ef6d9
fixing width to emulate onenote page
pedr Apr 30, 2024
4560d9a
line height implementation
pedr May 3, 2024
923e4b6
wasm build artifacts
pedr May 3, 2024
4f1a3e4
fmt changes
pedr May 3, 2024
3e8d229
remove exit call
pedr May 3, 2024
0fe80b7
updating artifact
pedr May 3, 2024
c28eee1
adding first test
pedr May 3, 2024
d5349eb
testing subpage indentation
pedr May 6, 2024
1722da5
Merge remote-tracking branch 'upstream/dev' into add-onenote-parser-lib
pedr May 6, 2024
7938646
fixing logs calls
pedr May 8, 2024
d5522d0
bring back error instead of panicking
pedr May 8, 2024
c002b72
make subsections work as noteboks
pedr May 9, 2024
c897e3b
fixing starting point to toc if available, else use .one files
pedr May 9, 2024
990dd54
fixing type error
pedr May 9, 2024
0deb4fc
allowing injection of id generator in BaseModel
pedr May 9, 2024
b7059e7
new build artifact
pedr May 9, 2024
85d1d40
adding basic snapshot testing
pedr May 9, 2024
8da0b30
disable logs in non dev builds
pedr May 9, 2024
ab19916
transform svg node into base64 images
pedr May 10, 2024
186dcb8
partially correct, in some cases pages are created not in the correct…
pedr May 20, 2024
afaa3eb
adding fallback paragraph style data
pedr May 21, 2024
6c615bc
formatting code
pedr May 21, 2024
5dd4820
making .one files work without a onetoc2 file
pedr May 21, 2024
0bb4684
improving logs
pedr May 21, 2024
9de766c
.onetoc2 should only exist on local onenote
pedr May 21, 2024
6e3fbae
updating tests
pedr May 21, 2024
f215b04
adding one more tests about group sections
pedr May 21, 2024
11106a7
removing .one files from recycle bin
pedr May 21, 2024
a151cdb
removing err since we are actually supporting section groups
pedr May 21, 2024
8f32d2a
updating artifact
pedr May 21, 2024
4ef75ef
add readme.md
pedr May 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/app-cli/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
const gulp = require('gulp');
const fs = require('fs-extra');
const utils = require('@joplin/tools/gulp/utils');
const { execSync } = require('child_process');

const tasks = {};

const buildOneNoteConverter = () => {
const profile = process.env.NODE_ENV === 'production' ? '--release' : '--debug';
return execSync(`yarn dlx wasm-pack build ../onenote-converter --target nodejs ${profile}`);
};

tasks.prepareBuild = {
fn: async () => {
buildOneNoteConverter();
const buildDir = `${__dirname}/build`;
await utils.copyDir(`${__dirname}/app`, buildDir, {
excluded: ['node_modules'],
Expand Down
8 changes: 8 additions & 0 deletions packages/onenote-converter/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { execSync } = require('child_process');

const build = () => {
const profile = process.env.NODE_ENV === 'production' ? '--release' : '--debug';
return execSync(`wasm-pack build --target nodejs ${profile}`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use execSync - we should generally only use async methods so that multiple methods can run in parallel.

You might want to use execCommand2 from the utils package instead since it will better handle errors and output

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually ignore this - in this context it's fine to reduce dependencies to other packages and use built-in Node functions instead

};

build();
8 changes: 7 additions & 1 deletion packages/onenote-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"type": "git",
"url": "https://github.com/laurent22/joplin"
},
"scripts": {
"build": "node ./build.js"
},
"files": [
"pkg/onenote_converter_bg.wasm",
"pkg/onenote_converter.js",
Expand All @@ -19,5 +22,8 @@
"types": "pkg/onenote_converter.d.ts",
"keywords": [
"onenote"
]
],
"dependencies": {
"wasm-pack": "0.12.1"
}
}
43 changes: 43 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6949,6 +6949,8 @@ __metadata:
"@joplin/[email protected], @joplin/onenote-converter@workspace:packages/onenote-converter":
version: 0.0.0-use.local
resolution: "@joplin/onenote-converter@workspace:packages/onenote-converter"
dependencies:
wasm-pack: 0.12.1
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -13702,6 +13704,15 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.26.1":
version: 0.26.1
resolution: "axios@npm:0.26.1"
dependencies:
follow-redirects: ^1.14.8
checksum: d9eb58ff4bc0b36a04783fc9ff760e9245c829a5a1052ee7ca6013410d427036b1d10d04e7380c02f3508c5eaf3485b1ae67bd2adbfec3683704745c8d7a6e1a
languageName: node
linkType: hard

"axobject-query@npm:^3.1.1":
version: 3.2.1
resolution: "axobject-query@npm:3.2.1"
Expand Down Expand Up @@ -14228,6 +14239,17 @@ __metadata:
languageName: node
linkType: hard

"binary-install@npm:^1.0.1":
version: 1.1.0
resolution: "binary-install@npm:1.1.0"
dependencies:
axios: ^0.26.1
rimraf: ^3.0.2
tar: ^6.1.11
checksum: 271344b49f42460f5e3ec29d681cd4b749aaf9592040d49f6ae86d267b997b5fd094fd7a710df4d477fc299a51833b8cb94206595db6c46edea3f1603266a0d2
languageName: node
linkType: hard

"binaryextensions@npm:^4.16.0":
version: 4.18.0
resolution: "binaryextensions@npm:4.18.0"
Expand Down Expand Up @@ -21895,6 +21917,16 @@ __metadata:
languageName: node
linkType: hard

"follow-redirects@npm:^1.14.8":
version: 1.15.6
resolution: "follow-redirects@npm:1.15.6"
peerDependenciesMeta:
debug:
optional: true
checksum: a62c378dfc8c00f60b9c80cab158ba54e99ba0239a5dd7c81245e5a5b39d10f0c35e249c3379eae719ff0285fff88c365dd446fab19dee771f1d76252df1bbf5
languageName: node
linkType: hard

"font-awesome-filetypes@npm:2.1.0":
version: 2.1.0
resolution: "font-awesome-filetypes@npm:2.1.0"
Expand Down Expand Up @@ -42964,6 +42996,17 @@ __metadata:
languageName: node
linkType: hard

"wasm-pack@npm:0.12.1":
version: 0.12.1
resolution: "wasm-pack@npm:0.12.1"
dependencies:
binary-install: ^1.0.1
bin:
wasm-pack: run.js
checksum: 497abceb48b15329bb30f614b9ed7b07d82554ff225b93485794fb91b074a98aeda8091146aafe969c7f9615d106c770d215cf916bebf65451978f7222fcbe0b
languageName: node
linkType: hard

"watchpack@npm:^2.3.1":
version: 2.3.1
resolution: "watchpack@npm:2.3.1"
Expand Down