class Hoe::ManualGen::EditorialFilter
A filter for making editorial marks in manual content.
Editorial marks are XML processing instructions. There are several available types of marks:
<?ed "This is an editor's note." ?> <?ed verify:"this content needs checking or verification" ?>
Constants
- LinkPI
PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
Public Instance Methods
generate_mark( current_page, mark_type, content )
click to toggle source
Create an HTML fragment from the parsed LinkPI
.
# File data/hoe-manualgen/lib/editorial-filter.rb, line 54 def generate_mark( current_page, mark_type, content ) return "%%(editorial %s-mark)%s%%" % [ mark_type, content ] end
process( source, page, metadata )
click to toggle source
Process the given source
for <?ed … ?> processing-instructions
# File data/hoe-manualgen/lib/editorial-filter.rb, line 42 def process( source, page, metadata ) return source.gsub( LinkPI ) do |match| # Grab the tag values mark_type = $1 content = $2 self.generate_mark( page, mark_type, content ) end end