I am using Drupal 8 on Pantheon.
This is a website for an ebook. The ebook HTML was generated using a Perl script that automatically replaces text like this:
- APPLE -> HTML including an apple image
- ORANGE -> HTML including an orange image
The list of these replacements is kept in a plain text file (there are about 200 replacements), and then there is a relatively short Perl script that does the actual replacing (for the ebook).
Now, I want to use these replacements in my Drupal site.
Following this lullabot tutorial, I created a custom input filter in a custom module.
But now I am wondering about how I should proceed.
In the future, the replacements for the ebook will be changed every month, so I need to make sure that it isn't too painful to keep the ebook replacements and Drupal replacements in sync (ideally, I would use the same files).
So,
- Should I try to find a way to call the Perl script from within Drupal, and share the exact same code between Drupal and the ebook?
- Or should I rewrite the Perl script in PHP and incorporate it into the custom input filter?
- Or should I do something else entirely?