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

[Feature request] Support Github edit code functionality #154

Open
zw963 opened this issue Oct 14, 2018 · 12 comments
Open

[Feature request] Support Github edit code functionality #154

zw963 opened this issue Oct 14, 2018 · 12 comments
Labels

Comments

@zw963
Copy link

zw963 commented Oct 14, 2018

Following is a image to describe what i means.

DeepinScreenshot_select-area_20181014150620.png

I think if we can edit github file directly with emacs, that will make create a PR very simple.

Thanks

@stsquad
Copy link
Owner

stsquad commented Oct 14, 2018

This requires the extension to be able to interact with the custom javascript for github as it's not presented as a plain text area.

@stsquad
Copy link
Owner

stsquad commented Oct 14, 2018

The functionality for github seems to be provided by CodeMirror. I believe there is an API for client side extensions to interact with CodeMirror but it would be a fair amount of work. I can certainly help with reviewing code and giving pointers if you want to give it a go.

@zw963
Copy link
Author

zw963 commented Oct 15, 2018

I thought i have no enough skill to do this, sorry.

when i want to contribute some code to another project,
i suddenly realized i can edit code on github directly.
if this process can be done in emacs frame, it is awesome.

this is all my original intention.

anyway, thanks, you can close this issue as you like.

@stsquad
Copy link
Owner

stsquad commented Oct 15, 2018

You can leave feature requests open so people can find it.

@stsquad
Copy link
Owner

stsquad commented Oct 16, 2018

This is also a duplicate of #125 which essentially needs the same thing.

@et2010
Copy link

et2010 commented Oct 27, 2018

Is this the same reason why it doesn't work for sqlzoo.net?

@stsquad
Copy link
Owner

stsquad commented Oct 28, 2018

@et2010 that seems to be something else:

<div class="ans mw-highlight mw-content-ltr" dir="ltr">

Which isn't an editable div as I understand it so JavaScript must be doing something behind the scenes.

@stsquad
Copy link
Owner

stsquad commented Oct 28, 2018

No my mistake, there is a textarea in there, not sure why it wasn't tagged.

@ThibautVerron
Copy link

Codemirror has a documented API: https://codemirror.net/doc/manual.html#api

It doesn't seem like the features needed for editserver would be too hard to implement, a combination of doc.getRange() for pulling and doc.replaceRange() for pushing? But with my meager javascript knowledge, it would take a disproportionately long amount of time to patch things together.

@stsquad
Copy link
Owner

stsquad commented Mar 28, 2019

@ThibautVerron you are assuming that anyone else has greater knowledge and time than you do. Most of the features that have been added to Edit with Emacs over the years have been a result of drive by contributions. So if you want this feature the best way to get it is to have a go at implementing it. Discussion and review of a working proof of concept will beat wishes any day.

@ThibautVerron
Copy link

I can't say any about time, but I'm certain that some people do have more knowledge of javascript or of the code of this extension than I do. I did not mean to imply that anything more than that, or to request that somebody invest time into this if they don't care about the feature.

My point was only to add relevant information for the passer-by who would be interested in the feature and have the necessary knowledge at hand.

Given how many platforms nowadays use CodeMirror (Github, Overleaf, CoCalc, Jupyter...), I have good hope that such a user will eventually come by.

And if I ever learn more javascript and it hasn't happened by then, this issue stays on my todo list.

@dsedivec
Copy link
Contributor

FWIW, GhostText tries to support editing CodeMirror (and Ace editors). It has its own problems/bugs, of course.

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

No branches or pull requests

5 participants