-
Notifications
You must be signed in to change notification settings - Fork 1
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
In-browser editor #4
Comments
That sounds great. Best would be that we could make it configurable. So if you say that it should be a JS editor, do you mean one that directly runs in the browser? Other than that, currently the button doesn't do much more than running a system command (e.g. |
Yes, , I have found two possible options: https://github.com/Vanessa219/vditor/blob/master/README_en_US.md I have also seen another that could serve but does not seem actively maintained |
Yes, those options would of course be awesome! That would bring the project to a whole new level. As you saw, it's currently just using pandoc to go from markdown files (which I most often edit in zettlr) to html. But using one of these projects probably requires a lot more work than just opening an editor via system command, right? I probably won't have too much time to spend on this for now, how about you? |
I never did something like that, I really wouldn't know how to estimate the time that something like this could take, I'll try. |
have almost one half ready: read files and be able to edit them. I basically use a template in which the content of the file is completed. I am missing how to save them, my current idea is to try to use an HTTP POST method to update it from Python, what do you think? |
Oh interesting! So you're making fast progress afterall :) Do you have some work in progress that I could take a look at to see how it looks? Very excited! But yes, saving new markdown is very easy. This could be done with a normal HTTP Post exactly as you describe or we could use flask socketio to save without having to load any new page. |
In the backend this is as easy as @socketio.on('save_button_clicked')
def save_new_version(json, methods=('GET', 'POST')):
path = json["path"]
with open(Path(path), "w") as outf:
outf.write(json["file_content"]) or similar. And from the client: socket.emit( 'save_button_clicked', {content: 'File contnet', path: 'path/to/file'} ); (from top of my head) |
I still have two problems, sending the text to the server (I'll check your idea, I don't know anything about javascript, I'm just trying to interpret the code). |
Take a look: |
Wow, that looks amazing indeed! Let me see if I can get it to work with saving changes |
Hi @Pablo2m that's marvellous! Thanks so much for starting this. I've made the save button work right now (and it redirects to the rendered page). I'll add an edit button there in a second as well. I'm working on the |
@all-contributors please add @Pablo2m for code,bug,ideas |
I couldn't determine any contributions to add, did you specify any contributions? |
@all-contributors please add @Pablo2m for code, bug, ideas |
I've put up a pull request to add @Pablo2m! 🎉 |
@Pablo2m Ah, I see you're already working on removing this edit/open duality by making the vditor preview work properly! That would really make it a much better experience!! 🤩 |
Yes, I think it would be good, at least as an alternative. |
It would also be much faster, I'm sure ;) |
I have advanced with the prototyping, this week I will try to polish it and put it in the vditor branch. I liked the new readme |
The use of typora in windows is being a tough nut to crack (I don't know if this expression is used in your country), in short I am having a hard time getting it to work.
Can I add support to another editor? , I am thinking of something that uses JS (a necessary evil), so that it is independent of the platform, what do you think?
The text was updated successfully, but these errors were encountered: