stsquad / emacs_chrome

A Chromium/Firefox "clone" of It's All Text for spawning an editor to edit text areas in browsers. Based on David Hilley's original Chromium extension.

Home Page:https://chrome.google.com/extensions/detail/ljobjlafonikaiipfkggjbhkghgicgoh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Support Github edit code functionality

zw963 opened this issue · comments

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

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.

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.

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.

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

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

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

@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.

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

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.

@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.

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.

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