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" ?>
PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
Create an HTML fragment from the parsed LinkPI.
# File lib/hoe/manualgen/editorial-filter.rb, line 54
def generate_mark( current_page, mark_type, content )
return "%%(editorial %s-mark)%s%%" % [ mark_type, content ]
end
Process the given source
for <?ed … ?>
processing-instructions
# File lib/hoe/manualgen/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