incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Fisher <dave2w...@comcast.net>
Subject Re: svn commit: r1142819 - /incubator/ooo/site/trunk/content/openofficeorg/people.mdtext
Date Tue, 05 Jul 2011 20:57:36 GMT
Hi Joe,

Thanks for all the CMS tips.

I see from this commit that # {#foo} is inserted into the table header html as <th id="foo">.

Would # {.bar} add class="bar"?

Also, thanks for pointing at the www.apache.org/dev and other examples.

The view.pm we have in the project has a number of functions that are used in various ways
by the apache website.

For example:

sub fetch_doap_url_list {
    my $xml = get "http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/files.xml"
        or die "Can't get doap file list: $!\n";
    my ($fh, $filename) = tempfile("XXXXXX");
    print $fh $xml;
    close $fh;
    chomp(my @urls = grep /^http/, `xsltproc lib/list2urls.xsl $filename`);
    unlink $filename;
    shuffle \@urls;
    return @urls;
}

The sitemap view routine processes the basic page, the attachments in a foo.page directory.
($page_path). It then executes a fetch of information about all Apache TLPs.

sub sitemap {
    my %args = @_;
    my $template = "content$args{path}";
    $args{breadcrumbs} .= breadcrumbs($args{path});
    my $dir = $template;
    $page_path =~ s/\.[^.]+$/.page/;
    if (-d $page_path) {
        for my $f (grep -f, glob "$page_path/*.mdtext") {
            $f =~ m!/([^/]+)\.mdtext$! or die "Bad filename: $f\n";
            $args{$1} = {};
            read_text_file $f, $args{$1};
        }
    }

    for ((fetch_doap_url_list())[0..2]) {
        push @{$args{projects}}, parse_doap($_);
    }

    return Template($template)->render(\%args), html => \%args;
}

The doap for the three selected projects is parsed and transformed.

sub parse_doap {
    my $url = shift;
    my $doap = get $url or die "Can't get $url: $!\n";
    my ($fh, $filename) = tempfile("XXXXXX");
    print $fh $doap;
    close $fh;
    my $result = eval `xsltproc lib/doap2perl.xsl $filename`;
    unlink $filename;
    return $result;
}

The markup template for http://www.apache.org/index.html has the following markup to handle
the three random featured projects!

    <div id="featured_switcher" class="grid_16">
      <ul>
        <li id="label">Featured Projects &raquo;</li>
                                {% for e in projects %}
        <li id='switcher_{% cycle "1" "2" "3" %}'><a href="{{ e.url }}"
                                title="Learn more about {{ e.name }}">{{ e.name
                                }} </a></li>
                                {% endfor %}
      </ul>
                </div>
    <div id="featured_intro" class="grid_16">
      <div class="grid_6">
        {{ project_info.content|markdown }}
      </div>
            <div id="featured_projs" class="grid_10">
      <ul>
                                {% for e in projects %}
        <li id='feature_{% cycle "1" "2" "3" %}'>
          <h4><a href="{{ e.url }}">{{ e.name }}</a></h4>
                                        <p>{{ e.shortdesc }}</p>
          <p class="description">{{ e.description|truncatewords:100
                                        }}</p>
        </li>
                                {% endfor %}
      </ul>
      </div>
    </div>

Pretty cool.

Regards,
Dave


On Jul 4, 2011, at 2:55 PM, joes@apache.org wrote:

> Author: joes
> Date: Mon Jul  4 21:55:54 2011
> New Revision: 1142819
> 
> URL: http://svn.apache.org/viewvc?rev=1142819&view=rev
> Log:
> make the association a bit clearer
> 
> Modified:
>    incubator/ooo/site/trunk/content/openofficeorg/people.mdtext
> 
> Modified: incubator/ooo/site/trunk/content/openofficeorg/people.mdtext
> URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/content/openofficeorg/people.mdtext?rev=1142819&r1=1142818&r2=1142819&view=diff
> ==============================================================================
> --- incubator/ooo/site/trunk/content/openofficeorg/people.mdtext (original)
> +++ incubator/ooo/site/trunk/content/openofficeorg/people.mdtext Mon Jul  4 21:55:54
2011
> @@ -20,7 +20,7 @@ Apache OpenOffice.org (Incubating) is a 
> is a partial list of contributors to the project, for a complete list you'd have
> to look at all contributors to our issue tracker, mailing list and version control.
> 
> -| Apache ID | Name                                      # {#name}| Home            
        | Skills/Interests |
> +| Apache ID | Name                                       # {#foo}| Home            
        | Skills/Interests |
> |^----------|----------------------------------------------------|--------------------------|------------------|
> | kahrens   | Kai Ahrens                                         | Hamburg, Germany 
       | C++, Java, Linux, Graphics core, Graphics filters, VCL, Presentation, Impress, Draw
|
> | bmcs      | Dave Barton                                        | Hobart, TAS, Australia
  | OpenOffice.org, User Support, Tutorials, Documentation, HTML, CSS, PHP, Javascript, C/C++,
Distribution. |
> 
> 


Mime
View raw message