Problem/Motivation
#3041924: [META] Convert hook_help() module overview text to topics for the basic_auth, hal, jsonapi, rdf, rest, and serialization modules.
NOTE: What is below is the generic instructions for converting hook_help to topics. We want to end up with task-based topics; in this case, there really aren't "tasks" per se for these modules. So let's just make one topic called something like "Enabling web services on your site" with a filename starting with "core." (so it is not in one module's namespace), and describe what web services are, and what each of these 5 web services modules does.
Proposed resolution
Take the information that is currently in the hook_help module overview section for the module(s), and make sure the information is in one or more Twig help topic files. Steps:
- Find the hook_help() implementation function in the core/modules/MODULENAME/MODULENAME.module file(s). For example, for the core RDF module, the module files is core/modules/rdf/rdf.module, and the function is called rdf_help().
- Locate the module overview portion of this function. This is located just after some lines that look something like this:
switch ($route_name) { case 'help.page.contact':And ends either at the end of the function, or where you find another
case 'something':line. - We want to end up with one or more topics about the tasks that you can do with this module, and possibly a section header topic. So, read the help and figure out a good way to logically divide it up into tasks and sections. See Standards for Help Topics for information on how to do this.
- See if some of these tasks are already documented in existing topics. Currently, all topics are in
core/modules/help_topics/help_topics. Note that to see existing topics, you will need to enable the experimental Help Topics module (available in the latest dev versions of Drupal 8.x). - For each task or section topic that needs to be written, make a new Twig topic file (see Standards for Help Topics) in
core/modules/help_topics/help_topics. You will need to choose the appropriate module prefix for the file name -- the module that is required for the functionality. Alternatively, if the information spans several modules or if the information should be visible before the module is installed, you can use the "core" file name prefix. For instance, it might be useful to know that to get a certain functionality, you need to turn on a certain module (so that would be in the core prefix), but then the details of how to use it should only be visible once that module is turned on (so that would be in the module prefix). - File names must be MODULENAME.TOPICNAME.html.twig -- for example, in the RDF module, you could create a topic about managing actions with filename rdf.overview.html.twig (and "MODULENAME" can be "core" as discussed above).
- Make a patch file that adds/updates the Twig templates. The patch should not remove the text from the hook_help() implementation (that will be done separately).
Remaining tasks
a) Make a patch (see Proposed Resolution section).
b) Review the patch:
- Apply the patch.
- Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
- Visit the page for each topic that is created or modified in this patch. The topics are files in the patch ending in .html.twig. If you find a file, such as core/modules/help_topics/help_topics/rdf.overview.html.twig, you can view the topic at the URL
admin/help/topic/rdf.overviewwithin your site. - Review the topic text that you can see on the page, making sure of the following aspects:
- The text is written in clear, simple, straightforward language
- No grammar/punctuation errors
- Valid HTML -- you can use http://validator.w3.org/ to check
- Links within the text work
- Instructions for tasks work
- Adheres to Standards for Help Topics [for some aspects, you will need to look at the Twig file rather than the topic page].
- Read the old "module overview" topic(s) for the module(s), at
admin/help/MODULENAME. Verify that all the tasks described in these overview pages are covered in the topics you reviewed.
User interface changes
Help topics will be added to cover tasks currently covered in modules' hook_help() implementations.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #69 | interdiff.txt | 1.93 KB | batigolix |
| #69 | 3047703-69.patch | 4.39 KB | batigolix |
| #68 | interdiff.txt | 6.49 KB | jhodgdon |
| #68 | 3047703-68.patch | 4.35 KB | jhodgdon |
Comments
Comment #2
petedussin commentedCreated patch at Drupalcon 2019! Copied content from hook_help
Comment #3
Andy Farmer commentedHi @DrupalCon19 and I am going to review this patch now
Comment #4
petedussin commentedUpdated to fix typo.
Comment #5
petedussin commentedChanged opening line of text so "the" not updated.
Comment #6
aburrows commentedReviewing and testing with my mentoree @Andy Farmer
Comment #7
petedussin commentedReplacing older patches that accidentally committed changes from parent issue patch
Comment #8
benjifisherThanks to
Comment #9
eojthebraveWe're going to need a better way to deal with the link to the Rest modules help page. The issue right now is that the link isn't going to work if the Rest module isn't enabled. The link will render appropriately, but when you click it you'll get a 404. This is handled in the current hook_help implementation by using the module service to check if the Rest module is enabled before linking to it.
(\Drupal::moduleHandler()->moduleExists('rest')) ? \Drupal::url('help.page', ['name' => 'rest']) : '#'])There's not really a Twig friendly way of doing this. It's mentioned in this issue https://www.drupal.org/project/drupal/issues/3027054#comment-12934232 but without a method to resolve it yet.
Comment #10
petedussin commentedRemoved escape for apostrophe. Works without it.
Comment #11
jhodgdonWe need to postpone this until the #2920309: Add experimental module for Help Topics gets committed. No idea when/if that might happen right now...
Comment #12
jhodgdonThat issue was committed, so we can un-postpone this now!
Comment #13
jhodgdonWe're adding some more modules to this issue. So, it needs more in the patch. I haven't reviewed the existing patch yet. None of the other modules were started yet.
Comment #14
jhodgdonRegarding linking to the module help pages, the answer is don't do it! Those links were for when we had module overview help pages, and we will not have them any more. So if you mention another module, just say something like
the core Node module
and don't make it a link.
Comment #15
jhodgdonUpdated issue summary with better instructions/guidelines
Comment #16
jhodgdonAnd one more iteration on the guidelines.
Comment #17
jhodgdonWe've migrated the help topic standards to https://www.drupal.org/docs/develop/documenting-your-project/help-topic-... so updating issue summary again.
Comment #18
gaurav.kapoor commentedComment #19
gaurav.kapoor commentedI have added overviews for newly added modules in this issue. Please review and add feedbacks. Thanks!. Not adding an interdiff as the difference in the patches is only addition of overview for new modules. I haven't changed anything in basic auth overview.
Comment #20
gaurav.kapoor commentedComment #21
jhodgdonThanks for the patch... But please read the instructions in the issue summary. We do not want module overview topics at all. What we want is task-oriented topics.
Comment #22
volkswagenchickTagging for badcamp2019, thanks! (October 2-5)
Comment #24
jhodgdonWe just found out that all topic Twig files currently need to go into core/modules/help_topics/help_topics (with their finalized module-based file names), for the time being until the Help Topics module is stable. Updating issue summary. Patch will need to be updated too.
Comment #25
mradcliffeTagging for DrupalCon Amsterdam 2019
Comment #26
mradcliffeI am going to help mentor a table at Amsterdam 2019 to work on moving this issue forward.
Comment #27
havran commentedHi, my name is Juraj Chlebec and i would like work on patch to this issue :)
Comment #28
pminfI'm taking screenshots of the patch results to check if the solution is working.
Comment #29
vitor faria commentedI'm Vitor and I am at the DrupalCon Amsterdam 2019 and I am going to write a patch for this issue
Comment #30
christian.gerdes commentedHi, I'm Christian, I'm @ DrupalCon2019 in Amsterdam and I'm trying to Review the issue.
Comment #31
ChrisBee commentedHi i'm Christopher Braun and i will apply and test the patch.
Comment #32
joycelam commentedHi I'm Joyce and I'll be helping testing/reviewing the patch.
Comment #33
mradcliffe@vladigor is also participating and pairing with Vitor here at Amsterdam2019. They do not have a laptop.
Comment #34
havran commentedI create patch which move files to core/modules/help_topics/help_topics and fix metadata.
Comment #35
havran commentedComment #36
vitor faria commentedInterdiff of previous patch with current patch
Comment #37
ChrisBee commentedChecked Path and Interdiff.
Topic Twig files where created for modules basic_auth, hal, jsonapi, rdf, rest, serialization in core/modules/help_topics/help_topics.
Great work!
Comment #38
ChrisBee commentedThere is an error in the Topic Twig for rdf. Label is "basic Auth" but should be RDF.
Comment #39
christian.gerdes commentedDuring Review of #34 I expected the following Issues:
HTTP Basic-Auth Help Page Shows RDF Help Page Content if Basic Auth isn't enabled:
If you click on Help in the Menu Bar and after that on "HTTP Basic Auth", it points you to "/admin/help/topic/rdf.overview".
Probably this is caused by a wrong label in rdf.overview.html.twig
Comment #40
joycelam commentedHi, thanks for the patch.
In the admin/help, the link to 'HTTP Basic Authentication' is displayed twice. See also screenshot.
One link goes to the HTTP Basic Authentication(admin/help/topic/basic_auth.overview), the other link goes to the RDF(/admin/help/topic/rdf.overview).
Comment #41
joycelam commentedComment #42
vitor faria commentedFix for some minor issues in patch #34 also made by Havran
Removed meta tags to be consistent with other help topics from HAL topic and also removed a "." typo.
Changed label for RDF help topic as well.
Also uploaded interdiff from previous patch
Comment #43
joycelam commentedThanks for the new patch! The label was changed and we can now see the difference between HTTP Basic Auth and RDF. Everything worked as we expected.
Comment #44
joycelam commentedComment #45
joycelam commentedI updated the summary a little bit to be coherent with the modules we are using.
Comment #46
OanaIlea commentedThe previous patch had no functionality issues but a typo in 'JSON:API'. #42
Comment #47
_m commentedI am reviewing #46 at Amsterdam2019
Comment #48
_m commentedConfirmed that the spelling correction is present. Still RTBC.
Comment #49
mradcliffeThank you for all the thorough screenshots, reviews and patches. The contributors here found a couple of bugs in the initial patch, and fixed them. The patch in #46 will create the help topic files within the help topic module instead of their respective core modules.
Good job, everyone working on the issue today at DrupalCon Amsterdam 2019: oanailea, joyceCY, ChrisBee, christian.gerdes, Vitor Faria, havran, vladigor, and _m.
Comment #50
_m commentedComment #51
jhodgdonThanks for the patches and reviews!
However, I don't think we want all these top-level topics for these somewhat esoteric subjects. We want to keep the main Help page fairly short, so people can find topics of interest quickly. So... This information is all background (no tasks)... Can we make just one top-level topic with the title of "Overview of web services" or something like that (not sure if that is the right overview topic name), and maybe just put all of this information in that one topic?
Another problem:
We definitely do *not* want to be linking to the old hook_help pages for these modules. We are going to be getting rid of the hook_help pages. Instead, use the "related" meta-data field at the top to make links between related Help Topics.
Comment #52
mradcliffeI think @jhodgdon has a good idea here.
I added the Needs issue summary update to follow-up to make sure that the issue summary contains the new proposed resolution.
Comment #53
jhodgdonOK, updated the issue summary. We have a standard issue summary, from Proposed Resolution on down, for these "convert" issues, which I think covers the idea that we *don't* want module overview topics. And we update it from time to time, via copy/paste, so I don't want to make changes to the Proposed Resolution step. So what I did was add a note to the top problem/motivation section instead. In bold type. :)
Comment #54
pratik_kambleComment #55
pratik_kambleCreated patch to have all the web services related at one place.
Comment #56
pratik_kambleComment #57
jhodgdonThis is looking pretty good, thanks for the patch! A few things to look at:
a) "Web service provides an interface, to be utilized by another Web server or by a mobile app." ... This sentence needs some grammar attention... Maybe just needs to start with "A" or "The"? I am not sure.
b) HTML nitpick: the headings changed from H3 to H2 after the first one. They should all be H3 I thin.
c) A few of the headings don't start with "What is" or "What are". They should.
d) It bothered me that in a section like "What is JSON:API" the answer started out with "the xyz module provides". I think we should start by explaining what JSON:API is, and then after answering the question in the heading, point out that the module is available to implement it. This applies to multiple sections. I think the information is there -- just the order bothered me (leading off with the module instead of answering the question). I think that must have been copy/pasted from the module overview hook_help topics, which are trying to answer the question about what a specific module does, but we are moving away from module-oriented help here, towards concept-oriented and task-oriented help (i.e., oriented towards what people want to do with their web site, and the concepts they need to understand to do it).
e) The "for more information" links... only include if they are actually useful and contain information not in this topic. Also they're generally supposed to be at the end in their own section.
f) The DL list under the RESTful web services section doesn't have any context introducing it, so it doesn't really seem to make sense. If it is giving steps, maybe it should be in its own topic, like "Setting up RESTful web services"?
Comment #58
pratik_kambleComment #59
jhodgdonI'm working on a new patch for this now.
Comment #60
jhodgdonHere's a new patch... interdiff is not useful because pretty much every line in the topic changed. I updated the structure, simplified down to the essential information, and reorganized.
Comment #61
pratik_kamble@jhodgdon Patch LGTM. The patch provides all basic information about web services and Modules that can be used to enable web services with Drupal.
Comment #62
jhodgdonThanks for reviewing!
Comment #64
jhodgdonUnrelated test fail:
Drupal\Tests\jsonapi\Functional\EntityFormModeTest::testRelated
Drupal\Core\Database\SchemaObjectExistsException: Table sequences already exists.
Comment #66
catchThe long explanation of what a web service is feels like it should ideally be a footnote rather than a standfirst. I was expecting something more like 'Web services allows your Drupal site to expose data to other websites and services in various formats'.
HAL is mentioned in this introduction, but the HAL module isn't mentioned in the list of modules below?
The description for REST is a bit tautological, mentioning which formats are available (like HAL) might help with that though.
Comment #67
pratik_kambleComment #68
jhodgdonThanks for taking a look! Here's a new patch that tightens up and simplifies much of the text. I also moved all of the information about modules to the modules list, since (based on the previous review) the information about the HAL module wasn't easy to find in the previous version, even though it was mentioned.
Comment #69
batigolixI reviewed the patch, and found 1 more thing I would change to make it easier to read. See the interdiff.
Besides that I think this is ready to be RTBTC'ed.
Comment #70
jhodgdonYour change in #69 looks fine, and I tested the patch in #69 and it displays fine. So, I hereby RTBC your changes. Since you indicated in #69 that aside from the small change you made you think the patch is RTBC, I will go ahead and mark it RTBC. Thanks!
Comment #72
catchThanks for the changes in #68 and #69, that's a lot easier to read.
Committed 4a8ea54 and pushed to 9.1.x. Thanks!
Comment #74
gaurav.kapoor commented