Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Make, for TXP plugins (compiler)
I was getting tired of having all my JS, CSS, help, and plugin code in one file, so I wrote make_txp. Clone it or click “Download” on that page to test it out. Let me know what you think.
A quick example (plugin.php):
if (0)
{
?>
# --- BEGIN PLUGIN HELP ---
//inc <README>
# --- END PLUGIN HELP ---
<?php
}
Run the following to include the contents of README
in a merged file:
$ php make.php plugin.php ../cache/merged.php
And to compile it to a text file:
$ php make.php plugin.php ../cache/merged.php ../releases/jmd_example-0.1.txt
Offline
Re: Make, for TXP plugins (compiler)
dead link
Offline
Re: Make, for TXP plugins (compiler)
Sorry, I switched to GitHub, so it’s here now. I haven’t updated the documentation, but the new format is like this (see the sample/example.php):
<?php
/**
* @name jmd_example
* @description A glorified "Hello, World".
* @author Jon-Michael Deldin
* @author_uri http://jmdeldin.com
* @version 0.1
* @type 0
* @order 5
*/
function jmd_example($attrs, $thing)
{
$js = <<<EOF
//inc <example.js>
EOF;
return tag($js, 'script', ' type="text/javascript"');
}
?>
(README.textile is automatically included.)
Offline