MassPlugCompiler - Textpattern CMS plugin compiler

Overview

mtxpc

Build Status Code Coverage PHP Version

mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file.

Install

Using Composer:

$ composer require rah/mtxpc --dev

Usage

As a Library

use Rah\Mtxpc\Compiler;

$compiler = new Compiler();

$plugin = $compiler->compile('path/to/plugin/source/directory');

echo $plugin->getInstaller();

Via Command Line

$ vendor/bin/mtxpc [[-h|--help][-c|--compress][--outdir=<path>]] <file>

Examples:

$ vendor/bin/mtxpc path/to/abc_plugin > abc_plugin_v0.1.0.txt
$ vendor/bin/mtxpc -c path/to/abc_plugin > abc_plugin_v0.1.0_zip.txt
$ vendor/bin/mtxpc -c --outdir=dist/ .

Example Plugin Template

See abc_plugin repository for an example template.

GitHub Action

A GitHub action is available to integrating plugin compilation to automated build chain.

Plugin Template

The main difference compared to Textpattern's vanilla plugin template is how plugins are constructed. Textpattern's official template hosts everything in a single file, while mtxpc splits the sources to separate files; translations, readme, manifest and source code.

Translations

Textpacks, Textpattern's plugin localization files, can be stored in a single file, or as separate files, each file storing a different language. The compiler searches .textpack files from a directory named textpacks.

Textpattern offers a way to set the default language which is used as the fallback when the plugin doesn't come with user's language. The default language is chosen based on #@language keyword, or lack of. Textpack files that do not define a language, are treated as the default fallback. Compare abc_plugin's en-gb.texpack and fi-fi.textpack files. The en-gb doesn't define the language code and is set as the default.

Manifest

The manifest file, manifest.json, contains all plugin's meta data. That's the rest of the stuff a plugin is made of, including plugin's version number, author, url, special flags, type, and recommended loading order.

Help File

Manifest file can also be used to specify help file's location. By default a help file is expected to be named as help with any extension, but a different location can be chosen with a file option:

{
    "help": {
        "file": ["./README.textile"]
    }
}

Textile markup can be used in the help file. If the help file's filename ends with .textile extension, or the file contents start with h1. tag, the file is treated as if it contained Textile markup.

You might also like...
Smd tags - A Textpattern CMS plugin for unlimited, structured taxonomy across content types.

smd_tags Tag articles, images, files and links with stuff, then use the public-side tags to display the lists, filter or find related content. Feature

Rah comment spam - Comment anti-spam plugin for Textpattern CMS

rah_comment_spam Packagist | Issues | Donate Rah_comment_spam provides customizable anti-spam tools for Textpattern CMS’ comment system. Set minimum a

Tom image grid - Plugin for Textpattern CMS : An optionnal grid display for images tab

tom_image_grid tom_image_grid is a plugin for Textpattern CMS. It allows a more compact display (as a grid) of the images list. The plugin adds two bu

Rah backup - Takes backups from Textpattern CMS installations

rah_backup Packagist | Twitter | Donate Rah_backup keeps your important site safe from disastrous events. Rah_backup is an admin-side backup utility p

Rah sitemap - XML sitemap generator for Textpattern CMS

rah_sitemap Packagist | Issues | Donate Sitemap plugin for Textpattern CMS. Generates Sitemaps.org XML sitemaps for your site, which help Google and o

Rah memcached - Store parts of Textpattern CMS templates in Memcached

rah_memcached Packagist | Issues | Donate A plugin for Textpattern CMS that stores parts of your templates in Memcached, a distributed in-memory key-v

Oui player - Manage configurable media players in @Textpattern CMS

oui_player Introduction An extendable plugin to easily embed customized audio and video players. . This plugin does not use oembed, it builds iframe e

Rah comments - Paginated article comments list for Textpattern CMS

rah_comments Download | Packagist | Issues | Support forum | Donate Rah_comments lets you to paginate Textpattern CMS’ comment lists, splitting the lo

Rah privileges - Configure Textpattern CMS' user-group privileges through Preferences panel

rah_privileges Packagist | Donate Configure admin-side user-group permissions from Textpattern CMS’ preferences panel. Install Using Composer: $ compo

Releases(0.9.1)
  • 0.9.1(Apr 16, 2022)

  • 0.9.0(Apr 15, 2022)

    • Fixed: PHP >= 8.0 compatibility.
    • Due to compatibility changes, \Rah\Mtxpc\Plugin class no longer implements \JsonSerializable interface, and can no longer be directly encoded with \json_encode(). Encoding the Plugin as JSON is still possible by passing the object to \Rah\Mtxpc\Api\Converter\PluginDataConverterInterface::convert() and passing its array-map result to \json_encode(). This wasn't part of the interface, but was only in the implementation, and doesn't affect normal usage.
    Source code(tar.gz)
    Source code(zip)
    mtxpc.phar(55.25 KB)
  • 0.8.0(Feb 9, 2020)

  • 0.7.0(Feb 9, 2020)

    • Added: \Rah\Mtxpc\Api\PluginInterface that is then returned by the \Rah\Mtxpc\Api\PackageInterface::getUnpacked().
    • Added: \Rah\Mtxpc\Api\PackagerInterface and implemented separate packagers for compressed and uncompressed plugin packages.
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Feb 9, 2020)

    • Added: \Rah\Mtxpc\Api\PackageInterface::getUnpacked() returns unpacked plugin package contents.
    • Changed: Packed allow_html_help is set with a boolean true or false rather than integer 1 or 0.
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Feb 9, 2020)

  • 0.4.0(Feb 9, 2020)

  • 0.3.0(Feb 9, 2020)

  • v0.2(Feb 9, 2020)

  • v0.1(Feb 9, 2020)

Owner
Jukka Svahn
Backend developer by trade, hobbyist designer and frontend fiddler, self-proclaimed home cook and baker
Jukka Svahn
Textpattern-installer - Textpattern plugin and theme installer for Composer

Textpattern Installer for Composer Package directory | Issues Install plugins and themes to Textpattern CMS with Composer. $ composer require rah/rah_

Jukka Svahn 7 Apr 14, 2022
PeachPie - the PHP compiler and runtime for .NET and .NET Core

PeachPie Compiler The open-source PHP compiler to .NET If you run into any inconsistencies, bugs or incompatibilities, kindly let us know and we'll do

PeachPie Compiler Platform 2.1k Dec 22, 2022
Pug-php adds inline PHP scripting support to the Pug template compiler

Pug-php adds inline PHP scripting support to the Pug template compiler. Since version 3, it uses Phug, a very customizable Pug template engine made by the tale-pug and pug-php developers as the new PHP Pug engine reference.

Pug PHP 376 Dec 17, 2022
High performance view templating API for PHP applications using tags & expressions inspired by Java JSTL and C compiler

View Language API Table of contents: About Expressions Tags Configuration Compilation Installation Unit Tests Examples Reference Guide About This API

Lucian Gabriel Popescu 0 Jan 9, 2022
Ied plugin composer - Inspired Plugin Composer: Create, publish and edit plugins from within Textpattern CMS.

ied_plugin_composer Create, publish and edit plugins from within Textpattern CMS. Creates a new page under the Extensions tab where you can edit and e

Stef Dawson 8 Oct 3, 2020
Rah cache minify - HTML compressor module for rah cache Textpattern CMS plugin

Minify module for rah_cache This is a minify module for rah_cache, a full-page caching solution for Textpattern CMS. Rah_cache_minify will minify HTML

Jukka Svahn 1 Feb 13, 2014
Etc cache - Cache plugin for Textpattern CMS

etc_cache Download | Packagist This Textpattern plugin provides an events-driven cache solution for Textpattern CMS. Textpattern is fast, but when you

null 3 Aug 30, 2020
Etc pagination - Pagination plugin for Textpattern CMS.

etc_pagination Download | Packagist This Textpattern plugin creates a paginated navigation bar on listings. It has a wide variety of attributes – so y

null 5 Dec 10, 2020
Smd imagery - A Textpattern CMS plugin for managing images in the Write panel.

smd_imagery Insert images into your Write panel. Very handy for people who run photoblog or image-heavy sites, or those who categorise images for incl

Stef Dawson 5 Nov 15, 2022
Zem contact reborn - An extensible HTML form mailer plugin for Textpattern CMS.

com_connect Contents Introduction Installing and upgrading Migrating from zem_contact_reborn Usage Tags com_connect tag com_connect_text tag com_conne

Textpattern CMS 23 Dec 8, 2021