Let themes allow to provide markdown files

Created on 25 August 2023, about 2 years ago

Problem/Motivation

The project wiki currently only supports module's to provide markdown files. But there are also Drupal themes, which need documentation.
Unfortunately, this isn't easily done. We can not simply define a project wiki plugin in our theme. Our plugin manager won't crawl themes for plugins and the code, that limits this discovery to module's only, themes to be buried deep into Drupal core (correct me if I am wrong, but I couldn't find it and I went to the bottom of the 'AnnotatedClassDiscovery' and 'DefaultPluginManager' classes).

Steps to reproduce

Proposed resolution

We have two options here:

Option 1
Find a way, so that our 'ProjectWikiContentPluginManager' also crawls for plugin defintions inside themes (This might be impossible, as themes are probably not meant for this).

Option 2 (preferred)
Implement a theme alter hook, that gets called at the exact same position as our module alter hook (project_wiki_entity_content_value_objects, with which we currently can alter projectWikiValueObjects before they are given to our theme).
Then, we need to put most of our ProjectWikiMarkdownContentPluginBase logic inside a service, so we can call this new service inside the theme alter hook invocation, read, parse and prepare our markdown files. And return them to our Controller.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024