Download & Extend

Drush support, including adding help to an existing module

Project:Advanced Help Injection and Export
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:Debut enabler

Issue Summary

I'd like to be able to export the help texts using DRUSH. The command should give the path to the exported directory as a return value so that it can be chained into a larger script workflow that then moves the directory to a better place than in the files dir.

Comments

#1

Title:DRUSH support» Drush support, including adding help to an existing module

I'm looking to use helpinject in building a set of features, Debut. Rather than having each feature's help in a separate module, I need the help to be part of the feature. Two potential approaches would be:

* Add features support to helpinject
* Add Drush integration, including the ability to add help to an existing module

The first would probably need patches on Features - since what helpinject does doesn't fit easily into Features approach - and also probably need Drush in any case e.g. to copy over image files. So just doing this in Drush seems more feasible, and also has the advantage of applying to non-Features modules.

#2

Main barrier in adding helpinject to existing modules is that those modules may have need of hook_help() and/or hook_form_alter().

Proposed approach: introduce a new optional dependency, helpinjector. I opened #895554: Allow adding help to existing modules.

#3

Rough draft of a drush file, not yet working.

Requires the patch at #895554: Allow adding help to existing modules.

AttachmentSize
428624-3-helpinject-drush.patch 7.43 KB

#4

Tagging.

#5

Status:active» needs review

Changes matching those in #895554: Allow adding help to existing modules (which is still required). Rather than actually generating files in helpinject.module, fetch an array of file data (filename, directory, contents, etc.). This is similar to what's done in Features and then leave drush free to create or modify files as needed.

Patch includes the following help (run drush help helpinject to display):

Generate Advanced Help files and contextual icons based on data in books.

Examples:
drush helpinject example                  Add help from the book with the same
                                           human readable name to the example  
                                           module.                             
drush helpinject                          Generate a new help module from the 
--human_readable_name=Example             book with nid 21.                   
--package_name=Examples example 21                                            
drush helpinject                          Generate a new help module from the 
--human_readable_name=Example_two         book with nid 21, exporting French  
--package_name=Examples                   and Spanish Translations.           
--languages=fr,es example_two 22                                              

Arguments:
module                                    Machine name of the module to       
                                           generate help for. If a module by   
                                           this name is installed locally, help
                                           will be added to that module.       
                                           Otherwise, help will be generated as
                                           a new module.                       
book_ids                                  A space delimited list of one or    
                                           more book IDs to be used for help.  
                                           If no book_ids are given, if there  
                                           is a book with the same name as the 
                                           human-readable name of the          
                                           designated module, that book will be
                                           used. Otherwise, a list of available
                                           books will be returned.             

Options:
--module_readable_name                    The human readable name of a new    
                                           module that will be generated.      
--package_name                            The package name that groups modules
                                           on the admin/build/modules page.    
--languages                               Comma delimited list of languages to
                                           be exported.                        
--destination                             Directory that new module should be 
                                           written into.                       
--backup-dir                              Directory that existing .module and 
                                           .info files should be backed up     
                                           into.  
AttachmentSize
428624-5-helpinject-drush.patch 8.15 KB

#6

For anyone that is reading the issue looking for something a little simpler (that works with the module as it is), then the enclosed helpinject.drush.inc (as patch or txt file) should work for you. Thanks must go to Nedjo for the start on this, although most of his customisations have been removed.

I must also emphasise, I'm not trying to piss anyone off here (Nedjo), it's just the patch you provided didn't do what I was looking for.

AttachmentSize
helpinject-428624.patch 2.69 KB
helpinject.drush_.inc_.txt 2.34 KB

#7

@sdrycroft: If #895554: Allow adding help to existing modules doesn't go in, your patch would make sense. And if #895554 takes awhile to review, it might make sense meanwhile to apply your patch, since it works with the module as it is and answers the initial feature request.

#8

Status:needs review» active

The approach I sketched in would have added complexity without addressing underlying issues. I've abandoned it. See comments at #895554-11: Allow adding help to existing modules.

nobody click here