You are viewing a plain text version of this content. The canonical link for it is here.
Posted to infrastructure-dev@apache.org by Robert Meyer <rm...@hotmail.co.uk> on 2014/07/10 11:37:42 UTC

Markdown referencing perl variables

Hi,

Following on from an earlier ticket (https://issues.apache.org/jira/browse/INFRA-7929), I am looking for help in trying to modify FOP's path.pm file to allow mdtext files to take their version numbers from a perl variable. I know from several examples (thrift and mina) that this can be accomplished by replacing hardcoded values with references like the following:

Current version: {{ current_version }}

I am still unclear on the patterns aspect and which one I should be using. I have experimented with single_narrative and snippet's without much success. The furthest I have got was to use a sitemap which references a single mdtext file as an example. Whilst the value is replaced in the output it is not converted to HTML and left in it's markdown format (probably caused by an error I get during conversion):

our $current_version = "2.0";

our @patterns = (
       #...

        [qr!/index\.mdtext$!, sitemap => {
        headers => { title => "Sitemap" },
        sidenav => "xgc-sidenav.mdtext",
        footer  => "bottom.html",
        header  => "xgc-top.html",
        current_version => $current_version,

       #...
    } ],
};

I am very much a perl novice and so am struggling to decipher what the methods (sitemap, single_narrative, snippet) are actually doing and require as inputs. If anyone could provide a few pointers or maybe a simple example just to show how to replace a simple reference using one of these methods I would be most grateful. 

We already have some predefined patterns which I'd need to change but hopefully provide the same result: http://svn.apache.org/repos/asf/xmlgraphics/site/trunk/lib/path.pm

Many thanks,

Robert Meyer (Apache FOP project)