Closed (fixed)
Project:
Project Wiki
Version:
1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2024 at 13:08 UTC
Updated:
25 Nov 2024 at 11:44 UTC
Jump to comment: Most recent
We recently got a few issues regarding the usability of this module, let's make the steps a bit clearer.
/**
* Implements hook_help().
*/
function my_module_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.my_module':
$text = file_get_contents(__DIR__ . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
return '<pre>' . Html::escape($text) . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
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 #2
grevil commentedComment #3
grevil commentedComment #4
grevil commentedJust found this on the module page:
Please remove the "Please Note" part and instead make a comment for "ListJs" on how to require the list.js library via composer.
Comment #5
lrwebks commentedComment #7
lrwebks commentedEverything's done now, including a quick overhaul of the module page and READMEs. @Grevil for the review? Don't forget to also review my changes on the module page!
Comment #8
grevil commentedAdded a few comments.
Comment #9
lrwebks commentedComment #10
anybodyComment #11
anybodyComment #12
lrwebks commentedComment #13
anybody@lrwebks see comments
Comment #14
lrwebks commentedSuccess! Found a helpful snippet in the help hook of the
Blockmodule:And that actually works. Apparently the routes from the help module are generated dynamically like:
/admin/help/{name}and if we return the name of our module as parameter, it results in the route that we want!I (at least) am happy to have learned something new about the Drupal structure today! To review!
Comment #15
anybodyReally nice!! Thank you, let's merge this!
Comment #17
anybody