EditorialFilter

class
Superclass
Hoe::ManualGen::PageFilter

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

anchor
generate_mark( current_page, mark_type, content )

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
anchor
process( source, page, metadata )

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