Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-17 20:58:47

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

#2 2009-04-15 16:14:17

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Make, for TXP plugins (compiler)

dead link

Offline

#3 2009-04-15 16:21:03

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

Board footer

Powered by FluxBB