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

I have successfully run PageDraw in the browser by the source code, which may be helpful. #53

Open
jinmingpang opened this issue Jan 8, 2021 · 3 comments

Comments

@jinmingpang
Copy link

jinmingpang commented Jan 8, 2021

From the Readme, we can preview by the electron.

So I briefly explain how to preview by the browser. Just a few simple changes, it can successfully preview. more info.

  1. create pagedraw/ide-integrations/browser.cjsx
React = require 'react'
createReactClass = require 'create-react-class'
_l = require 'lodash'

{Editor} = require '../editor/edit-page'
{Doc} = require '../doc'
core = require '../core'
config = require '../config'
util = require '../util'

open_file = 'untitled.pagedraw.json'
initialDocjson = (new Doc()).serialize()

module.exports = createReactClass

    render: ->
        <Editor
            initialDocJson={initialDocjson}
            onChange={@handleDocjsonChanged}
            windowTitle="Pagedraw"
        />

# definitely not "right", kind of a hack
isInsideDir = (dir_path, file_path) -> file_path.startsWith(dir_path)
  1. update pagedraw/src/editor/router.cjsx . And one line browser: -> require('../ide-integrations/browser') at line 58.
   pages = {
        # some other routes
        browser: -> require('../ide-integrations/browser')
        electron_app: -> require('../ide-integrations/electron-app')
    }
  1. copy pagedraw/desktop-app/index.html to pagedraw/static/brower.html. And update some code at line 15.
window.pd_params = {
      "route": "browser"
};
  1. run yarn devserver and open http://localhost:3000/brower.html in the browser.

image

  1. if you want preview the project like 'https://pagedraw.io/tutorials/basics' in local. You can just edit pagedraw/static/brower.html at line 15.
 window.pd_params = {
      "tutorial": true,
      "blitz_id": "basics",
      "route": "stackblitz"
 };

image

@jinmingpang jinmingpang changed the title I have successfully run PageDraw in the browser through the source code, which may be helpful you. I have successfully run PageDraw in the browser by the source code, which may be helpful. Jan 8, 2021
@developerKumar
Copy link

Hi,

Thanks for the guide. Pagedraw app is working in the browser, But preview still doesn't work.

@jinmingpang
Copy link
Author

jinmingpang commented Jan 11, 2021

I think the Preview function is not working because there is a problem with the PageDraw online service. I downloaded the last released Mac App of PageDraw, Preview is also not available.

To tell you the truth, I'm not very clear about the code :(
I'm interested in designing trans-code.

@AusGirl
Copy link

AusGirl commented Jan 11, 2021

I get an error in this one as well.
Module not found: Can't resolve '../ide-integrations/browser' in '\pagedraw\src\editor

can you please upload all your files as a repository so we can clone the GIT and download? thanks in advance.

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