Tag-Archive for » highlighting «

2009-12-24 21:28:21 | Author:

Dadumdidum… ECMAScript5 (“JavaScript”) gefällt mir. Und weil’s so schön ist, implementier ich schon mal die neuen Arraymethoden… bspw.:

if (typeof Array.prototype.indexOf === 'undefined') {

	/**
	* 15.4.4.14
	* NOTE the second parameter fromIndex is not explicitly stated so that the
	*      method's length property becomes 1
	*
	* @param searchElement array element to be searched for
	* @param fromIndex (optional, integer)
	*/
	Array.prototype.indexOf = function (f) {
		var l = this.length,
			i = arguments[1] || 0;

		i += (i < 0) ? l : 0;

		for (i = Math.max(i, 0); i < l; i += 1) {
			if (this[i] === f) {
				return i;
			}
		}
		return -1;
	};
}

…außerdem gefällt mir dieses Syntax-Highlighting hier :D
to be extended…

2009-05-21 13:14:10 | Author:

I’m reading a book, and it’s, well, a plain text file. The lack of structure bothers me.
I’m using Kate, and Kate offers a simple way of adding syntax highlighting.
So I wrote a very small highlighting definition for Kate, which allows me to view quotes in a slightly different color (provided that actual quotation marks are used, not apostrophes). Yes, it does nested quotes.
I may improve it sometime, but for now I’m happy.

Usage:

copy the file to ~/.kde/share/apps/katepart/syntax/
In Kate, select Extras->Highlighting->Other->eBook txt