2012-04-26 22:49:25

spiffin
Plugin Author
epsilon
Real name: Simon Finch
From: London, UK
Website

CodeMirror: syntax highlighting for Textpattern (admin theme)

Superseded by plugin version now supporting Zen Coding.

A syntax highlighting admin theme using CodeMirror.

Requires Textpattern 4.4.1

Features

  • ‘Classic’ admin theme plus syntax highlighting for Pages, Forms, Style pages;
  • syntax highlighting for JavaScript (requires spf_js v0.2);
  • syntax highlighting for external files editor (requires spf_ext);
  • choice of CodeMirror themes ;
  • matching brackets highlighter;
  • line numbering;
  • code-specific highlighting.

Instructions

  • Plugin version now available.
  • “Download”:https://github.com/spiffin/CodeMirrorTextpattern/zipball/master the zipped theme;
  • Unzip and upload the ‘codemirror’ directory inside the zip archive to your textpattern > themes directory;
  • Enable the admin theme via Admin > Preferences > Advanced > Theme (or via smd_admin_themes);
  • Pages, Forms and Styles pages will be syntax highlighted;
  • JavaScript and External Files will be syntax highlighted if spf_js and spf_ext are installed.

Customisation

  • Edit the ‘textarea_xxx.js’ files to change default preferences for each tab;
  • e.g. edit ‘textarea_page.js’ to change preferences for the Page tab highlighting;
  • e.g. change theme: “ambiance” to any other theme.

Note: editing theme files is a doddle with smd_admin_themes.

Possible to-dos

  • Resizable textareas;
  • Textpattern tag mode.

Version history

0.3 – April 2012

  • code optimisation.

0.2 – April 2012

  • fixed footer.

0.1 – April 2012

  • first release.

Last edited by spiffin (2012-05-26 20:09:19)

Offline

 

2012-04-27 10:48:39

sacripant
Member
thêta
From: Dakar – Sénégal – Africa

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

Interesting, thank you for sharing

Do you think it’s adaptable to the “write” tab with a full screen option and a syntax syntax highlighting for Textile ?

Offline

 

2012-04-27 17:25:37

spiffin
Plugin Author
epsilon
Real name: Simon Finch
From: London, UK
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

sacripant wrote:

Do you think it’s adaptable to the “write” tab with a full screen option and a syntax syntax highlighting for Textile ?

Hmm .. I’d have thought a WYSIWYG editor would be more suited to the Write tab.

Something like Aloha Editor perhaps?

Simon

Offline

 

2012-05-05 17:59:56

mrdale
Moderator
omega
Real name: Dale Chapman
From: Walla Walla
Known languages: strine.
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

Excellent work mrFinch.

It appears that codeMirror, is way better than editarea and in fact the “shiznitz”.

I use a heavily modified (to my own devious wine client ends) admin theme based on Sandspace so switching themes is not really an option. I tinkered with trying to hak hak_editarea to no avail (loaded but took on weird, non functional styling).

Perhaps you could bend you mad skills toward adapting what you learned with the theme, into a standalone plugin for the css form and page areas.

-Dale

Offline

 

2012-05-05 18:19:05

joebaich
Member
lambda
Real name: Joe
From: DC Metro Area and elsewhere
Known languages: En, Sc, Fr, De.
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

mrdale wrote:

Excellent work mrFinch.

Perhaps you could bend you mad skills toward adapting what you learned with the theme, into a standalone plugin for the css form and page areas.

+1

Offline

 

2012-05-06 06:01:51

mrdale
Moderator
omega
Real name: Dale Chapman
From: Walla Walla
Known languages: strine.
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

OK, joebaich talked me into it… mrd_codeMirror

Offline

 

2012-05-06 15:20:06

spiffin
Plugin Author
epsilon
Real name: Simon Finch
From: London, UK
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

mrdale wrote:

Excellent work mrFinch.
Perhaps you could bend you mad skills toward adapting what you learned with the theme, into a standalone plugin for the css form and page areas.

Thanks Dale (and Joe) .. I did have a quick look at plugin possibilities .. but it’s quite fiddly getting to work with other (non-Classic) themes.

Offline

 

2012-05-06 18:50:20

philwareham
Core designer
sigma
Real name: Phil Wareham
From: Farnham, UK
Website

Re: CodeMirror: syntax highlighting for Textpattern (admin theme)

Just an advanced warning – the core themes (Remora and Classic) are undergoing a substantial CSS rewrite for Textpattern 4.5 (it’s coming in a mega-patch to the SVN in a few days time), along with some structural changes to the admin-side.

However, I’ll look into how this syntax highlighting could sit alongside that, in a non-theme specific way.

Offline

 

Powered by FluxBB