Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bleargh45/template-plugin-stripcomments

Template Toolkit filter to strip comment blocks
https://github.com/bleargh45/template-plugin-stripcomments

html-comments template-toolkit

Last synced: 22 days ago
JSON representation

Template Toolkit filter to strip comment blocks

Awesome Lists containing this project

README

        

# NAME

Template::Plugin::StripComments - Template Toolkit filter to strip comment blocks

# SYNOPSIS

```
[% USE StripComments %]
...
[% FILTER stripcomments %]
/* C-style block comments get removed */


[% END %]
...
[% text | stripcomments %]
```

# DESCRIPTION

`Template::Plugin::StripComments` is a filter plugin for [Template::Toolkit](https://metacpan.org/pod/Template%3A%3AToolkit),
which strips comment blocks from the filtered text.

The following types of comment blocks are stripped:

- /\* c-style comments \*/
- <!-- HTML comments -->

# METHODS

- init()

Initializes the template plugin.

- filter($text)

Filters the given text, removing comment blocks as necessary.

# AUTHOR

Graham TerMarsch

# COPYRIGHT

Copyright (C) 2007, Graham TerMarsch. All Rights Reserved.

This is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.

# SEE ALSO

[Template::Plugin::Filter](https://metacpan.org/pod/Template%3A%3APlugin%3A%3AFilter).