radiate-framework / framework

A WordPress plugin and theme framework
https://radiate-framework.github.io/
MIT License
4 stars 0 forks source link

Add markdown to `View` #139

Closed BenRutlandWeb closed 3 years ago

BenRutlandWeb commented 3 years ago

Is your feature request related to a problem? Please describe. Whilst I can write mails in markdown, the file has to be either .php or .html files

Describe the solution you'd like Add md to the list of file extensions so markdown files can be used as views. This will aid with syntax highlighting.

Describe alternatives you've considered Using html or php files feels kinda awful.

BenRutlandWeb commented 3 years ago

Add "engines" or sub-classes to the view component to be able to do something like this:

view()->make('default-php-engine');
view()->markdown('this.is.markdown');
view()->file('path-to-some.css');
BenRutlandWeb commented 3 years ago

The view component has been rewritten to use engines so there is now a MarkdownEngine and MarkdownPhpEngine that will automatically run based on the file extension (md and md.php respectively).