-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Can I use "readme.txt" in the "View details" info? #217
Comments
I just noticed in another issue that you may intentionally be avoiding "readme.txt" because you don't think it occurs often enough and it would require another API call. Another option that I would be OK with would be to extend the README.md parsing to make sections (each first level headline) into tabs in the "View details" so that you could continue to use the markdown parser. I just hope to be able to provide richer details than the one line description. |
I found a way to do this without interfering with the current behavior too much. Please take a look at the parsing-readme branch I just published. This branch has code that only jumps into action if there is no changelog file in the plugin repo. In that case, it assumes the author of the plugin wants to share the readme file as the description of the plugin for users (much like on wordpress.org, except in this case we are looking for a This branch then parses the readme file into sections split on The end result is very much like what is done on wordpress.org, except that we leave GitHub/Bitbucket plugin authors in the comfort of familiar markdown files. I also believe that this method actually introduces no new transient issues since in the case of missing changelogs it just substitutes retrieval of the readme for the former retrieval of the changelog. I've only tested this with Bitbucket, but I kept as much of the code as possible in common across the two repo types, so I am pretty sure it will work with GitHub as well. All you need to do is rename (or remove) your |
Thanks so much for your interest in this. I will be happy to review your branch. Please know that it may take time for me to review this. |
At some point I can see adding a function to parse a WordPress-style |
@afragen, I can see the value in that. However, the WordPress-Plugin-Readme-Parser route is also considerably more complicated than what I've proposed. It expects the MD code in a I also believe that it would not have to be either/or. If you implement my simpler proposal now, there is nothing that prevents you from later adding the I am disappointed that better descriptions won't be coming to github-updater sooner. I look forward to them whichever course you take. Let me know if I can help. |
@efc the value in using the official The description comes from the
I think this is exactly how how it works on .org. I have several plugins on .org and that's where the info is parsed from. I actually have been meaning to add this. I don't think it should be overly complicated but I just haven't found the free time to start. It's coming. |
OK, I stand corrected. I just didn't realize that wordpress.org was using MD as the markup language in |
I'm actually making pretty quick progress on this. I'll ping back here, but expect something in next release. |
You must use a valid |
Should it be reading readme.txt from github repo and showing it changelog in case of changes.md not existing? |
Wow! That was fast work! Thanks so much. Yes, it seems to be working well in my first test. It is getting info from readme.txt and using it for everything, including the changelog, when there is no Seeing this in action, I agree that it is a better move than playing with |
I'm getting this error: |
@pedro-mendonca ... if the plugin repo you are using for your plugin is public, could you give us a link to it? I'd like to see the error in action and the files that generate it. @afragen ... I've noticed that my Installation section went missing. Looking at the code I see that Installation and Screenshots seem to be intentionally dropped. This is not the behavior for plugins from wordpress.org, so I don't think it is wise to delete these sections with GitHub Updater. I often look at Screenshots when evaluating an update, for example. Can we have those back? |
I have two exemples: https://github.com/ruhanirabin/WP-Optimize https://github.com/qTranslate-Team/qtranslate-x The error I've placed above is just one line. |
@pedro-mendonca ... I think I see the problem, it looks like the new readme parser only works properly with the |
@pedro-mendonca yes, that is the intended behavior.
I think I know where that's coming from. Let me fix and let me know if it's gone.
The difference is that the plugin is already installed so any information on installation is unnecessary. Screenshots have been removed as they don't display properly and I don't really wish to take the time right now to fix. |
This should now be fixed. Please confirm. |
Changing the View details for a GitHub sourced repo only works if the |
I have created two do-nothing plugins to test the |
If the problem is the plugin URI, than that's out of most users control. The error problem is solved 👍 |
There is also a secondary issue. If the plugin branch is |
👍 |
I have found a way to work around this issue. |
Great to see this roll out in the 1.4.0 update. Thanks, @afragen! However, I am finding that the release does not behave quite as the last development version I tested. Everything works fine for my efc/test-readme-traditional plugin, but my efc/test-readme-markdown plugin does not show any "view details" link on the plugins list, showing "visit plugin site" instead. Seems the |
Let me test a sec. |
The header for test-readme-markdown is wrong. It is the same as test-readme-traditional. Fix that and I'm betting it works. |
Oops, you are right, the lack of viewing details was a header problem with the plugin. Sorry about that. But I've fixed that and found an even more serious problem. Now some PHP notices are appearing on every page and the details, when viewed, are the default and not those from the readme.
This problem only appears when the plugin with the fully markdown form of |
I guess that's the answer then. You must have a valid |
Well, yes, I suppose. However this readme.txt file does pass the WordPress validation with flying colors. I can't find this |
I wonder... There must be something in the WordPress core that parses these files for the wordpress.org plugins. I'll have to dig for it this weekend. I wonder if it could be leveraged here instead of using an outside parser? |
@efc this is the parser they use. They might have made a few additions, however, they haven't put them back in. |
While the validator seems to accept However, even in the case of a malformed I am a git novice, so I don't know if I'm doing the forking/fetching/rebasing stuff right. At least I can't hurt anything in my own fork! |
I'll take a look and I agree the errors should be able to be mitigated. |
Yes, that commit does fix the PHP notices being thrown from your code. However there is still one notice being thrown by the
My suggested changes included a fix for that one too, but maybe you are trying not to modify that vendor code. In any case, at least that notice only shows up when checking for new versions and does not become visible to most users. |
I'm really not trying to fix the vendor code for edge cases. I did fix it for a few errors but they were error in showing in standard readme.txt |
That's up to you. As I read the code, it is simply wrong as written, which is why it generates the notice. The code verifies the length of an array, then seeks to use an element one further than the length it verified. Sure, it is only showing up as a notice on this edge case (so far), but it is still a mistake. |
FWIW, I have both of your test plugins installed locally and I don't see this particular PHP notice on the current develop branch. |
That's interesting. Do you have |
Always and using PHPStorm, xdebug and Query Monitor plugin. |
Does the readme.txt in question pass the validator? Which plugin is it associated with? |
Both the readme's in test-readme-markdown and test-readme-traditional pass the validator. Of course, at this point we expect markdown's That notice is being thrown when the parser tries to read the traditional The bottom line is that the I've updated the test-readme-traditional plugin with an even more correct |
BYW, @afragen, in case I have not been clear about this... github-updater is super useful and I am really psyched that you included the readme parsing. This last issue is minor, only evident when debugging, only present when the readme does not meet the documented spec, and a problem with a vendor script, so I don't mind at all if you move on to more important issues! I'm happy with the current state of affairs. Thank you! |
Plugins installed with GitHub Updater seem to use only the description and changelog markdown when displaying their "View details" info. However, I have a full "readme.txt" file with a number of sections that should create a much more informative "View details" box.
Is there any way to use this readme.txt if it is present?
The text was updated successfully, but these errors were encountered: