-
Notifications
You must be signed in to change notification settings - Fork 319
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
Sync readme.md from github too for descriptions #81
Comments
Sounds great. This will work fine for importing, but how should we handle the webhook. Listen for changes to the README? Treat it the same way we treat scripts (webhook just overwrites changes on OUJS)? Ignore changes on GH if it's been changed on OUJS? If a user tries to change that section on OUJS, should we send them to GH to edit it? I definitely want this in some form, but it wasn't in my initial plans for the first three milestones and I don't know if I'll have time to squeeze it in so I'm assigning it to the fourth milestone. |
Definitely a feature for later. I like the way how GreaseFork works with sync. Give the user access to the sync feature. |
Also see #96 where I suggest defining a common script file structure with GreasyFork also. |
I don't agree with using the readme.md for the scripts. |
Easy enough. scriptInfoMdFilename = None
if numScripts(repo) == 1:
scriptInfoMdFilename = '/ReadMe.md' # Case Insensitive
# /scripts/1234214.user.js
# /scripts/1234214.md
scriptMdFilename = scriptPath + scriptNameWithoutFileExt + '.md'
if fileExists(scriptMdFilename):
scriptInfoMdFilename = scriptMdFilename With that, you could have a repo with only 1 script, and have both a |
I agree. I think that is the best way to handle this. |
Did we decide on a naming syntax for this?
This could work... but wanted to note the Slapping some other naming suggestions (maybe more at a later point)
|
* Use Reference style links for accelerators for easier changing. Applies to OpenUserJS/OpenUserJS.org#81
HI all, I vote 👍 for adding this feature, it will render a great service to all those who have userscript hosted on different plattform Regards |
Great idea 👍 |
Since I've been twiddling with about DOC pages as of late I still have to try something with adding some predefined links to documents and see how GH md and our md parser handles duplicates so the accelerator arrows may not be an issue. e.g. Yes our md processor picks the last link reference. So perhaps, typing out loud, an example with GH wiki's:
and then appending on OUJS:
overrides the default GH anchors. So we could hardcode They look like this when no reference links are present of these names for GH: [⬆][toTop] [⬇][toBottom] [⇪][toContent] We can probably generate these on the fly on OUJS and just ignore GH too which would make it more cross-site ready in case there's a storm brewing on how they are named... and/or just keep it originally site named as I mentioned before to eliminate any potential conflicts. Looks like README.md rendered here on GH doesn't have a bottom and GH itself doesn't seem to have one either. |
This is my next project. UI
Edit: New Screenshot
DB // Sync
syncAboutSourceUrl: { type: String },
syncAbout: { type: Boolean, default: false },
// syncScript: { type: Boolean, default: true },
CodeGotta do this next. But it'll check for
|
@Zren commented on 3 sep. 2014 19:33 CEST:
Awesome! Waiting for this feature when I first suggested it; wish I had that amount of skills with node.js.
This comment box has an Markdown icon. |
I've noticed that GH is case insensitive for README.md and ReadMe.md and so on... so that should be a consideration I think. Moving the save button below the groups might encourage ppl to use it more. :) +1 there.
#186 but let me finish up with the serving first. This could be next in the chain after serving is handled properly. |
Learn to Regex foo. http://regex101.com/r/cB9vF7/1
Eh, true. I'll probably dump it in |
When someone offers you a tip for your declaration of assignment (even though you still haven't assigned yourself) you don't make it appear to be condescending by telling them something about learning re (regular expressions)... this isn't a noteworthy teamwork trait. I have been using re for at least a few decades, including a lot of the different implementations, but thanks for the cross-tip links for those that may find it useful. I was being polite for everyone's sake with the "I think" part as I know you will run into this. I prefer to use my noggin first (including a debugger) and then if I'm having an issue search the web for reference material, use the available add-ons and then finally use an online re tester. :) In short please refrain from inappropriate responses that was definitely perceived as bad attitude... a simple "thank you" would have sufficed. Thanks. |
I guess you missed the case insensitive flag in |
Yes I did miss that. It's the beginning of the month and I'm super busy and not as focused as I would like to be at the moment so I apologize if it was redundant to what you had already stated. |
The first version of this feature is only going to check for the |
@Zren commented on 16 sep. 2014 20:31 CEST:
So before updating the A solution for later is to use timed update checks (e.g. every 24 hours). Thats what GreasyFork & myUserJS do. |
Wouldn't it make more sense to have this done with the webhook on demand instead of draining the clouds resources with timers? |
Decided that since this is an opt in feature, the user might as well enter the required information. https://github.com/Zren/OpenUserJS.org/compare/pushdescription It's working. Just need to consider edge cases (case sensitivity on the lookup) and clean up the code. |
So are you going to let anyone sync from anywhere on GH?... say "Load someone elses readme.md to a spoofed hack of account x?" |
What's the point in authenticating for this if every other site just syncs with a url? |
Just off the top of my head...
You're screenshots might be useful for GH organizations but I can also think of some potential abuse there if someone doesn't have GH configured properly... and our own collaboration flags (metadata keys) if there's an error. Just some random thoughts. |
Don't get me wrong it does solve a few things but also may introduce a vulnerability or two with administration. Looks neat though... perhaps with some refinement down to the GH account since we do store that info per GH account... just some more random thoughts. :) |
@Zren commented on 15 okt. 2014 08:31 CEST:
@Zren |
* Unfocused md-editors no longer look disabled. * Add new panel in the scriptEditMetadataPage to with inputs to enter the filepath to a markdown file to use as the script description. * Refactored the webhook to wait on saving the script/description before sending an OK response with a list of the models changed (or an error). * Refactored the github import code to also handle importing markdown files. * New Properties: * Script.githubSyncDescription * Script.githubSyncSource * Script.githubSyncUserId * Script.githubSyncRepoName * Script.githubSyncDescriptionPath * Script.githubSyncSourcePath * Automatically fill out githubSyncUserId, githubSyncRepoName, and githubSyncSourcePath when when importing from github (eg: during the webhook). * Disable the Script.about markdown editor when set to sync with github.
A few questions come to mind:
I won't go into the code itself yet but there are some useful things in it. Again it contains huge chained changes and non-distinct. Cherry picking ideally should be distinct individual commits but when they aren't distinct enough someone will have to be watching and then pull distinct items out just to get something PR'd with no attribution other than a commit summary... at least in my experience with git/GH that is. |
They currently already have to make a script first before the webhook will work. The paginated import works. Not sure about the unlinked one that's suppose to be removed in #468 Edit: Or did you mean the current webhook action where it will determine the script by the name in the userscript metadata block? Because that's still in there and mentioned with "automatically filled out on git push". I could remove that input field altogether instead of having it disabled, but that might make it look you can only sync the description and not the source code. That's one of the reasons why I'm iffy about the last change. On the one hand, I want to move the syncing stuff into the edit script page, but on the other, we don't need to fill out data for syncing the source code.
Uncheck the button to disable syncing the description, and to allow editing the textbox. Jerone asked me to disable the md textbox when syncing. I just noticed a bug when doing this though. A disabled input/textarea doesn't have it's value sent in the form data when submitted. Our current route handler https://github.com/OpenUserJs/OpenUserJS.org/blob/master/controllers/script.js#L399 will bork if the
pushdescription attempt number 5. The original was
I merged all my previous commits into 1 since I had to rewrite them anyways and it's easier to amend a single commit instead of the second last commit or further back in history. |
I mean https://openuserjs.org/users/username/github/repos route... e.g. I don't need to make a stub on OUJS first and I can just push to my repo first then go import that to OUJS. Without examining your branch first the screenshot appears to imply from first impression that one has to have a script stub on OUJS first then it will allow syncing of both script source and the user data. Does that make more sense on what I'm asking? Please remember that I'm working on other things too so I don't always have a chance to do a checkout. This is why I ask for "screenies" and usually some sort of outline in an issue, then pr which usually closes that issue. We all are usually in the same boat working on various projects including this one... so that process helps tremendously and is why it was outlined in CONTRIBUTING.md (and not by me but approved because it works) Thanks for the explanation of the other points. |
Again, I did NOT unassign you. Keep up the great work. @Zren commented on 7 dec. 2014 06:18 CET:
Much better looking! Wondering if the sync block can be moved to the right sidebar? Great to see the path to the repo for both script and readme to be the same. Will review better when I have a change to test it. |
It could be put on the right, but it might get a little too squished before it goes into mobile mode. Just realized synching will come before grouos on mobile though. Bleh. Whatever. Started refactoring the script.edit route handler last night and realized the thing is evil incarnate. Going to stash my changes today and remove the disable mdeditor when synching code for now. |
Seriously... what? |
In an attempt to clean up my created issues that have not been processed or updated over a year, I'm closing this issue. If this issue is still relevant, please reopen another issue. |
Since OUJS search Github for
.user.js
files and we also support Markdown, should it also search forreadme.md
files in the same folder as the userscripts are found and use that for the description field...The text was updated successfully, but these errors were encountered: