Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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 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.
- fixed footer.
- first release.
Last edited by spiffin (2012-05-26 20:09:19)
Offline
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
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
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
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
Re: CodeMirror: syntax highlighting for Textpattern (admin theme)
OK, joebaich talked me into it… mrd_codeMirror
Offline
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
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