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

Refactor out Nodejs related code so it can run in browser #38

Closed
linonetwo opened this issue May 8, 2018 · 12 comments
Closed

Refactor out Nodejs related code so it can run in browser #38

linonetwo opened this issue May 8, 2018 · 12 comments

Comments

@linonetwo
Copy link

linonetwo commented May 8, 2018

See https://stackblitz.com/, it's possible to run a dev server and an editor in the browser's service worker.

I think it's possible to build an online ReLaXed editor if all nodejs related code is refactored out.

@Zulko
Copy link
Member

Zulko commented May 8, 2018

but will it be able to generate PDFs ?

@linonetwo
Copy link
Author

linonetwo commented May 8, 2018

I guess iFrame will work.

iframe.focus();
iframe.contentWindow.print();

https://plungjan.name/SO/testprintiframe.html

This requires the user to click print as PDF too...

@linonetwo
Copy link
Author

Another way:

  1. open another tab that display generated HTML without editor(Just likes what stackblitz can do)
  2. run window.print();
  3. let user click print as PDF

@linonetwo
Copy link
Author

linonetwo commented May 8, 2018

Maybe one day, author of a paper only need to send a link to his editor.

@Zulko
Copy link
Member

Zulko commented May 8, 2018

Do you know overleaf ? Its basically that, but for latex

@linonetwo
Copy link
Author

linonetwo commented May 8, 2018

It will be different if we are using web technology.
Overleaf may be running their own server, but with ReLaXed, it can be serverless.

Deliver page via ipfs and ipfs-browser-gateway. Even the storage can use ipfs.

@Zulko
Copy link
Member

Zulko commented May 8, 2018

Definitely something I want to explore, but it would be quite a different project, and at the moment I dont like that the user would need to go through the print-page interface, possibly redefining paper size etc. everytime. It would also be some work to let users manage file and assets in their browser. Other drawbacks would be that you couldnt edit an image file in gimp/inkscape, and see real-time changes in your PDF.

But I agree that it would be orders of magnitude more accessible than the current solution.

@DanielRuf
Copy link
Contributor

I think it should be still standalone and available as Node.js solution with headless Chrome (puppeteer) in the background.

Personally I see not much sense in migrating the codebase and let this run in all browsers.
IF you start supporting one you have to support them all probably.

@Zulko
Copy link
Member

Zulko commented May 8, 2018

One good aspect would be user conversion, since you could get started on an example in seconds, nothing to install. You could also make a custom UI with relaxed-specific features. But yeah, huge project.

@DanielRuf
Copy link
Contributor

One good aspect would be user conversion, since you could get started on an example in seconds, nothing to install. You could also make a custom UI with relaxed-specific features. But yeah, huge project.

Could be easily done with React which can run Node.js code in the background and consume Node.js modules.

So basically we have a feature request for a different implementation (which needs proper planning and evaulation of possible solutions).

@Zulko
Copy link
Member

Zulko commented May 8, 2018

...with the problem that the main feature (automatic PDF generation with custom margins, footers, headers, etc.) is certainly not doable from a browser.

@linonetwo
Copy link
Author

Let me close this till there are out-of-box solutions to manage folders of assets in service worker(like stackblitz-core), html-to-pdf generator (maybe pdfjs but doc said it's deprecated) and assert editors (for images).

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

3 participants