Custom filter to process Markdown


Carl Bolduc
 

Hi,
I just installed template toolkit on my mac and I'm able to use ttree to process a directory of templates.
I would like to write those templates in markdown. I saw that it is possible to write custom filters as described here:
However, I don't know how to use custom filters. How can I tell ttree where my custom filter is located so that it can convert the markdown content?
Thank you,
Carl


Johan Vromans
 

Plugins must be loadadble by perl, and therefore should be placed in one of the @INC directories.

There are a couple of Markdown plugins available on the CPAN, e.g. https://metacpan.org/pod/Template::Plugin::CommonMark https://metacpan.org/pod/Template::Plugin::Markdown

If you install (one or both of) them using the cpan tool, they should be available to your ttree program.


annulen@...
 

On Fri, Mar 19, 2021 at 12:13 AM, Johan Vromans wrote:

Plugins must be loadadble by perl, and therefore should be placed in one of the @INC directories.

There are a couple of Markdown plugins available on the CPAN, e.g. https://metacpan.org/pod/Template::Plugin::CommonMark https://metacpan.org/pod/Template::Plugin::Markdown

If you install (one or both of) them using the cpan tool, they should be available to your ttree program.

Hello,

Should these plugins be available to tpage program as well? I've just installed Template::Plugin::CommonMark, and it can be use'd in perl script, but tpage still says "undef error - cmark: filter not found".

Thanks.


Johan Vromans
 

Did you also add

[% USE CommonMark %]

to your templates?


annulen@...
 

On Sat, Apr 2, 2022 at 11:38 AM, Johan Vromans wrote:

Did you also add

[% USE CommonMark %]

to your templates?

Sorry, I didn't (total noob here, just started using TT:)
It works like a charm now, thanks!