Currently blocked on:
#2952616: Adopt CommonMark spec for Markdown files
#2949200: Add drupalorg_versioncontrol_repo_changes hook
#2952435: Merge in the CommonMark project
Allow module/theme maintainers to use a README.md
instead of the project page.
In the latest patch implemented:
- An option to use content from
README.md
(only when the file is available) instead of "Description" field. - Availability to choose
README.md
from branches and tags.
Need to test:
- Handle relative links to image/files, a README.md can include a link to a file in the project,so the parser has to rewrite the URL so it resolves to the git repository.
Issue fork drupalorg-1674976
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
msonnabaum CreditAttribution: msonnabaum commentedI've wanted this for a very long time.
Not only would it be less painful than writing HTML, but it would most likely lead to better project descriptions with more information on the project page. I often have to dig into the repository to find the README for the information I need. Github has shown that you don't need a separate lengthy description (yes, they do have the tiny one at the top) and a README, you can just render the README.
Comment #2
betz CreditAttribution: betz commentedMaybe project pages created on d.o. should also add a readme.md in the repo?
So in both directions...
Comment #3
ruplThis would be totally rad. Here is the library Github uses to render markdown (points to some other libs too)
https://github.com/tanoku/redcarpet
Comment #4
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedGood idea, but needs code.
Some remark:
- We wouldn't want to directly read files from the webhead. We'd need to keep them in sync on all of them.
- The contents of the files should be written into the database by some job triggered from the git commit.
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedAlso, since we don't want to complicate the D7 transition this should be a feature for after that transition was completed.
Comment #6
Dave ReidSounds like this should maybe be a small contrib module that extends D7 Project* to enable this functionality? That way we have something to test and review?
Comment #7
rgristroph CreditAttribution: rgristroph commentedI'm in favor of Dave Reid's suggestion, I've been helping with the D7 Project* stuff and I would be glad to help test and contribute to a project markdown page module (or whatever we call it).
Comment #8
generalredneckDon't see why this would be a big deal to implement. It's an awesome idea by the way. Got my buy in.
Comment #9
nickl CreditAttribution: nickl commented+1
Comment #10
gregglesSo far we've got a lot of markdown fanboys in favor (I'm among them). So, let's figure out why people might be opposed and address that.
Are there some people who *don't* want this? I think I probably don't want it for most of my projects personally. I assume the web content is more for evaluators while my README.txt is more for people who have committed and need to know how to configure.
How will we let people disable this feature if they don't want it?
Who is willing to write the code to get this done? (and why haven't you started!)
Is there anything at the infrastructure-level they will need to get it done?
Comment #11
gregglesFrom drumm in #2229141: Update projects homepage text with the README.md content if that exists which is now a dupe:
Nobody seems to be opposed to this after 1.75 years of talking about it!
So...if anyone wants this enough to work on this please go ahead.
Comment #12
sunIf you want to implement it in PHP, then it's just this:
composer.json:
ReadmeReader.php:
Comment #13
markhalliwellAs @sun pointed out (in IRC), this has been done by multiple project hosting systems and isn't really "github" based.
Also, this should be optional (perhaps enabled by default) in the project's settings. I would suspect that there will sometimes be a need for both.
Comment #14
drummComment #15
gislePersonally, I am not sure this is a good idea. For my point of view, project pages and the
README
-files serves two different purposes.By rolling the two into one, that distinction is lost, and I am not convinced that is a good idea.
PS: Just for the record, a link to the official guidelines for README.txt (they're, among other things, used as canon by reviewers of Drupal.org Project applications.
If you end up making
README.md
the source code for project pages, these guidelines probably need to be changed as well to reflect that change.Comment #16
markhalliwellIn #13, I suggested this should be completely optional. Until a project has such a need for distinguishing a difference between the project page (SEO/whatever) and the project's README (for whatever other reason), it should remain enabled by default. Yes, the guidelines would also have to be updated to reflect these changes once it is implemented, not a big deal.
Also, existing projects should not be forced to have this feature enabled by default and should remain as an "opt in" feature. The "enabled by default" should only apply to newly create projects.
Comment #17
markhalliwellAlso, FWIW, "two different purposes" usually only really applies to larger projects. The majority of projects would benefit greatly if they didn't have to maintain two different "README"s (which are often the same).
Comment #18
gisleThank you for the feedback, Mark Carver.
For the record: I've changed my mind. I now think that this will be beneficial. As you say, project owners that think their project will not benefit from this can always opt out.
I've amended the guidelines to make README.md formally acceptable in the project application queue (AFAIK, they're already informally accepted).
Comment #19
ricardoamaro CreditAttribution: ricardoamaro commented+1 to get README.md parsed and shown (optionally) on the project's homepage
Comment #20
marvil07 CreditAttribution: marvil07 commentedI'm not against this, but there are many markup languages, and that's what drupal filters try to serve, so we should consider using one of them as the "render code" portion.
Agreed about non-directly reading the git repository directly from webheads, so this probably would need the same idea than git code parser, and notice we have the filenames per branch already in versioncontrol tables, so the missing part would be the code to store the rendered output.
It sounds like a new "plugin", so it could be flexible(i.e. not only for markdown).
One extra note not mentioned before: A project has different branches, and naturally can have different versions of that README(even radically different) in different branches. How that should be picked up?
Comment #21
gislemarvil07 wrote:
The obvious rule is to use the README from the newest recommended release available. (i.e. D8 if a recommended release for D8 exists, otherwise D7, D6 and D5 in that order).
Since the use of README for the project page shall be optional, project owners can always create a custom project page "by hand" that describes all the releases available and how they differ, if they think that will be better.
As for there being "many markup languages": Please note that the documentation guidelines only permits markdown (in addition to plain text). Since these files need to be human readable in addition to parseable by the filter, I don't think we should go overboard in what type of markup we permit.
Comment #22
Elijah LynnIf a project has more than one branch I think the easy way would just be to render the one they have chosen as the default branch (that would also get more people to not have it set to the master branch).
Or the other way would be to do it Github style and have a branch/tag selector on the project page and it would change based on that.
https://github.com/fish-shell/fish-shell/tree/1.16.0
vs
https://github.com/fish-shell/fish-shell/
Comment #23
Elijah LynnDrupalDelphia is coming up in two weeks, Sept.12th, anyone up for sprinting on this then?
http://drupaldelphia.com/
p.s. Are there instructions for getting development setup for D.O?
Comment #24
Elijah LynnHere is a sample mockup of the option we could put on the project settings page just below the description. If you click that it could just grey out the description above so the maintainer would still have access to the data if they ever need it.
Comment #25
mglamanI'd like to chime in. Before coming to Drupal I did some WordPress work and put a plugin on WordPress.org: http://wordpress.org/plugins/facebook-albums/. Their interface is strictly based off of parsing the plugin's readme. Which is kind of cool, but sucks if you just want to make a simple change. (Also.. they're SVN, and the plugin page is built off of the release tag files and not the trunk... which if we're off of default branch HEAD, happy camper here.)
I dig #24. If I want to use the module's README off of the current branch's HEAD I check that. If I want to make a minor announcement without committing, I should be able to disable that option and edit imported HTML/markdown. Then, deciding "Ok! We roughed things out enough" I can enable this once more and it imports the README and project page is shiny and updated.
As for #15, I agree that there are two different roles (now.) However, maybe this can push people to use D.o documentation pages and link to them from the README? More projects are utilizing their own Wiki vs long and drull READMEs (as far as I can tell, don't shoot me for the generalized comment.)
Comment #26
drummYes, https://www.drupal.org/node/1018084.
If we go with a checkbox, I'd put it above the description - so it is more likely people will read it before spending the time to edit the description.
Comment #27
Elijah LynnThanks Neil!
Comment #28
MichelleIt's a neat idea but I wouldn't use it because I use project pages completely different than the readme. I see the intent is already to make it optional so I'm just chiming in as another pro-optional voice in case that ever changes.
Comment #29
swirtI think this is a great idea so that time does not have to be spent maintaining multiple documentation. I think README. could benefit from being more like project pages and project pages could benefit from being more like README. It seems like a win-win to me.
An Minimum Viable Product suggestion though would be to just enable the markdown filter for the description field so that maintainers can simply copy and paste the README.md from their module and paste it in the description to have it display what they want. In this manner, the maintainer can decide which markdown they want to display simply by which they choose to copy and paste. It is an extra step, but it is a pretty small one and gets us 90% of the way there.
A couple of suggestions for the longer term plan:
* I like the checkbox idea for using the markdown file or not.
* Keep the description field active and displayed even if "show the README' is selected, so that if a maintainer wanted to display extra information, they could.
Comment #30
drummreadme-drupal.redesign.devdrupal.org is being built out to work on this, requested by BR0kEN at #2512612: I want a drupal.org development site to create support of *.MD files for projects.. See https://www.drupal.org/node/1018084 for information on Drupal.org dev sites.
Comment #31
BR0kENComment #32
drummWe'll want 2 fields added to the Features exported to the drupalorg project:
This will let code disable that checkbox when README.md isn't present; since we always have a copy in the DB. To do that, let's start with a drush command to populate the field for a single project. We can script running that for existing projects that have README.md, and hook it up to code arrival and default branch change events later. We can make a temporary clone and pull it from there, if there isn't a more straightforward way.
I'm not totally sure if this should live in drupalorg or this project. This project is certainly technically ideal, but will need to come with things like an update hook to make the fields, in addition to drupalorg's Feature.
Comment #33
BR0kENThink I've done with this. Was added a possibility to use README.md from branches and tags.
See demonstration here: https://readme-drupal.redesign.devdrupal.org/project/mimeinfo
Comment #34
BR0kENComment #35
BR0kENCompletely forgot to remove my test repo from code. Here is correct patch.
Comment #36
BR0kENNeed to mark (\s+\/) as optional.
Comment #37
BR0kENBetter to use "select" instead of "radio" buttons, due to economy space on the page when project has a lot of branches and releases.
Need to remove this line, because default widget for "list_text" - is a "options_select".
Comment #38
BR0kENPrevious patches should be ignored.
Comment #39
markhalliwellComment #40
moymilo CreditAttribution: moymilo as a volunteer commentedManually tested and look through code, all seem to be fine.
Comment #41
markhalliwellSetting to CNW for the following reasons:
Comment #42
BR0kENI "very like" the community. Instead of using working feature it postponed it for a "ten years". Cool.
We are like perfectionists: want to do ideally or nothing.
Comment #43
gisleI am setting this back to RTBC. I think that the push-back in #41 was unnecessary and based upon not reviewing the correct patch and jumping the gun on a policy change that is still under review (and not likely to be resolved soon).
Here's addressing each single point raised in #41.
When and if CommonMark is officially approved, this may need to be tweaked. But it is IMHO quite wrong to block this very important project from progressing because of a possible (and IMHO unnecessary) future policy change.
Comment #44
markhalliwellIt is wrong to proceed with something that does not even have a general consensus in the community with how or what should be in markdown files, let alone what kind of markdown will be supported (not specifically "CommonMark", which is what that issue was about originally btw if you read it).
These are critical questions that should be answered before something like this is implemented. What happens when that policy is adopted and existing project pages break because the the format isn't the same? It is foolish of us to proceed just for the sake of "getting it done" without an actual plan in place.
I'm not.
No, I don't. It's a small simple project, one that was created solely as a POC for that issue. So yes, it does have a very small install count.
No, it's not. You really are missing the entire point of that issue. Just because it's "my module" is really of no consequence to me.
The only reason I created it is because there was push back in that issue to use a more standardized markdown library (which is why "CommonMark" was chosen, by others, not myself). Nothing existed, so yes... I'm the one that stepped up to help push along that issue... I don't see anyone else helping with that issue.
This isn't some attempt to blanket my name on things and quite frankly, I take offense to that. I'm here to help and it's inevitable that sometimes I'll create projects to move things along. Use it or don't, but again, not the point of that issue.
---
You can refute everything I said in #41, but it doesn't change the fact that #2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN) needs to be addressed first. We cannot implement something that doesn't even have any standards in place within the community... like, at all.
Comment #45
gislemarkcarver wrote:
Do you think people who write MarkDown sit down and look up the syntax before creating their
README.md
-file?If so, you're wrong. People use MarkDown because there is no such thing as "syntax error" in MarkDown. And the MarkDown you'll find in
README.md
-files (which is the only thing relevant here) is just basic stuff (headings, single level lists, non-nested emphasis and boldface). At that basic level, there is no significant difference between John Gruber's MarkDown and CommonMarc.Do you think that no
README.md
-files exists in repos yet, and that people with patiently wait for #2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN) to be decided before committing any?If so, you're wrong. The Advanced help module ( 128547 installs) has for several years successfully rendered
README.md
-files that is packaged with a project (leveraging on the Markdown filter module ). TheseREADME.md
-files are not going to be rewritten if you ever manage to conclude on what syntax to "officially" adopt in #2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN).This project is not about new
README.md
-files that people are going to postpone writing until #2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN) has decided on a "policy". It is about making the thousands ofREADME.md
-files that has already been written usable on the Drupal.org project page.The fact that #2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN) seems completely oblivious to this huge installed base of MarkDown on Drupal.org is to me clear indicator that this project is poorly aligned with the community and whatever "policy" that project end up with choosing will not be enforceable.
However, I am not going to enter into a status war here by setting status back to RTBC, but for the record: I think your actions here are disruptive and are based upon poor judgement.
Comment #46
swirtI see nothing in the proposed implementation that should be contingent upon one markdown flavor or another. Please set this back to RTC.
Comment #47
XanoThe issue summary is pretty much non-existent (there is a first/opening post, but not really a summary). We shouldn't RTBC before the summary at least reflects the current state of the issue.
The branch specifity issues raised in #14 and addressed in #22 may pose UX issues and I did not see anyone comment on those yet. The setting this patch introduces handles the branch issue from a maintainer's point of view, but does not do anything to clear up potential confusion on the visitor's side. I recommend we request for at least one UX review before going ahead with this.
Some documentation feedback:
@param array
is not explicit about the array contents. This should be@param array[]
, because the values are arrays themselves too.Please write full sentences: Keys are field names and values are field definitions.
This is not a correct English sentence. It should be something like When any of the fields cannot be created.
$data
should be$field_definition
to be self-descriptive and to match the documentation.The one-line summary must be written in the third person singular tense.
@param array
is not explicit enough, as explained before.One-line summary must be written in the third person singular tense.
The type is not explicit enough.
Comment #48
anavarreJust want to note that while we're still debating, people have started rendering Markdown in
README.md
files already: http://cgit.drupalcode.org/purge/tree/README.md?h=8.x-3.xComment #49
gisle@anavarre: People have been putting MarkDown in
README.md
for years - see comment #45 above.The driving force behind this issue project to make this installed base of README.md usable on project pages.
Comment #50
mglamanAs a maintainer in the Drupal Commerce ecosystem, this would be super helpful. We have to maintain a README in code and a project page. I don't care what we use to parse the Markdown, because any library should be OK. I've never had issues, except for when using some GitHub flavored Markdown-isms.
Also, the community could then contribute to a project's page and not rely on maintainer to manually make the edits.
Comment #51
attiks CreditAttribution: attiks at Attiks commentedIS updated, feel free to edit if I missed something
Comment #52
attiks CreditAttribution: attiks at Attiks commentedMy 2 cents: I would probably keep the readme.md up to date, I think most of my projects have a very outdated project page, mainly because it is disconnected from the normal workflow.
For custom module for clients we used gitlab, and it least the readme contains useful info.
This should not be postponed on the markdown issue, we have a markdown filter that we can use, if needed we can always switch later.
Back to NW so the issue of linking can be addressed.
Comment #53
geerlingguy CreditAttribution: geerlingguy as a volunteer commentedAgreed on not postponing this issue on the CommonMark discussion. I have written at least five or ten million words in Markdown, and 99.9% of what I've written would work exactly the same between the existing Markdown module and CommonMark. Plus, it's already in use in many places around the *.drupal.org ecosystem, and on thousands of Drupal sites.
All the main bits (bold, italic, headings, links, basic images, etc.) work exactly the same, and for almost all the more exotic formatting, I use HTML because no matter what markdown flavor you use, one library or another chokes on a code sample inside a list inside a table inside a table, or something to that effect. This is true even with CommonMark.
Comment #54
BR0kEN@Xano, I'm ready to fix all meta information, but after first commit (as additional patch). We definitely need to start from implementation and then fix issues.
If you, or anyone, have some blocking notes, related to the code architecture, please tell us about them.
Thanks to all, who want to make this possible ASAP.
Comment #55
XanoI am not sure what you mean exactly, but if you are referring to the documentation issues I raised, then then will need to be fixed before this can be committed. It's just as much a part of our QA process as security and performance are.
Comment #56
BR0kENI've moved
drupalorg_markdownizer
as submodule for https://www.drupal.org/project/drupalorg project. Now, to apply a patch, we need to be at thesites/all/modules/drupalorg
directory.@Xano, I've tried to take into account your comments, please, when you'll have a free time, review this one.
Comment #57
BR0kENAlso, all of you know that I've used a Markdownizer module to implement this task. It was created by me earlier than a similar one by @markcarver. All that it does - provide a Drupal layer for Parsedown library. I've chosen the Parsedown because, at that moment, it had more stars on GitHub than any other library.
To make sure that markdown syntax will be parsed correctly, I've created a SimpleTest which could be easily extended.
When come a time when someone propose better library then it could be changed in a moment.
Comment #58
BR0kENGuys, we need to move on!!!
Comment #59
XanoWe're not all guys ;-)
Can you please provide an interdiff so we can more quickly review the changes that have been made since the previous patch?
Comment #60
BR0kENI know that you'll ask me about it. Unfortunately, I cannot provide an interdiff because made a mistake previously. Initially I've created a module wrongly: initialized a new repo on d.org dev instance, create first commit to have a log, wrote custom code and create a patch. Now, I've moved "custom code" to the https://www.drupal.org/project/drupalorg prject and, from now, we will be able to have the interdiffs.
Comment #61
BR0kENOn September 6 I'll have a birthday. Maybe somebody apply a patch, test the functionality and implement it as a gift for me?
Seriously, how I can help to move this feature on?
Comment #62
BR0kENComment #63
BR0kENComment #64
BR0kENComment #65
BR0kENComment #66
sylus CreditAttribution: sylus commentedTagging this as d7dx (DX?) as definitely effects developer experience.
We should be trying to minimize frustrations such as these as a lot of developers maintain mirrors on github.
Love to help with whatever I can to get this moving :)
Comment #67
sylus CreditAttribution: sylus commentedComment #68
BR0kENSeptember is coming...
Comment #69
drummUnfortunately, we recently lost our dev server. I set up a fresh site with minimal configuration, but stopped when I saw the issues below. If you are still interested in helping, please let me know and I'll re-add your SSH account. Sorry for the inconvenience and delay in reviewing this.
Executing shell commands on project node view is at best slow. And shell commands should never be added for general security; we also block those off with Suhosin whenever possible. (The Git servers can run different PHP configuration as needed.)
hook_drupalorg_package_release()
was recently added to the packaging process, http://cgit.drupalcode.org/drupalorg/tree/drupalorg_project/plugins/rele.... That’s a good time to look for README.* files and put their contents into a field.Comment #70
BR0kEN@drumm, I definitely want continue!
Comment #71
drummPlease try out
ssh BR0kEN@devwww.drupalsystems.org
. The host has changed, it should now resolve to 140.211.169.87.I forgot to mention the web nodes don’t have any access to the Git repositories on disk too. When packaging and other things needing the files happen, that’s generally a fresh checkout.
To trigger packaging, run
drush release-package {tag|branch} {project name}
, likedrush release-package tag openatrium
. To force it to run again, remove the packaged tarball fromhtdocs/files/projects/…
to make it think packaging hasn’t happened. Currently in production, packaging is queued up in and run at 5 minute intervals; longer packaging tasks, likedrush make
for distributions can clog the queue, but usually for not more than 30 minutes.There is also
hook_versioncontrol_code_arrival()
which happens on Git servers quickly after code is pushed.Comment #72
markhalliwellDespite the current patches using @BR0kEN's https://www.drupal.org/project/markdownizer, I think both @gisle and I feel very strongly that the Drupal ecosystem (including d.o) would benefit greatly from an existing and familiar project/namespace (my https://www.drupal.org/project/commonmark module was really only ever developed as a POC anyway).
So, as of now, @gisle and I are both maintainers of https://www.drupal.org/project/markdown and will be merging https://www.drupal.org/project/commonmark into it.
I'm also postponing this issue on #2952616: Adopt CommonMark spec for Markdown files since this is ultimately the first step for harmonizing all markdown in the community.
Comment #73
markhalliwellAlso semi-postponed on #2949200: Add drupalorg_versioncontrol_repo_changes hook and #2952435: Merge in the CommonMark project
Comment #74
MixologicTangentially related, but I thought folks here would be interested: krakjoe, one of the php maintainers, has been working on a commonmark php extension:
http://docs.php.net/cmark
https://github.com/krakjoe/cmark
Not really something drupal.org can use because we cant php7 yet, but worth noting.
Comment #75
markhalliwellYes, I've seen that and have re-opened #2180993: Add support for PECL cmark extension.
I also opened https://github.com/thephpleague/commonmark/issues/315 and commented on https://github.com/krakjoe/cmark/issues/1.
Whatever/however the PHP community standardizes on a PHP extension for CommonMark, I'll be ready.
Comment #76
markhalliwellFWIW, https://pecl.php.net/package/cmark has been created and I have added it to https://markdown.unicorn.fail/benchmarks
It is, indeed, much faster but lacks any sort of extensibility, see https://github.com/thephpleague/commonmark/issues/315#issuecomment-37779... and https://github.com/commonmark/cmark/pull/123
Of course, this would all be dependent on when d.o can php7 :D
Regardless,
thephpleague/commonmark
is still a viable option for php 5.6.5+ and we'd likely want to use it for extensibilty reasons anyway (at least until the native cmark can as well).Comment #77
colanNot sure where this issue is at, but if it's helpful at all, I've been piping my module READMEs through https://matteobrusa.github.io/md-styler/. For example, at Site Quota Enforcer, click on the External documentation link, and you'll see how it gets rendered.
Comment #78
xjmComment #79
idiaz.ronceroI thought about this today when I had to manually edit the description of a module to just re-create what was already written in markdown but in HTML.
It really feels outdated and backwards. Anything, from Github/Gitlab to almost every modern tool is able to read and parse a README.md file to create a welcoming page for projects.
Also, this encourages developers to create a single point for basic documentation and info instead of having several, often outdated and/or conflicting sources.
Surprised to see that this post is 11 years old...
For what is worth, +1 to having this. I guess tooling has evolved during these 11 years and standards on markdown have settled, so I think this could be re-considered.
Unrelated to drupal.org, but I would also happily extend this and make the hook_help() also read from the markdown file. I don't get what's the use of having three different sources of info (the README.md, the hook_help, the project description) that usually need to tell the same information: what's the project, how to use, how to install, requirements.
Comment #80
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedUI-wise, we could have a button that tries to fetch the contents and overwrites whatever is in the description (transforming markdown to html), all ajax driven.
That way we make it a one-off fetch operation and give the user the possibility to refresh when editing and we would not need an additional field on projects or do constant external requests.
Suggestion:
Comment #81
idiaz.ronceroYep, @flgarlin proposal could be a good solution and probably easier to get done.
I still think on the long run Drupal modules should move towards a single source for module documentation (and that single source should be fetched from elsewhere: drupal.org, hook_help, etc), but that's another discussion.
Comment #82
idiaz.ronceroComment #83
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedI'll work on it.
Comment #84
dwwYay, excited to see this moving forward!
In general, I'm all in favor of a single, canonical copy of something, instead of duplicate, out of sync versions. However, for something like a README.md file, the requirements, instructions, functionality, etc, might change across different branches. So long as it's a
README.md
file in Git, it all works great, and you can easily maintain the differences as needs change. But for a d.o (or any other) project page, you might need different information that's true across all branches.The solution @fjgarlin came up with of an AJAX-driven import where you select a specific branch seems like a great compromise. If a project is simple, and everything can be said exactly once, yay. If it's complicated and needs different instructions in different branches, it can either not use this feature at all, or start with an import, then customize the results to be more general...
Sounds like this is no longer postponed, so removing the "[PP-3]" from the title.
Thanks again,
-Derek
Comment #86
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedThis is ready to review.
See code changes here: https://git.drupalcode.org/project/drupalorg/-/merge_requests/157
Here is a demo to see how it looks and how it works: https://www.drupal.org/files/issues/2023-02-21/Screen%20Recording%202023...
Happy to address any feedback.
Comment #87
geek-merlinFeedback: As i read #80, this is about a button to copy a readme of some arbitrary branch to the description.
Sorry, but i can not see that this addresses the need addressed in the issue.
As a module maintainer i want to
- be "DRY" and not maintain a text in different locations, and most important, toolsets.
- to update stay in my toolset of code editor and git.
Stated differently, if i'm updating a module, i have it open in my IDE anyway. If i have to open drupal.org, copying the text from my IDE is simpler that hitting a button, and in the end i know it's the correct version.
As i understand this issue:
As a module maintainer, i want to update the project page by pushing updated file(s).
Comment #88
DamienMcKennaAgreed with #87.
Given that gitlab supports this out of the box, and that d.o is moving to use gitlab for project management, should this be closed as a "won't fix"?
Comment #89
geek-merlin(I did not read the whole discussion, just the IS, but) What about this:
As a module maintainer, i can put [tokens] into the description text that embed a project file (spcedified in the token from a branch specified in the token) as rendered HTML.
We can bikeshed about the details, but tha would address my need as multi-maintainer. E.g. if i want, i can add readme files of different branches, and wrap them in details tags.
That would work for me.
Comment #90
geek-merlin#88:
> and that d.o is moving to use gitlab for project management, should this be closed as a "won't fix"?
This depends if gitlab will be the main project frontend.
(Btw, there is an analogous issue for the description text of gitlab projects, the text that is displayed in project lists.)
Comment #91
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedEven tho many things are moving to gitlab (issues, CI...), there are many other parts of d.o projects that won't. Project pages will stay in d.o in the foreseable future as far as I know.
As discussed in earlier comments, not everybody might actually want to pull the info from readme files into the description (for different reasons), so this additional feature just gives them the possibility of a "quick" copy/paste into the body field.
My only concern with the tokens would be the performance as we'd need to make external requests to bring that in when displaying the project.
Comment #92
hansfn CreditAttribution: hansfn commented#89 could be good for me - or just links to the rendered readme at Gitlab.
However, to me the real problem is that the project pages often contain too much information. As already mentioned, we have doc guides and readmes for projects. The project page shouldn't repeat this (unless it's automatically maintained for example with tokens as suggest above in #89).
One idea: We already select a default branch. Used that information to select readme that is automatically added to the project page.
Comment #93
geek-merlin> My only concern with the tokens would be the performance as we'd need to make external requests to bring that in when displaying the project.
Page cache and/or caching in the token provider should be relatively simple. Invalidating on every commit also, as we have the build logic on commit anyway (and maybe we have cache tags by then ;-).
Comment #94
dww@fjgarlin: Amazing, thanks! Fantastic progress. 🎉
@everyone who thinks this is totally insufficient and wants something else: Please remember that d.o can be a slow moving site, change can be hard, and when someone makes a solution that helps (but doesn't totally solve) your use case, and still supports other people's use cases, I recommend leading with gratitude and appreciation, not complaints that it's not good enough. 😉
If comparing this to Gitlab, keep in mind that the UI works there since the "project home page" is itself a Git filesystem browser, including a branch filter with a pre-selected value, and a list of files/directories in the root of the repo. Not everyone browsing / using the project page necessarily wants/needs to interact with it as a Git repo, wants to see the codebase of that project (if any), or even understands branches and how to pick one. Yes, we can specify a default branch in the d.o project, so we could use that, but not every project page can always === the contents of the README.md on the default branch. Some projects have no code, and potentially no Git repo at all.
If we're going to automagically slurp in the README.md from the default branch on every commit to that branch or something, and cache that in the d.o DB, I'd vote we stick that into a separate field from the project body, and give maintainers the choice to show either the README, body, or both (but not neither 😅).
And, I think this is already great progress, could probably be committed and deployed ASAP, and we can open follow-ups to explore further improvements / changes. I just haven't looked at any of the code, so I can't RTBC this.
Thanks again,
-Derek
Comment #95
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedThanks for the feedback. I'll try to work on those things soon.
Comment #96
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedAddressed some of the feedback and followed up with some questions on some of the comments.
Comment #97
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedThe latest round of feedback has been addressed.
Adding a quick demo video to see how messages display, showing that the escaping is correct, etc: [video]
Comment #98
idiaz.ronceroLooks fantastic, many thanks!
Comment #99
ressa CreditAttribution: ressa at Ardea commentedGreat work @fjgarlin, it's nice to see this feature getting very close to being a reality.
Comment #102
drummThis has been merged & deployed!
Comment #104
hansfn CreditAttribution: hansfn commented