Problem/Motivation

We recently got a few issues regarding the usability of this module, let's make the steps a bit clearer.

Steps to reproduce

  • Implement hook_help() in each module / submodule, here is a snippet:
/**
 * 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;
}
  • Adjust the message for when there are no project wiki entries. Currently it only says: "There are currently no entries in the Project Wiki." Add further information on how to get started with the module ( e.g.: "Install the 'project_wiki_entity_content' for creating wiki entries per UI, install the 'project_wiki_markdown_content_example', for a markdown example, etc.)
  • Make adjustments to the module page description (mainly, make sure to mention the submodules).
  • Supply screenshots

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

grevil created an issue. See original summary.

grevil’s picture

Issue summary: View changes
grevil’s picture

Issue summary: View changes
grevil’s picture

Just found this on the module page:

This module requires the following modules / libraries:

League Commonmark (Library)
ListJS (Module)
Please Note: You do not need to manually install these components as they will be installed automatically when installing Project Wiki.

Please remove the "Please Note" part and instead make a comment for "ListJs" on how to require the list.js library via composer.

lrwebks’s picture

Status: Active » Needs work

lrwebks’s picture

Status: Needs work » Needs review

Everything'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!

grevil’s picture

Status: Needs review » Needs work

Added a few comments.

lrwebks’s picture

Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Needs work
anybody’s picture

Priority: Normal » Minor
lrwebks’s picture

Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Needs work

@lrwebks see comments

lrwebks’s picture

Status: Needs work » Needs review

Success! Found a helpful snippet in the help hook of the Block module:

Url::fromRoute('help.page', ['name' => 'project_wiki'])->toString();

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!

anybody’s picture

Assigned: lrwebks » Unassigned
Status: Needs review » Reviewed & tested by the community

Really nice!! Thank you, let's merge this!

  • anybody committed 6d1c56f0 on 1.x authored by lrwebks
    Issue #3477778 by lrwebks, grevil, anybody: Supply better information on...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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