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

Create gists from a real github repo #637

Closed
kwalrath opened this issue Aug 4, 2015 · 6 comments
Closed

Create gists from a real github repo #637

kwalrath opened this issue Aug 4, 2015 · 6 comments
Labels
P3 A lower priority bug or feature request
Milestone

Comments

@kwalrath
Copy link

kwalrath commented Aug 4, 2015

Instead of editing personal gists, it'd be much easier if we could create those gists automagically from a github repo. You should be able to create multiple gists from a single repo.

For example, we have a bunch of examples in https://github.com/dart-lang/dart-tutorials-samples. Shams has updated them and converted them to gists, for use in embedded dartpads. Shams was about to remove the dart-tutorials-samples copies of the gist-converted samples, but then we realized:

  • We'd like to be able to see diffs between versions.
  • We'd like to be able to download all the samples at once, in a form that's usable in, say, WebStorm.
  • We'd like to be able to easily search all the tutorial samples for certain things (e.g. places that could use null-aware operators) without relying on the extra copy that we put (by hand) in doc comments. For an example, search for https://gist.github.com/Sfshaza/192bf3be4a7308db4664 in /docs/tutorials/add-elements/index.markdown. We put this in there because it's hard to write about something you can't see, and to give us a little bit of searchability. If we have 3 separate copies of the code (gist, github project, and markdown), it's going to be hard to maintain.

Having a real github repo for the samples would make the code much more maintainable for us, and give us a real change history.

Could we get a tool that'd automatically create gists from a github repo? It's OK for the gist ID to change between versions, I think. (Though it'd be good not to change the gist ID if the generated code hasn't changed.)

/cc @Sfshaza @Georgehe4

@Sfshaza
Copy link

Sfshaza commented Aug 4, 2015

YES YES YES!

First, having the gists in a location that is tied to my ID is all kinds of wrong.

Second, for maintenance reasons, it's highly problematic to have the source in 3 separate locations.

Please consider adding this ability!!!

@kasperpeulen
Copy link
Contributor

I have been writing an executable that does something very close to that. So that it is easier to write dartpads/gist from the command line.

I will try to rewrite it so that you could do exactly that. I wanted to use something like that for myself as well.

I would suggest that after the first time the gist is created, the gist url will be added to the homepage field of the pubspec. So that the second time the gist can just be updated with that id (instead of creating a new id). The only problem would be then, that on which name would you put the gist? And how can you make sure the other person can also edit those gists.

A solution for that could that you get a token here: https://github.com/settings/tokens

image

which write access to gist. So if you then put all the gist on one of your two names, you could give the other person that token, and with that token, the other person has access to edit your gist (if you trust the other person enough ;)).

So then if you then tell the executable to update all gists from the github repo source, then you would need to specify that token, and then you would have access to update all gists.

@kasperpeulen
Copy link
Contributor

I began working on this here:
https://github.com/kasperpeulen/gist-generator

@kwalrath @Sfshaza

@kwalrath
Copy link
Author

kwalrath commented Aug 5, 2015

👍 @kasperpeulen!

@chalin
Copy link

chalin commented Nov 2, 2017

Related #788.

@jcollins-g jcollins-g added the P3 A lower priority bug or feature request label Oct 19, 2018
@RedBrogdon RedBrogdon added this to the Backlog milestone Apr 22, 2019
@RedBrogdon
Copy link
Contributor

Closing this in favor of #1096. Rather than processing a repo into individual gists, we cant just update DartPad to load from a repo directly.

johnpryan pushed a commit to johnpryan/dart-pad that referenced this issue Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

6 participants