Spf codemirror - CodeMirror syntax-highlighting for Textpattern

Overview

spf_codemirror

I’m no longer able to develop this plugin due to ill health. If anyone would like to take over, message me, and I’ll transfer the source.

CodeMirror syntax-highlighting and Emmet code-completion plugin for Textpattern admin.

Edit pages, forms, css, javascript (and more) full-screen, in your browser, with a choice of syntax-highlighting and code-completion.

Customisable via preferences: choose a theme, font-size and full-screen hot-keys.


Screenshot

Screenshot of Plugin Composer using the solarized-light theme.


Features

  1. Adds CodeMirror syntax-highlighting to textareas in Textpattern’s Forms, Pages and Style tabs;
  2. Also to JavaScript tab (spf_js required), Plugin Composer (ied_plugin_composer required) and External Files tab (spf_ext required);
  3. Basic preferences via Admin > Preferences > Advanced;
  4. Code-completion added to HTML & CSS courtesy of Emmet.

Upgrading from previous versions

  1. This version of the plugin (1.0) requires version 5.0 of CodeMirror. If you have an older installation, trash it.

CodeMirror installation

  1. Download the latest release of CodeMirror, unzip, and upload the entire directory (perhaps renaming it to ‘codemirror’) to your web server.
  2. The default location is your-web-root/codemirror – accessible via http://your.server/codemirror.
  3. If you chose an alternative location (e.g. a ‘vendor’ directory) you need to set it in the Prefs.
  4. Install the plugin: spf_codemirror.txt from the spf_codemirror repo.
  5. Check the Prefs (Admin > Preferences > Advanced), leave Emmet disabled (see next step), and activate.

Emmet installation

  1. Download emmet.min.js from the spf_codemirror repo – or build your own with npm and gulp
  2. Put emmet.min.js inside your codemirror directory. That’s it.
  3. Emmet is disabled by default (for speed).
  4. You can enable/disable it in the Prefs (Admin > Preferences > Advanced).

CodeMirror/Emmet upgrade

  1. You can now easily upgrade CodeMirror (5.0 as of March 2015).
  2. Download the latest release, unzip, and replace your old codemirror directory.
  3. To upgrade Emmet, go to the CodeMirror plugin repo, and follow the build instructions. Make sure the js file is minified and named emmet.min.js.
  4. Upload emmet.min.js to the codemirror directory on your server – replacing your previous version.

Emmet notes

  1. Initiate completion by hitting TAB (or Cmd+E).
  2. Try typing this: div#page>div.logo+ul#navigation>li*5>a and then TAB.
  3. Works with opening and closing Textpattern tags (try typing txp:if_section and then TAB).
  4. CSS shortcuts work even better with Emmet* – try typing m and then TAB in Styles.
  5. Emmet documentation.

Version history

1.0 – March 2015

  • Changes for CodeMirror 5.0
  • Added support for Plugin Composer (add a commented PHP tag: //<?php at start to enable)
  • Removed Minify support
  • Enable or disable Emmet (for speed)

0.9 – October 2014

  • Changes for CodeMirror 4.6

0.8 – January 2013

  • Changes for CodeMirror 3.1 & Emmet 1.3.3
  • Added match-highlighter feature for Pages, Forms & Javascript.
  • Fixed search in full-screen mode.

0.7 – November 2012

0.6 – November 2012

  • Re-written for Textpattern 4.5.1.
  • Upgraded to CodeMirror 2.35 and Emmet.
  • Full-screen support – hit F5 (and Esc to exit).
  • Basic preferences via Admin > Preferences > Advanced.
  • CodeMirror folder structure now mirrors standard CodeMirror for easy upgrades.
  • Automatic Minify support.

0.5 – May 2012

  • CSS support for Zen Coding within style tags.

0.4 – May 2012

  • Added code block indicators: spf_codemirror START/END.
  • Code cleanup.

0.3 – May 2012

  • Added Zen Coding code completion to Pages and Forms (HTML).
  • Upgraded to CodeMirror 2.25.

0.2 – May 2012

  • Changed load order (to allow interaction with other plugins).

0.1 – May 2012

  • first release.
You might also like...
Kiaan PHP is a web application framework with expressive, elegant syntax.

About Kiaan framework Kiaan is a web application framework for PHP. Kiaan is easy, flexible and professional. Documentation You can learn kiaan with t

Wp-to-txp - @WordPress to @Textpattern dev guide

WordPress to Textpattern dev guide Helping poor WP devs to find their track… Contents Themes development Plugins development Related Awesome Textpatte

MassPlugCompiler - Textpattern CMS plugin compiler

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

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

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

Pat eu cookies law - 🌝 EU Cookie Law Compliance: A Textpattern plugin (or standalone script) for Third-Party Cookies (RGPD compliance)
Pat eu cookies law - 🌝 EU Cookie Law Compliance: A Textpattern plugin (or standalone script) for Third-Party Cookies (RGPD compliance)

pat_eu_cookies_law EU Cookie Law Compliance: A Textpattern plugin (or a standalone script) for Third-Party Cookies. A simple solution that respects th

Pat if amp - ⚡ A Textpattern Conditional Plugin for Google's Accelerated Mobile Pages Project (AMP)
Pat if amp - ⚡ A Textpattern Conditional Plugin for Google's Accelerated Mobile Pages Project (AMP)

pat_if_amp Download | Packagist AMP pages for Textpattern CMS. This conditional tag examines the URL of the current page and determines if the URL end

Oui cookie - Cookie management plugin for @Textpattern

oui_cookie Introduction Set, check, read, reset or delete cookies manually or through GET/POST parameters. . According to the EU legislation, some coo

TXP-Tweet - arc twitter - Twitter-Textpattern integration

TXP Tweet This is TXP Tweet, a collection of Textpattern plugins for Twitter integration. TXP Tweet consists of two plugins: arc_twitter (the core Tex

Comments
  • Not an issue but a request : Textile syntax on articles

    Not an issue but a request : Textile syntax on articles

    Hello ! This plugin is each time my first plugin installed, a must have !

    What I need : codemirror give us Textile syntax . Is it difficult to setup spf_codemirror with Textile on the articles tab ?

    Thanks !

    Jean-Pol

    question 
    opened by jpdupont 2
  • Add to awesome-textpattern

    Add to awesome-textpattern

    If spf_codemirror works with the current version of Textpattern (v4.5.7) please feel free to add it to the https://github.com/drmonkeyninja/awesome-textpattern list. Just fork it and make a pull request. :-)

    opened by drmonkeyninja 0
  • I would like to take over this repository.

    I would like to take over this repository.

    Hello @spiffin !

    I am very sorry for your health, I do not know if you are still alive. I am advanced in PHP since 2015. I will give PHP classes to students at my college. If you accept to transfer your repositories to me, contact me.

    My e-mail is [email protected].

    Gustavo Costa

    opened by gusbemacbe 3
Owner
Gustavo Reis
Deaf-born polyglot developer and web designer. Graduated in Computer Science.
Gustavo Reis
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.

A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.

Doctrine 1.4k Dec 29, 2022
A Sublime Text 3 package for highlighting both Sass and SCSS syntax.

Syntax Highlighting for Sass This is a Sublime Text 3 package which purely forced on highlighting both Sass and SCSS syntax as accuracy as possible. P

Peiwen Lu 291 Jun 26, 2022
Textpattern-for-Panic-Coda - A Textpattern CMS mode for Panic Coda

Textpattern elements for Panic Coda 2 Handy elements for use with Panic Coda 2 on a Mac when authoring files for the Textpattern CMS. This repository

Phil Wareham 8 Jun 26, 2017
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
Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use.

Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use. This package allows you to use Shiki from PHP.

Spatie 229 Jan 4, 2023
DBML parser for PHP8. It's a PHP parser for DBML syntax.

DBML parser written on PHP8 DBML (database markup language) is a simple, readable DSL language designed to define database structures. This page outli

Pavel Buchnev 32 Dec 29, 2022
CPAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your PHP project.

CPAY CHOCO PAY is a sdk that encapsulates the Orange Money api with an intuitive syntax allowing you to integrate the Orange Money payment into your P

faso-dev 1 Oct 26, 2022
This tool check syntax of PHP files faster than serial check with fancier output.

PHP Parallel Lint This application checks syntax of PHP files in parallel. It can output in plain text, colored text, json and checksyntax formats. Ad

PHP Parallel lint 202 Dec 22, 2022
A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.

Slack for PHP A simple PHP package for sending messages to Slack with incoming webhooks, focussed on ease-of-use and elegant syntax. Note: this packag

Regan McEntyre 1.2k Oct 29, 2022
PHP Parallel Lint - This tool check syntax of PHP files faster than serial check with fancier output

PHP Parallel Lint This application checks syntax of PHP files in parallel. It can output in plain text, colored text, json and checksyntax formats. Ad

PHP Parallel lint 156 Apr 24, 2022