Currently, the dependency should be put in the MODULE.info.yml file to automatically display module's README file on the admin/help/MODULE page. The readmehelp configuration form will allow to use it by any module even if it has no dependency.

TODO:

1. Create config form with the list of all enabled modules to assign for automatic displaying their README on the help page. By default, any module which don't implement hook_help() in the MODULE.module file should be checked. Example:

https://cgit.drupalcode.org/securitytxt/tree/securitytxt.info.yml#n6
https://cgit.drupalcode.org/securitytxt/tree/config/schema/securitytxt.s...
https://cgit.drupalcode.org/securitytxt/tree/config/install/securitytxt....
http://cgit.drupalcode.org/securitytxt/tree/src/Form/SecuritytxtConfigur...

2. Implement appropriate hooks in the readmehelp.module file, so when a module is uninstalled then clean up the config for the module. Or, check the readmehelp config for the module when it is installed (if hook_help() not implemented).

3. Make appropriate changes:

https://cgit.drupalcode.org/readmehelp/tree/src/Controller/ReadmeHelpCon...
https://cgit.drupalcode.org/readmehelp/tree/src/Plugin/HelpSection/Readm...
https://cgit.drupalcode.org/readmehelp/tree/README.md

4. Adjust tests for the changes:

https://cgit.drupalcode.org/readmehelp/tree/tests/modules/readmehelp_test

5. Implement an update hook in the readmehelp.install so all the modules having a readmehelp dependency in their .info.yml files should be checked in the readmehelp config settings.

6. Implement uninstall hook in the readmehelp.install so when the readmehelp is uninstalled then clean up all the saved configuration.

Issue fork readmehelp-2946807

Command icon 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

drugan created an issue. See original summary.

drugan’s picture

drugan’s picture

Issue summary: View changes
drugan’s picture

Issue summary: View changes
drugan’s picture

Issue summary: View changes
geek-merlin’s picture

Title: Allow using the readmehelp as an option for all the modules » Allow using the readmehelp for all the modules with no help.

Thanks a lot for this module!
Stumbled upon this when facing #3102438: Dependency on readmehelp:readmehelp not recognized.
I think having this configurable is way more complex than needed.

Why not simply say "Link to readmehlp IF the module does not have a hook_help OR does not return anything when asked for module help"?
I can roll a patch if this is considered.

geek-merlin’s picture

Title: Allow using the readmehelp for all the modules with no help. » Allow using the readmehelp for all modules with no module help.
drugan’s picture

Actually, it would be better to make it configurable. Me personally encounter a lot of cases when some complex module has poor help text on the hook_help() and at the same decent README file.

At the same time, all my modules have readmehelp dependency but a lot of people were reporting that they don't need help at all and therefore one more unused module.

I am open to any kind of solution to make the module optional for any of the modules disregarding of that whether they implemented hook_help() or not.

mvonfrie’s picture

An option to make this module optional for xnumber etc. is by suggesting it in composer.json. You just have to add:

"suggest": {
    "drupal/readmehelp": "Allows automatically to display module's README file on the admin/help/your_module page."
}

This way it will be easier to upgrade the modules to Drupal 10 as well, because the readmehelp module can be upgraded seperately.

drugan’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Category: Feature request » Task

  • drugan committed 42bc0f02 on 8.x-1.x
    Issue #2946807 by drugan: Allow using the readmehelp for all modules...

  • drugan committed 542844cb on 2.0.x
    Issue #2946807 by drugan: Allow using the readmehelp for all modules...
drugan’s picture

Status: Active » Fixed

Fixed both for the 2.0.x and 8.x-1.x versions.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.