Hello All,
New to TextMate and love it so far.
I'm wondering if there is an existing bundle or method that will allow me to generate a new HTML document from a parsed PHP file? I'd like to be able to generate HTML files based on a local PHP file reading from an XML to generate pages quickly to post to a server that doesn't support server-side technology.
This also would be great for building HTML emails from a XML file in conjuction with the Email Tester bundle.
I would love to get any feedback or tips from the community on this.
Cheers, Michael R
2008/10/23 radarseven mr@radarseven.com
Hello All,
New to TextMate and love it so far.
I'm wondering if there is an existing bundle or method that will allow me to generate a new HTML document from a parsed PHP file? I'd like to be able to generate HTML files based on a local PHP file reading from an XML to generate pages quickly to post to a server that doesn't support server-side technology.
This also would be great for building HTML emails from a XML file in conjuction with the Email Tester bundle.
I would love to get any feedback or tips from the community on this.
Can't you just run php in a terminal session like
php infile.php > outfile.html
Most excellent, thanks Sven! Didn't know this functionality existed in a Terminal session! This is exactly what I needed.
Now I just need to figure out how to write a simle bundle to automate the process a bit, i.e. create a bundle that will output the current file to an HTML file with the same name and in the same directory. Any insight or resources that could point me in the right direction?
On Oct 23, 2008, at 3:55 PM, Sven Axelsson wrote:
2008/10/23 radarseven mr@radarseven.com
Hello All,
New to TextMate and love it so far.
I'm wondering if there is an existing bundle or method that will allow me to generate a new HTML document from a parsed PHP file? I'd like to be able to generate HTML files based on a local PHP file reading from an XML to generate pages quickly to post to a server that doesn't support server-side technology.
This also would be great for building HTML emails from a XML file in conjuction with the Email Tester bundle.
I would love to get any feedback or tips from the community on this.
Can't you just run php in a terminal session like
php infile.php > outfile.html
-- Sven Axelsson ++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
2008/10/23 Michael Reiner mr@radarseven.com
Most excellent, thanks Sven!Didn't know this functionality existed in a Terminal session! This is exactly what I needed.
Now I just need to figure out how to write a simle bundle to automate the process a bit, i.e. create a bundle that will output the current file to an HTML file with the same name and in the same directory. Any insight or resources that could point me in the right direction?
Try putting this in a text file:
php "$1" > `dirname "$1"`/`basename "$1" php`html
Save it under some convenient name, like do_convert call chmod +x do_convert to make it executable
and use it like:
do_convert some_file.php
that will save some_file.html in the same directory as the input file
Sven,
Thanks for your help... Can you clarify your solution just a bit? I'm a command line beginner and am just a bit confused on how to implement this. Where is the executable stored (Applications?) and then how do I call the command, I'm assuming from a Terminal window? Does the executable need to be in the same directory? I tried this but I was getting the command not found error in Terminal.
Thanks again for your help.
On Oct 23, 2008, at 5:36 PM, Sven Axelsson wrote:
2008/10/23 Michael Reiner mr@radarseven.com Most excellent, thanks Sven! Didn't know this functionality existed in a Terminal session! This is exactly what I needed.
Now I just need to figure out how to write a simle bundle to automate the process a bit, i.e. create a bundle that will output the current file to an HTML file with the same name and in the same directory. Any insight or resources that could point me in the right direction?
Try putting this in a text file:
php "$1" > `dirname "$1"`/`basename "$1" php`html
Save it under some convenient name, like do_convert call chmod +x do_convert to make it executable
and use it like:
do_convert some_file.php
that will save some_file.html in the same directory as the input file
-- Sven Axelsson ++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
2008/10/24 Michael Reiner mr@radarseven.com
Sven, Thanks for your help... Can you clarify your solution just a bit? I'm a command line beginner and am just a bit confused on how to implement this. Where is the executable stored (Applications?) and then how do I call the command, I'm assuming from a Terminal window? Does the executable need to be in the same directory? I tried this but I was getting the command not found error in Terminal.
Where you store the file depends on how you are going to use it. if the php files you want to convert are stored in different places, it might be best to have the script file somewhere in our path. If not, it is probably simpler to have the script file in the same directory as the files to convert. In that case you need to call the script like
./do_convert
if not, it will not be found as you have found out.
And finally - yes it is possible to run this from within Textmate. But the way you presented your problem it sounded (to me) like the Terminal window way would be more conveninent.
On 2008-Oct-23, at 4:34 PM, Michael Reiner wrote:
Now I just need to figure out how to write a simle bundle to automate the process a bit, i.e. create a bundle that will output the current file to an HTML file with the same name and in the same directory. Any insight or resources that could point me in the right direction?
When you create a Command in the Bundle Editor, you will have the option of specifying "Replace Document" for the output. That seems to be what you want.
The command itself probably doesn't need any input. Just make it something like
php "$TM_FILEPATH"
On Oct 24, 2008, at 9:08 AM, Rob McBroom wrote:
On 2008-Oct-23, at 4:34 PM, Michael Reiner wrote:
Now I just need to figure out how to write a simle bundle to automate the process a bit, i.e. create a bundle that will output the current file to an HTML file with the same name and in the same directory. Any insight or resources that could point me in the right direction?
When you create a Command in the Bundle Editor, you will have the option of specifying "Replace Document" for the output. That seems to be what you want.
The command itself probably doesn't need any input. Just make it something like
php "$TM_FILEPATH"
Thanks Rob, that's exactly what I needed. I wanted to generate a new document, so I selected that in the bundle editor.
P.S. Thanks for the tip about not top-posting replies...it makes perfect sense!
-- Rob McBroom http://www.skurfer.com/
Because it screws up the order in which people normally read text.
Original message:
Why is it bad to top-post your reply?
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate