manualdir/lib/examples-filter.rb
def process_example( params, body )
		options = self.parse_options( params )
		caption = options.delete( :caption )
		content = ''
		
		# Test it if it's testable
		if options[:testable]
			content = test_content( body, options[:language] )
		else
			content = body
		end

		# Strip trailing blank lines and syntax-highlight
		content = highlight( content.strip, options )
		caption = %{<div class="caption">} + caption.to_s + %{</div>} if caption

		return %{<notextile><div class="example">%s%s</div></notextile>} %
		 	[content, caption || '']
	end
### Filter out 'example' macros, doing syntax highlighting, and running
### 'testable' examples through a validation process appropriate to the
### language the example is in.
Filter out 'example' macros, doing syntax highlighting, and running
'testable' examples through a validation process appropriate to the
language the example is in.
Filter out ' example ' macros doing syntax highlighting and running ' testable ' examples through a validation process appropriate to the language the example is in .
def process_example( params, body )
		options = self.parse_options( params )
		caption = options.delete( :caption )
		content = ''
		if options[:testable]
			content = test_content( body, options[:language] )
		else
			content = body
		end
		content = highlight( content.strip, options )
		caption = %{<div class="caption">} + caption.to_s + %{</div>} if caption
		return %{<notextile><div class="example">%s%s</div></notextile>} %
		 	[content, caption || '']
	end
def process_example ( params , body ) options = self . parse_options ( params ) caption = options . delete ( :caption ) content = '' if options [ :testable ] content = test_content ( body , options [ :language ] ) else content = body end content = highlight ( content . strip , options ) caption = %{<div class="caption">} + caption . to_s + %{</div>} if caption return %{<notextile><div class="example">%s%s</div></notextile>} % [ content , caption || '' ] end
Filter out 'example' macros, doing syntax highlighting, and running
'testable' examples through a validation process appropriate to the
language the example is in.
Filter out ' example ' macros doing syntax highlighting and running ' testable ' examples through a validation process appropriate to the language the example is in .
# Test it if it's testable # Strip trailing blank lines and syntax-highlight
params
body