Re: Markdown

Johan Vromans <[email protected]> Sat, 11 Feb 2017 10:25:54 +0100
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Organization Squirrel Consultancy
Message-ID <[email protected]>
I use the TT2Site site builder, which is based on the web site generator as
described in the badger book.

My current approach boils down to:

- in ttree.cfg:

  accept = \.(html|md)$
  suffix md=html
  wrapper = page/wrapper

So it transforms .html and .md input documents, both resulting in .html
output documents.

All documents are first processed through the page/wrapper, which
(basically) contains:

  SWITCH page.type;
    CASE "html";
	content WRAPPER page/html
		      + page/layout;

    CASE "md";
    	USE MultiMarkdown;
	content | multimarkdown WRAPPER page/html
		      + page/layout;

    CASE;
	THROW page.type "Invalid page type: $page.type";
  END;

All .md documents are filtered through MultiMarkdown.

I think this is good enough for now.

-- Johan