--- geshifilter.module	2006-06-07 21:03:10.000000000 -0400
+++ newgeshifilter.module	2006-06-24 19:39:40.000000000 -0400
@@ -26,68 +26,199 @@
 	$start_param = variable_get('geshifilter_start_param', FALSE);
 	$line_numbers = variable_get('geshifilter_line_numbers', GESHI_NO_LINE_NUMBERS);
 	$inline_code=variable_get('geshifilter_inline_code_'.$format, FALSE);
-	
+	$supported_types = array_keys($types, TRUE);
+
   if ($long) {
-		
-		$text=t('<h3>Code:</h3>');
-		
-		//some language are allowed, type param is supported
-		if (!$types[0]) {
-		
-			$text .= t('<p>To post highlighted code, surround it code with &lt;blockcode &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/blockcode&gt tags.</p>
-<p>E.g. actionscript block code:
-<pre>&lt;blockcode type=&quot;<em>actionscript</em>&quot;&gt;<br />...<br />&lt;/blockcode&gt;</pre></p>');
-			
-			if ($inline_code) {
-				$text .= t('<p>You may also post highlighted inline code surrounding it with &lt;code &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/code&gt tags.</p>
-<p>E.g. highlight actionscript inline code:
-<pre>&lt;code type=&quot;<em>actionscript</em>&quot;&gt;...&lt;/code&gt;</pre></p>');
-			}			
 
-			if ($default_type) {
-				$text .= t('<p>If you don\'t use <em>type=&quot;language&quot;</em> param or specify an unsupported language, the code will be highlighted as %default-code code.</p>', array('%default-code' => theme('placeholder', $default_language)));
-			}
-			else {
-			$text .= t('<p>If you don\'t use <em>type=&quot;language&quot;</em> param or specify an unsupported language, the code will not be highlighted.</p>');
-			} 
-			
-			$supported_types = array_keys($types, TRUE);
-			
-			$text .= t('<p>The following languages are supported for highlight:<br />%type_list.</p>', array('%type_list' => theme('item_list', $supported_types)));
-		
-		}
-		//no languages allowed, type param is not supported
-		else {	
-			
-			$text.= t('<p>To post code, surround it with &lt;blockcode&gt;...&lt;/blockcode&gt tags.</p>
-<p>E.g. :
-<pre>&lt;blockcode&gt;<br />...<br />&lt;/blockcode&gt;</pre></p>');
-			
-			if ($inline_code) {
-				$text.= t('<p>You may also post inline code surrounding it with &lt;code&gt;...&lt;/code&gt tags.</p>
-<p>E.g. :
-<pre>&lt;code&gt;...&lt;/code&gt;</pre></p>');
-			}
-			
-			if ($default_type) {
-				$text .= t('<p>By default, the code will be highlighted as %default-code code.</p>', array('%default-code' => theme('placeholder', $default_type)));
-			}
-			else {
-				$text .= t('<p>The code will not be highlighted.</p>');
-			}
-		}
-		
-		if ($line_numbers == GESHI_NORMAL_LINE_NUMBERS || $line_numbers == GESHI_FANCY_LINE_NUMBERS) { //line numbers
-			if ($start_param) {
-				$text .= ' '.t('<p>The code will be numbered. You can make the line numbers start at any number using <em>start=number</em> param
-<p>E.g. highlight actionscript code and start line number at 5:
-<pre>&lt;blockcode type=&quot;<em>actionscript</em>&quot; start=&quot;<em>5</em>&quot;&gt;<br />...<br />&lt;/blockcode&gt;</pre></p>');
-			}
-			else {
-				$text .= ' '.t('<p>The code will be numbered.</p>');
-			}
-		}
+		$text = t('
+<h2>GeSHi</h2>
+
+<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> is a syntax highlighter for computer languages.</p>
 
+<p>It is enabled for blocks of code and %disabled_for in-line code. %line_num %lang_state</p>
+
+<p>%language_list</p>
+
+<h3>usage:</h3>
+
+<p>To post a <strong>block of code</strong>, surround it with <code>&lt;blockcode%type_param%start_param&gt;...&lt;/blockcode&gt</code>.</p>
+
+<p>%type_instruct %start_instruct</p>
+
+%block_example
+
+<p>%inline_instruct</p>
+
+%inline_example'
+		,
+			array
+			(
+				// PRESENT STATE OF GESHI SETTINGS!
+
+				//part of first paragraph for in-line code state.
+				'%disabled_for' => (!$inline_code)
+					? t('disabled for')
+					: '',
+
+				//line numbers enabled?
+				'%line_num' => ($line_numbers != GESHI_NO_LINE_NUMBERS)
+					? t('Line numbering is enabled').
+						(
+							//start parameter enabled?
+							($start_param)
+								? ' '.t('and the initial value can be overridden.')
+								: '.'
+						)
+					: '',
+
+				//Some language are allowed, type param is supported.
+				'%lang_state' => (!$types[0])
+					? t('You can specify a language from the list below. If you don\'t specify an optional language or specify an unsupported one,').
+						(
+							//what is the default highlight setting?
+							($default_type)
+								? ' '.
+									t('the code will be highlighted as <strong>%default_code</strong>.',
+										array
+										(
+											'%default_code' => theme('placeholder', $default_type)
+										)
+									)
+								: ' '.
+									t('the code will not be highlighted.')
+						)
+					//what is the default highlight setting without a choice setting?
+					: (($default_type)
+						? ' '.
+							t('Syntax highlighting for <strong>%default_code</strong> will be used.',
+								array
+								(
+									'%default_code' => $default_type
+								)
+							)
+						: ' '.
+							t('Highlighting is disabled but any special html entities will still be escaped.')),
+
+				//language list when available.
+				'%language_list' => (!$types[0])
+					? t('The optional languages include the following:').(theme('item_list', $supported_types))
+					: '',
+
+
+				// GESHI USAGE/INSTRUCTIONS!
+
+				//type=language inserted when option is available.
+				'%type_param' => (!$types[0])
+					? ' '.t('&#91;type=&quot;<em>language</em>&quot;&#93;')
+					: '',
+
+				//start=number inserted when option is available.
+				'%start_param' => ($line_numbers != GESHI_NO_LINE_NUMBERS && $start_param)
+					? ' '.t('&#91;start=&quot;<em>number</em>&quot;&#93;')
+					: '',
+
+				//type=lang insturctions.
+				'%type_instruct' => (!$types[0])
+					? t('The optional <code>type=&quot;<em>language</em>&quot;</code> parameter can be used to specify a language to highlight.')
+					: '',
+
+				//start=number instructions.
+				'%start_instruct' => ($line_numbers != GESHI_NO_LINE_NUMBERS && $start_param)
+					? t('By default, line numbers are enabled for blocks with an initial value of 1. You can override the initial value by using the optional <code>start="<em>number</em>"</code> parameter. This comes in handy when posting a segment from a larger source and keeping the line numbers in sync.')
+					: '',
+
+				//block example.
+				'%block_example' =>
+					'<p>'.
+						t('e.g.%lang code block%start_param:',
+							array
+							(
+								//show the sample with the first supported language.
+								'%lang' => (!$types[0])
+									? ' '.$supported_types[0]
+									: '',
+								//shown only when the option is available.
+								'%start_param' => ($line_numbers != GESHI_NO_LINE_NUMBERS && $start_param)
+									? ' '.t('with an initial value of 5')
+									: ''
+							)
+						).
+					'</p>'.
+					'<pre>'.
+						t('&lt;blockcode%example_type%example_start&gt;<br />...<br />...<br />...<br />&lt;/blockcode&gt;',
+							array
+							(
+								//language type selectable?
+								'%example_type' => (!$types[0]) 
+									? ' '.
+										t('type=&quot;%type&quot;',
+											array
+											(
+												//show the sample with the first supported language.
+												'%type' => $supported_types[0]
+											)
+										)
+									: '',
+								//start number definable?
+								'%example_start' => ($line_numbers != GESHI_NO_LINE_NUMBERS && $start_param)
+									? ' '.t('start=&quot;5&quot;')
+									: ''
+							)
+						).
+					'</pre>',
+
+				//inline instructions.
+				'%inline_instruct' => ($inline_code)
+					?
+						t('To post in-line code, surround it with <code>&lt;code%type_param&gt;...&lt;/code&gt;</code> tags. %type_use',
+							array
+							(
+								//type=language inserted when option is available.
+								'%type_param' => (!$types[0])
+									? ' '.t('&#91;type=&quot;<em>language</em>&quot;&#93;')
+									: '',
+								'%type_use' => (!$types[0])
+									? t('The same rules apply for the language parameter.')
+									: ''
+							)
+						)
+					: '',
+
+				//inline example.
+				'%inline_example' => ($inline_code)
+					?
+						'<p>'.
+							t('e.g.%lang in-line code:',
+								array
+								(
+									//show the sample with the first supported language.
+									'%lang' => (!$types[0])
+										? ' '.$supported_types[0]
+										: ''
+								)
+							).
+						'</p>'.
+						'<pre>'.
+							t('...&lt;code%example_type&gt;...&lt;/code&gt;...',
+								array
+								(
+									//language type selectable?
+									'%example_type' => (!$types[0]) 
+										? ' '.
+											t('type=&quot;%type&quot;',
+												array
+												(
+													//show the sample with the first supported language.
+													'%type' => $supported_types[0]
+												)
+											)
+										: ''
+								)
+							).
+						'</pre>'
+					: ''
+			)
+		);
 		return $text;
   }
   else {
@@ -96,21 +227,21 @@
 		if (!$types[0]) {
 
 			$text .= t('You may post block code using &lt;blockcode &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/blockcode&gt; tags. ');
-			
+
 			if ($inline_code) {
 				$text .= t('You may also post inline code using &lt;code &#91;type=&quot;<em>language</em>&quot;&#93;&gt;...&lt;/code&gt; tags.');
 			}
 		}
 		//no languages allowed, type param is not supported
 		else {
-		
+
 			$text .= t('You may post block code using &lt;blockcode&gt;...&lt;/blockcode&gt; tags. ');
-			
+
 			if ($inline_code) {
 				$text .= t('You may also post inline code using &lt;code&gt;...&lt;/code&gt; tags.');
 			}
 		}
-		
+
 		return $text;
   }
 }
