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

Replace the playwright module for easy packaging as an executable #18

Open
Zacharia2 opened this issue Apr 26, 2023 · 7 comments
Open

Comments

@Zacharia2
Copy link

Can the playwright module be replaced to facilitate packaging into a single executable. Simplify the difficulty for people to use it.

@Zacharia2
Copy link
Author

@Jermolene hi, I want to package it as an executable file for people to use it easily. Here is the address of my project. But I have a problem, as mentioned above. playwright module is really too big to wrap in. So is there a better way to replace it?

https://github.com/tiddly-gittly/Epub2twpub

If you look closely you will find that yes, I am using the source code from this twpub repository. Not a single pen has been touched. Just made a wrapper to use.

@Jermolene
Copy link
Contributor

Hi @Zacharia2 it's great to see your work with TWPub, I am glad you are enjoying it.

TWPub uses Playwright to parse and render the HTML files extracted from EPUB files to ensure the highest compatibility between TWPub and browser-based EPUB readers. It might be possible to rewrite TWPub to instead use a JS-based HTML and CSS parser; at the time I started TWPub I couldn't find a library with the needed functionality but there might be something better available now.

@Jermolene
Copy link
Contributor

cc @xcazin who might be interested in this thread

@Zacharia2
Copy link
Author

@Jermolene Perhaps use the tool here: https://github.com/syntax-tree

@Jermolene
Copy link
Contributor

@Jermolene Perhaps use the tool here: https://github.com/syntax-tree

Thanks @Zacharia2. The API of rehype is very different from the DOM that TWPub currently uses so I think it might be a lot of work to convert it. JSDom might be a simpler migration.

@Zacharia2
Copy link
Author

hi @Jermolene I completed the replacement of playwright and I used JSDOM. It looks the same as it did without the replacement. This is my work, and I have added some comments to the code.

Packaged program link: https://github.com/tiddly-gittly/Epub2twpub/releases

@Zacharia2
Copy link
Author

On a whim, use JSDOM, so you can make a nodejs TiddlyWik plug-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants