Problem/Motivation

Currently content first works perfectly

Technically, all the content first code is generated in a route controller. Moving the generation logic to a Drupal service allows to be used by other modules , plus adding more funcionality besides Drupal Routes.

The motivation to provide this functionality is being able to provide a token that renders content first markdown, to be used by n8n/AI.

Proposed resolution

Move all logic that generates the HTML and markdown to a service named content_first.build.
This service will return a class named RenderedCOntent that will have methods to get HTML, Xpath, and markdown.

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

omarlopesino created an issue. See original summary.

omarlopesino’s picture

Status: Active » Needs review

I have finished the refactor. I have checked it with a site using content first and the generated content appears equal, without regressions. I have checked: HTML, markdown, copy and download. This is ready to review.

omarlopesino’s picture

Status: Needs review » Fixed

Merged! It will be released at beta 6

Status: Fixed » Closed (fixed)

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