0

I am trying to run a PHP script to iterate the list of images to be used by the Galleria Javascript plugin. I need to run the script so that Galleria may use it.

Also, I want to run a PHP script to send an email to the specified email address, but the markdown file seems not to allow me to run one.

How can I run a PHP script inside a markdown file or is it impossible to run such script?

3
  • As far as I understand you, the answer is: NO, You can't Commented Sep 18, 2014 at 15:55
  • Could you explain in detail why you would want this feature? Wouldn't running JavaScript in markup suffice? (Such as the code snippet seen here on StackOverflow) Commented Sep 18, 2014 at 16:04
  • I want to utilize Galleria, and the plugin simply iterates an <img> tag inside its <div> tag. I need to iterate an <img> tag with a list of files inside a directory. Commented Sep 18, 2014 at 16:07

1 Answer 1

1

It seems to me like you're going about it the wrong way. Markdown is a syntax for readable text. PHP is a scripting language. You really aren't supposed to be able to 'run' anything in markdown; a markdown parser will turn markdown into HTML, not PHP, nor will it ever run the result.

If you're iterating in a browser, you'll want to do this entirely in JS. Do you have a page somewhere that someone could look at to make a suggestion?

Sign up to request clarification or add additional context in comments.

5 Comments

I am working it in my local computer. But the plugin, Galleria, that I am following is here: galleria.io/docs/getting_started/beginners_guide
So you want to take the resulting HTML of a markdown document, iterate over the images and load them into the plugin?
yup. exactly what I needed... but how?
Reading over your other comment, your question is rather different than what you asked. Also, it's a little crazy. You want to iterate over a list of system paths in an HTML document and then you want to inject those as img tags into (the/a new) rendered HTML. Correct so far? The you want to take that HTML and, client-side, use it in a galleria plug-in. This means that, as inputs, you have system-side markdown, and as output you want client-side web gallery. Right? If so, then you just want someone to build a little project for you. The answer would have to include a zip.
I believe it's not my objective to ask for someone to do the little project for me. But anyways, I am only testing the flat-file CMS concept, and instead of wasting effort, I've used Joomla over this flat-file CMS. Thank you for answering my question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.