I just finished a small plug-in that allows to easily add CodeIgniter style comments in Coda. I was inspired by the DevMark Plug-in by Erwan Tossen, yet wanted to add more customization and flexibility.
After adding the plug-in to Coda you first need to set the preferences in the config file and save it.
; CodeIgniter Comments - Preferences
; ------------------------------------
; This file work like "php.ini" files.
; Don't remove [xxx] lines !
[config]
date = m/d/Y
author = title,-,descr,-,license,author,link,email,-,file,version,date,-,copyright
block = title,-,descr
[author]
descr = Description
author = Your name
link = <a href="http://your-name.com">http://your-name.com</a>
email = .(JavaScript must be enabled to view this email address)
license = GNU General Public License
version = 1.0
[block]
descr = DescriptionAdd Author (Ctrl+Shift+A)
The Add Author function lets you add a comment block like this:
/**
* Title
*
* Description
*
* @license GNU General Public License
* @author Frank Michel
* @link <a href="http://frankmichel.com">http://frankmichel.com</a>
* @email .(JavaScript must be enabled to view this email address)
*
* @file test.php
* @version 1.0
* @date 02/22/2009
*
* Copyright (c) 2009
*/To add a comment block simply select your typed title and add the author block with Ctrl+Shift+A.
You can easily re-arrange the items of this block by editing the comma separated author line in the [config] section of the preferences. You can use any of the following special items or add a blank line with a dash “-”
title - the input text from the selection
descr - the default description placeholder from the preferences
file - the current file name
date - the current date in the format you defined in the preferences
copyright - a copyright notice
NEW:
Any other item you add to the preferences file can be supplied with a default value. So if you like to add…
/**
* @example DefaultValue
*/...simply append “example” to the comma separated author line in the [config] section of the preferences file and optionally add the following line to the [author] section:
example = DefaultValueThis feature gives you great flexibiliy in adding custom items with default values.
Add Block (Ctrl+Shift+B)
The Add Block function lets you add a comment block like this:
/**
* Function Name
*
* Description
*/Special items are only title and descr. Adding other items is just as easy as described above. Please make sure to put your default values in the [block] section of the preferences file.
Add Line (Ctrl+Shift+L)
This function lets you easily add a line like this:
// --------------------------------------------------------------------------Add GPL (Ctrl+Shift+G)
This function lets you add a GPL license block.
Add EOF (Ctrl+Shift+E)
This function lets you add the document footer in a CI style:
/* End of file test.php */
/* Location: ./application/libraries/test.php */Last but not least there’s an Update Date (Ctrl+Shift+U) function that let’s you automatically update the date in the author block as specified in the preferences file.
You can download the plug-in here:
CI Comments Coda Plug-in
I hope you enjoy it! Happy commenting 😊