Skip to content

bclennox/perch-tmbundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perch TextMate Bundle

Snippets and grammar for the Perch content management system.

Installation

In your terminal:

mkdir -p "$HOME/Library/Application Support/TextMate/Bundles"
cd "$HOME/Library/Application Support/TextMate/Bundles"
git clone git://github.com/bclennox/perch-tmbundle.git Perch.tmbundle

You also need to update the HTML bundle's grammar:

# somewhere around line 184
repository = {
  embedded-code = {
    patterns = (
      {	include = '#ruby'; },
      {	include = '#php'; },
      {	include = '#smarty'; },
      {	include = '#python'; },
      { include = '#perch'; },    # add this line...
    );
  };
  
  # ...and this line
  perch = { patterns = ( { include = 'text.xml.perch'; } ); };
}

Then choose Bundles > Bundle Editor > Reload Bundles.

Snippets

  • perch: Call to perch_content()
  • percht: Template tag for a text field
  • perchb: Template tag for a text block
  • perchi: Template tag for an image
  • perchii: HTML <img> tag with src and alt attributes created as appropriate template tags
  • perchf: Template tag for a file upload
  • perchff: HTML <a> tag with href attribute and inner HTML created as appropriate template tags
  • perchs: Template tag for a <select> element
  • perchd: Template tag for a date selector
  • percho: Template tag for a text field meant to be used with ordering in Perch 1.2

Todo

  • Smarter regexps in the grammar might make it possible to switch the scope to text.html within block-level Perch elements (like <perch:if>)

Credits

Inspired by Ad Taylor

License

See COPYING.

About

A TextMate Bundle for Perch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published