aboutsummaryrefslogtreecommitdiff
path: root/doc/todo/meta_rcsid.mdwn
blob: 81a2c1328d725a0bcdf04aef30c84db560493728 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
The following patch adds an 'rcsid' parameter to the Meta plugin, to allow inclusion 
of CVS/SVN-style keywords (like '$Id$', etc.) from the source file in the page template.

> So the idea is you'd write something like:
> 
>	\[[!meta rcsid="$Id$"]]
> 
> And this would be put at the bottom of the page or somewhere like that by
> the template?
> 
> I wonder if it wouldn't be just as clear to say:
> 
> 	<span class="rcsid">$Id$</span>
> 
> And then use a stylesheet to display it as desired.
> --[[Joey]]

>> That's possibly true; my reasoning was that I wanted it to be more independent 
>> of the page content, and independent of any stylesheet.

    --- meta.pm.orig    2007-10-10 19:57:04.000000000 +0100
    +++ meta.pm 2007-10-10 20:07:37.000000000 +0100
    @@ -13,6 +13,7 @@
     my %authorurl;
     my %license;
     my %copyright;
    +my %rcsid;
 
     sub import { #{{{
        hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
    @@ -110,6 +111,9 @@
            $meta{$page}.="<link rel=\"copyright\" href=\"#page_copyright\" />\n";
            $copyright{$page}=$value;
        }
    +    elsif ($key eq 'rcsid') {
    +        $rcsid{$page}=$value;
    +    }
        else {
            $meta{$page}.=scrub("<meta name=\"".encode_entities($key).
                "\" content=\"".encode_entities($value)."\" />\n");
    @@ -142,6 +146,8 @@
            if exists $author{$page} && $template->query(name => "author");
        $template->param(authorurl => $authorurl{$page})
            if exists $authorurl{$page} && $template->query(name => "authorurl");
    +    $template->param(rcsid => $rcsid{$page})
    +        if exists $rcsid{$page} && $template->query(name => "rcsid");
        
        if ($page ne $destpage &&
            ((exists $license{$page}   && ! exists $license{$destpage}) ||

[[patch]]