Problem/Motivation

Being able to download content as zip can be useful for multiple purposes:

- Reviewing all the content of the site, out of browsing the site
- Analyzing texts with AI
- Generating content with AI using content first as part of the prompt.

Proposed resolution

Create a custom Drupal action to generate a ZIP. Study if there is no issues generating the zip as the final step.

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

The plan is developing it the next week and releasing it at beta7.

omarlopesino’s picture

beta8

kul.pratap’s picture

Assigned: Unassigned » kul.pratap

Working on it.

omarlopesino’s picture

Oh it was on my plans doing this but I haven't started yet, so contributions are welcome :)

If you are going to work on it, I expect that this feature works technically as follows:

- Do a Drupal Action Plugin to save the markdown generated by content_first.builder service into a temporary file.
- Allow this action to be enabled at /admin/content, so any content needing downloading can be selected.
- After doing the bulk operations, save all the files into a ZIP.
- Either display a Drupal message linking the generated file, or auto download it in the next page load.

This would be a "Drupal way" solution that would meet the requirement, otherwise it can become tricky I think.

kul.pratap’s picture

Yes, I am on it and doing it the same way as you mentioned.
@omarlopesino We want both HTML and Markdown, or just Markdown, in the downloaded ZIP.

omarlopesino’s picture

If it is easy, we could add a selector in the action plugin configuration form to choose between HTML or Markdown. My only concern is I don't remember if that configuration is global for all the selected elements, or is specific for each one. If it is global, go for it. Otherwise, only markdown.

kul.pratap’s picture

Assigned: kul.pratap » Unassigned
Status: Active » Needs review
StatusFileSize
new1.68 MB

@omarlopesino I have created an action that downloads a ZIP file. For now, I have only created action for markdown.

For reference, I am attaching a video on how it works.

Please review.

Thanks

sandeep_k’s picture

StatusFileSize
new386.54 KB
new331.19 KB

@kul.pratap I tried this MR !3 mergeable on Drupal version- 10.3.1-dev, the patch was applied successfully, but I am not getting that option to download the zip as shown in the video.
Also, while I was trying to access the node- Content first tab, it's throwing an error.
Please check and let me know if I have missed any steps here.

kul.pratap’s picture

@sandeep_k you have not installed the "league/html-to-markdown": "^5.1" this is a package which is require to run this module.
You can see in the composer.json
After that reinstall the module.

omarlopesino’s picture

Status: Needs review » Reviewed & tested by the community

It works perfect, thanks also for correcting most of styling errors reported by drupalci!

I've done some slight adjustments and I am merging it.

Thanks!

omarlopesino’s picture

Released at beta9

omarlopesino’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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