You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2014/02/10 23:25:45 UTC
svn commit: r1566766 - in /myfaces/site/cms-site/trunk:
content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext lib/view.pm
Author: lu4242
Date: Mon Feb 10 22:25:45 2014
New Revision: 1566766
URL: http://svn.apache.org/r1566766
Log:
test how to fix documentation
Modified:
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext
myfaces/site/cms-site/trunk/lib/view.pm
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext?rev=1566766&r1=1566765&r2=1566766&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext Mon Feb 10 22:25:45 2014
@@ -1,10 +1,6 @@
Title: JSF and MyFaces Howtos
-Pagetree: children
-set_section1: head1
-set_section2: head2
+set_toc: pagetree
Below you can find solutions to common problems in JSF and MyFaces
-{{ ttitle }}
-
-{{ pagetree|safe }}
+{{ toc|safe }}
Modified: myfaces/site/cms-site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/lib/view.pm?rev=1566766&r1=1566765&r2=1566766&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/lib/view.pm (original)
+++ myfaces/site/cms-site/trunk/lib/view.pm Mon Feb 10 22:25:45 2014
@@ -43,27 +43,36 @@ sub single_narrative {
$args{refs} = {};
- # callback
- # my $ttitle = "";
+ # Header command : the idea is put something like "set_xxx : [command]" as a header
+ # in the page to indicate the algorithm here to run the command and then set the
+ # response as an argument so it can be injected in the text using {{ xxx }}
+ # for example "set_toc : pagetree" and inject using {{ toc|safe }}
foreach my $key (keys %{ ${args{headers}} }) {
my $hindex = index($key, "set_" );
if ($hindex == 0) {
my $headerKey = substr($key, 4);
- # $ttitle .= "$headerKey,";
+ my $command = ${args{headers}}{$headerKey};
+ if ($command = "pagetree") {
+ my($ptfile, $ptdir, $ptext) = fileparse($args{path}, qr/\.[^.]*/);
+ my $basePath = "$ptdir$ptfile";
+ if (!(-d "content$basePath/")){
+ $basePath = "$ptdir";
+ }
+ $args{$headerKey} = pagetree("content$basePath/", $basePath);
+ }
}
}
- # $args{ttitle} = $ttitle;
# render sitemap stuff
- my $pagetree = ${args{headers}}{pagetree};
- if ($pagetree) {
- my($ptfile, $ptdir, $ptext) = fileparse($args{path}, qr/\.[^.]*/);
- my $basePath = "$ptdir$ptfile";
- if (!(-d "content$basePath/")){
- $basePath = "$ptdir";
- }
- $args{pagetree} = pagetree("content$basePath/", $basePath);
- }
+ # my $pagetree = ${args{headers}}{pagetree};
+ # if ($pagetree) {
+ # my($ptfile, $ptdir, $ptext) = fileparse($args{path}, qr/\.[^.]*/);
+ # my $basePath = "$ptdir$ptfile";
+ # if (!(-d "content$basePath/")){
+ # $basePath = "$ptdir";
+ # }
+ # $args{pagetree} = pagetree("content$basePath/", $basePath);
+ # }
# render tip box with reference to Confluence export
# if translation for a page is still pending