incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r1160503 [2/2] - in /incubator/odf/site/trunk: ./ cgi-bin/ content/ content/odftoolkit/ content/odftoolkit/css/ content/odftoolkit/docs/ content/odftoolkit/docs/governance/ content/odftoolkit/images/ lib/ templates/
Date Mon, 22 Aug 2011 23:48:05 GMT
Added: incubator/odf/site/trunk/content/odftoolkit/svn-basics.mdtext
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/svn-basics.mdtext?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/svn-basics.mdtext (added)
+++ incubator/odf/site/trunk/content/odftoolkit/svn-basics.mdtext Mon Aug 22 23:48:04 2011
@@ -0,0 +1,267 @@
+Title: Subversion Basics
+Notice:    Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+           .
+             http://www.apache.org/licenses/LICENSE-2.0
+           .
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.
+
+We use [Apache Subversion][1] for version control. For a complete reference on Subversion
see the [Subversion Book][2]. You can [browse our repository][3] in your web browser.
+
+This page gives instructions on performing basic development tasks using the Subversion Command-Line
Client. This instruction assumes you have Apache Subversion installed.
+
+* [Overview](#overview) 
+* [Sub-commands and Abbreviations](#sub-commands_and_abbreviations) 
+* [Client Configuration](#client_configuration)
+* [Repository Layout](#repository_layout)
+* [Getting the source code](#getting_the_source_code)
+* [Basic Work Cycle](#basic_work_cycle)
+* [Committing Changes By Others](#committing_changes_by_others)
+* [Creating and Submitting Patches](#creating_and_submitting_patches)
+* [Further Information](#further_information)
+
+## Overview
+
+You begin using Subversion by copying a directory from a remote repository to a local directory
on your file system. This is known as a checkout of a working copy.
+
+Subversion uses a copy-modify-merge model meaning that you can add and edit files and directories
in your working copy like any other files on your system, but you should use subversion commands
for everything else such as `svn copy` and `svn move` instead of the operating system commands.
+
+## Sub-commands and Abbreviations
+
+Subversion commands can be run from a command shell such as Bash on Linux. The subversion
client command is `svn` followed by optional sub-commands, options, and arguments.
+
+Show the program version and modules
+
+    $ svn --version
+
+Run a sub-command
+
+    $ svn <subcommand> [options] [args]
+
+Most sub-commands take file and/or directory arguments, recursing on the directories. If
no arguments are supplied to such a command, it recurses on the current directory (inclusive)
by default. (from `svn help`)
+
+The following is only a partial list of sub-commands relating to this instruction. For a
complete list, see the [Subversion Book][2], or use `svn help`.
+
+* `add` - Schedule a new file or directory (including contained files) for inclusion in the
repository
+* `checkout`, `co` - Create a local working copy of a remote repository
+* `commit`, `ci` - Commit (check in) local changes to the repository
+* `copy`, `cp` - Copy one or more files in a working copy or in the repository
+* `delete`, `del`, `remove`, `rm` - Items specified are scheduled for deletion upon the next
commit. Working copy files not yet committed are deleted immediately.
+* `diff`, `di` - Displays differences in files from the directory
+* `help`, `?`, `h` - Subversion help and help on sub-commands
+* `move`, `mv`, `rename`, `ren` - Moves files or directories in your working copy or repository
+* `resolve` - Resolve conflicts on working copy files or directories
+* `revert` - Undo all local edits or optionally a file or directory
+* `status` - Print the status of working copy files and directories
+* `update` - Bring changes from the repository into your working copy
+
+## Client Configuration
+
+Committers need to [configure their Subversion client][6] to handle the differences in line
endings of text files on different operating systems.
+
+There are instances where Subversion may need to open an editor. You need to have the environment
variable EDITOR set to the editor you would like to use. To set it for the current terminal
session in Bash (your path may differ):
+
+    $ export EDITOR=/usr/bin/vim
+
+## Repository Layout
+
+The Odf repository layout uses the following top-level directories `branches`, `site`, `tags`,
and `trunk`.
+
+* `branches` - Contains branches used for continued development of a specific version, experimental
versions, or for  developing features to be merged into the trunk or a branch later. (needs
examples)
+* `site` - Contains the web site source code. Also contains it's own trunk directory.
+* `tags` - Contains specific versions of the project. These tags are not to be revised. (needs
examples)
+* `trunk` - Contains the current source code.
+For more information see the [Contributors Tech Guide][7].
+
+## Getting the source code
+
+From the parent directory of where you want the working copy. In this example the `odf-trunk`
directory will be created if it does not exist.
+
+    $ svn co https://svn.apache.org/repos/asf/incubator/odf/trunk odf-trunk
+    A    odf-trunk/tools
+    A    odf-trunk/tools/dev
+    A    odf-trunk/tools/dev/fetch-all-cws.sh
+    A    odf-trunk/tools/dev/cws-list.txt
+    A    odf-trunk/tools/dev/fetch-all-web.sh
+    A    odf-trunk/tools/dev/web-list.txt
+    A    odf-trunk/tools/dev/single-hg.sh
+    Checked out revision 1145818.
+
+"A" indicates file or directory is "Added" to working copy
+
+## Basic Work Cycle
+
+* Update your working copy - For this you use the `svn update` command
+*  Make changes - For this you may edit files in an editor, or use the `svn add`, `svn delete`,
`svn copy`, `svn-move` commands
+* Review Changes - For this you use the `svn status` and `svn diff`
+* Fix Mistakes - Make additional edits to files or you can use the `svn revert` to restore
files or directories to an unmodified state
+* Resolve Conflicts - There is a chance others have committed changes while you have been
changing your working copy. You should run the `svn update` command to bring your copy up
to date. This may create a local conflict where someone may have added a file with a name
that you also want to add, or may have made changes to the same line of a file as you. For
this use the `svn resolve` command.
+* Publish Changes - For this you use the `svn commit` command
+
+### Adding a File
+
+After creating the file "test-file.txt" in the working copy.
+
+    $ svn status
+    ?       test-file.txt
+
+? indicates test-file.txt is not under version control
+
+### Scheduling a file for addition to repository
+
+    $ svn add test-file.txt
+    A         test-file.txt
+
+    $ svn status
+    A       test-file.txt
+
+"A" indicates file is scheduled for addition
+
+### Running a diff
+
+    $ svn diff
+    Index: test-file.txt
+    ===================================================================
+    --- test-file.txt	(revision 0)
+    +++ test-file.txt	(revision 0)
+    @@ -0,0 +1 @@
+    +This is a test file for svn-basics.
+
+    Property changes on: test-file.txt
+    ___________________________________________________________________
+    Added: svn:eol-style
+       + native
+
+### Committing a file
+
+    $ svn commit test-file.txt -m "added test-file.txt"
+    Adding         test-file.txt
+    Transmitting file data .
+    Committed revision 2.
+
+### Update the working copy
+
+    $ svn update
+    U    test-file.txt
+    Updated to revision 3.
+
+"U" indicates an "Update" to a file or directory
+
+Modify the file (this example uses the vim editor)
+
+    $ vim test-file.txt
+
+### Check the Status
+
+    $ svn status
+    M       test-file.txt
+
+"M" indicates the file has been "Modified"
+
+    $ svn diff
+    Index: test-file.txt
+    ===================================================================
+    --- test-file.txt	(revision 3)
+    +++ test-file.txt	(working copy)
+    @@ -1,2 +1,3 @@
+     This is a test file for svn-basics.
+     This is a new line added by someone else.
+    +This line added by me.
+
+### Resolving Conflicts
+
+Suppose someone edits the same line as you before you commit
+
+    $ svn update
+    Conflict discovered in 'test-file.txt'.
+    Select: (p) postpone, (df) diff-full, (e) edit,
+            (mc) mine-conflict, (tc) theirs-conflict,
+            (s) show all options: 
+
+This is just like if you had ran the `svn resolve` command
+
+Selecting `df` displays this:
+
+    --- .svn/text-base/test-file.txt.svn-base	Sun Jul 17 17:38:52 2011
+    +++ .svn/tmp/test-file.txt.tmp	Sun Jul 17 21:35:09 2011
+    @@ -1,2 +1,7 @@
+     This is a test file for svn-basics.
+     This is a new line added by someone else.
+    +<<<<<<< .mine
+    +This line added by me.
+    +=======
+    +This line is added by someone else also.
+    +>>>>>>> .r4
+    Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved,
+            (mc) mine-conflict, (tc) theirs-conflict,
+            (s) show all options:
+
+If you choose `e`, Subversion will launch an editor with both sets of changes included for
you to edit. You can save your changes in the editor and then select `r` (for resolved).
+
+    G    test-file.txt
+    Updated to revision 4.
+
+"G" indicates "merGed"
+
+### Committing the Changes
+
+Only Committers can commit directly to the repository. The following example shows using
your Apache ID and password.
+
+    $ svn commit test-file.txt --username your-name --password your-password \
+      -m "added new line"
+    Sending        test-file.txt
+    Transmitting file data .
+    Committed revision 5.
+
+For further information see the [Basic Work Cycle][8] page from [Subversion Book][2].
+
+## Committing Changes By Others
+
+See the [Applying Patches][9] section of the Committer FAQ page.
+
+Example similar to one on Committer FAQ:
+
+    Issue #43835:
+    Added some cool new feature.
+    Submitted by: John Doe <john.doe.at.null.org>
+
+Using the `-m (--message)` option only allows a single line log message. To commit a multi-line
message use the `-F (--file)` option (with a previously created file) or use neither -m or
-F and an editor will be started.
+
+## Creating and Submitting Patches
+
+See the [Sending in Patches][10] section on the Contributors Tech Guide page.
+
+Create the patch file from `svn diff` where `your-patch-name.patch` is the full path to the
patch file to create.
+
+    svn diff > your-patch-name.patch
+
+## Further Information
+
+For more information see: 
+
+* [Apache Subversion Project][1]
+* [Subversion Book][2]
+* [Apache Developer Information][11]
+
+
+[1]: http://subversion.apache.org
+[2]: http://svnbook.red-bean.com
+[3]: http://svn.apache.org/viewvc/incubator/odf/trunk
+[4]: https://svn.apache.org/repos/asf/incubator/odf
+[5]: http://www.apache.org/dev/version-control.html
+[6]: http://www.apache.org/dev/version-control.html#https-svn-config
+[7]: http://www.apache.org/dev/contributors.html#svnbasics
+[8]: http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html
+[9]: http://www.apache.org/dev/committers.html#applying-patches
+[10]: http://www.apache.org/dev/contributors.html#patches
+[11]: http://www.apache.org/dev/

Propchange: incubator/odf/site/trunk/content/odftoolkit/svn-basics.mdtext
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/content/odftoolkit/website-local.mdtext
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/website-local.mdtext?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/website-local.mdtext (added)
+++ incubator/odf/site/trunk/content/odftoolkit/website-local.mdtext Mon Aug 22 23:48:04 2011
@@ -0,0 +1,140 @@
+Title: Website Development
+Notice:    Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+           .
+             http://www.apache.org/licenses/LICENSE-2.0
+           .
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.
+
+We use [Apache Subversion][1] for version control. You can [browse our 
+repository][2] in your web browser.
+
+Quick editing of the site is available for committers using the Apache CMS
+[from your browser.][6]
+
+This page gives instructions on doing website development on your local computer.
+
+* [Setup](#setup) - How to download the Odf project site repos and setup the Apache CMS.
+* [Directory Layout](#directory_layout) - Where to find the content, templates, and scripts.
+* [Local Development](#local_development) - How to build and test locally.
+* [Submitting Your Results](#submitting_your_results) - How to contribute your edits.
+
+## Setup
+
+### Create a directory on your computer.
+
+    mkdir odf-site
+    cd odf-site
+
+### Download the svn repos for the Odf site.
+
+    svn co https://svn.apache.org/repos/asf/incubator/odf/site/trunk site
+
+### Download the svn repos for the Apache CMS.
+
+    svn co https://svn.apache.org/repos/infra/websites/cms/ cms
+
+
+### Install Python dependencies.
+
+Adapted from the [Apache CMS Reference][3]
+
+The easiest way to install the dependencies is to use Python setuptools.
+
+#### Check your version of Python
+
+    python --version
+
+#### Follow the installation instructions for [setuptools][4].
+
+#### Install dependencies
+
+    sudo easy_install Pygments
+    sudo easy_install ElementTree
+    sudo easy_install Markdown
+
+## Directory Layout
+
+#### Content directory
+
+The `site/content/odftoolkit` directory contains web content - markdown, html, javascript,
css, images and other files. Files that do not fit recognized patterns from `site/lib/path.pm`
are copied as is to the web site during the build.
+
+#### Templates directory
+
+The `site/templates` directory contains the html skeletons used during the site build.
+
+* `skeleton.html` - our current html page template.
+* `sidenav.mdtext` - markdown of the side navigation panel.
+
+#### Lib directory
+
+The `site/lib` directory contains two python modules that determine how content files are
processed during the site build.
+
+* `path.pm` - maps file patterns like `.mdtext` into the view building routines. We can expand
to cover other patterns.
+* `view.pm` - a set of python subroutines for converting content into web pages.
+
+#### Build tools
+
+You can find the CMS build tools in the `cms` directory.
+
+* `cms/build/` - perl scripts for building the site and markdown extensions.
+* `cms/conversion-utilities/` - scripts used by various projects for conversion including
`cwiki` conversion.
+* `cms/webgui/` - the webgui behind the `bookmarklet`.
+
+These can be extended locally. Before any changes become part of our process they will need
to be cleared with Apache Infrastructure. We'll need to submit patches. These should be additive
or be bug fixes.
+
+## Local Development
+
+### Edit the site
+
+Using your favorite editors edit the site content, templates, and lib scripts.
+
+### Python Markdown Daemon
+
+Start the Python Markdown daemon.
+
+    export MARKDOWN_SOCKET=`pwd`/markdown.socket PYTHONPATH=`pwd`
+    python markdownd.py
+
+### Build the site.
+
+    cms/build/build_site.pl --source-base site --target-base www
+
+### Copy the site to your computer's web server.
+
+On my Mac:
+
+    sudo scp -rp www/content/odftoolkit /Library/WebServer/Documents/.
+
+The site is then available with [http://localhost/odftoolkit/][5].
+
+## Submitting your results.
+
+### Committer
+
+Do the appropriate combination of svn status, svn add, and svn commits. Commits will cause
staging rebuilds.
+See [How to Edit the ODF Toolkit Website][6]
+
+### Contributor
+
+(Add instructions on creating patches.)
+
+For further information see the [Apache Source Code Repository][7] page.
+
+[1]: http://subversion.apache.org
+[2]: http://svn.apache.org/viewvc/incubator/odf/site/trunk
+[3]: http://www.apache.org/dev/cmsref.html#local-build
+[4]: http://pypi.python.org/pypi/setuptools
+[5]: http://localhost/odftoolkit
+[6]: docs/edit-cms.html
+[7]: http://www.apache.org/dev/version-control.html
\ No newline at end of file

Propchange: incubator/odf/site/trunk/content/odftoolkit/website-local.mdtext
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/lib/path.pm
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/lib/path.pm?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/lib/path.pm (added)
+++ incubator/odf/site/trunk/lib/path.pm Mon Aug 22 23:48:04 2011
@@ -0,0 +1,37 @@
+package path;
+
+# taken from django's url.py
+
+our @patterns = (
+	[qr!\.mdtext$!, single_narrative => { template => "single_narrative.html" }],
+	[qr!\.html$!, html_page => { template => "html_page.html" }],
+) ;
+
+# for specifying interdependencies between files
+
+our %dependencies = (
+#    "/stanbol/sitemap.html" => [ grep s!^content!!, glob "content/stanbol/*.mdtext" ],
+);
+
+1;
+
+=head1 LICENSE
+
+           Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+
+             http://www.apache.org/licenses/LICENSE-2.0
+
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.
+
+

Propchange: incubator/odf/site/trunk/lib/path.pm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/lib/view.pm?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/lib/view.pm (added)
+++ incubator/odf/site/trunk/lib/view.pm Mon Aug 22 23:48:04 2011
@@ -0,0 +1,277 @@
+package view;
+
+#
+# BUILD CONSTRAINT:  all views must return $content, $extension.
+# additional return values (as seen below) are optional.  However,
+# careful use of symlinks and dependency management in path.pm can
+# resolve most issues with this constraint.
+#
+
+use strict;
+use warnings;
+use Dotiac::DTL qw/Template *TEMPLATE_DIRS/;
+use Dotiac::DTL::Addon::markup;
+use ASF::Util qw/read_text_file shuffle/;
+use File::Temp qw/tempfile/;
+use LWP::Simple;
+
+push our @TEMPLATE_DIRS, "templates";
+
+# This is most widely used view.  It takes a
+# 'template' argument and a 'path' argument.
+# Assuming the path ends in foo.mdtext, any files
+# like foo.page/bar.mdtext will be parsed and
+# passed to the template in the "bar" (hash)
+# variable.
+
+sub single_narrative {
+    my %args = @_;
+    my %styleargs = @_;
+    my $file = "content$args{path}";
+    my $template = $args{template};
+    $args{path} =~ s/\.mdtext$/\.html/;
+    $args{breadcrumbs} = breadcrumbs($args{path});
+
+    read_text_file $file, \%args;
+
+    my $page_path = $file;
+    $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};
+        }
+    }
+    
+    $args{content} = sort_tables($args{content});
+    $args{sidenav} = 1;
+
+    my $style_path = $file;
+    $style_path =~ s/\.[^.]+$/.style/;
+    if (-f $style_path) {
+	read_text_file $style_path, \%styleargs;
+	$args{scriptstyle} = $styleargs{content};
+    }
+
+    return Template($template)->render(\%args), html => \%args;
+}
+
+# Has the same behavior as the above for foo.page/bar.txt
+# files, parsing them into a bar variable for the template.
+# Otherwise presumes the template is the path.
+
+sub news_page {
+    my %args = @_;
+    my $template = "content$args{path}";
+    $args{breadcrumbs} = breadcrumbs($args{path});
+
+    my $page_path = $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;
+}
+
+# This view is used to wrap html.  It takes a
+# 'template' argument and a 'path' argument.
+# Assuming the path ends in foo.html, any files
+# like foo.page/bar.mdtext will be parsed and
+# passed to the template in the "bar" (hash)
+# variable.
+
+sub html_page {
+    my %args = @_;
+    my %styleargs = @_;
+    my $file = "content$args{path}";
+    my $template = $args{template};
+    $args{breadcrumbs} = breadcrumbs($args{path});
+
+    read_text_file $file, \%args;
+
+    my $page_path = $file;
+    $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};
+        }
+    }
+
+    $args{header} = `sed -n '/<head>/,/<\\/head>/p' ${file} | sed -e '1s/.*<head>//'
-e 's/<\\/head>.*//'`;
+    $args{content} = `sed -n '/<body>/,/<\\/body>/p' ${file} | sed -e '1s/.*<body>//'
-e "s/<\\/body>.*//"`;
+
+    return Template($template)->render(\%args), html => \%args;
+}
+
+sub sitemap {
+    my %args = @_;
+    my $template = "content$args{path}";
+    $args{breadcrumbs} .= breadcrumbs($args{path});
+    my $dir = $template;
+    $dir =~ s!/[^/]+$!!;
+    opendir my $dh, $dir or die "Can't opendir $dir: $!\n";
+    my %data;
+    for (map "$dir/$_", grep $_ ne "." && $_ ne ".." && $_ ne ".svn", readdir
$dh) {
+        if (-f and /\.mdtext$/) {
+            my $file = $_;
+            $file =~ s/^content//;
+            no warnings 'once';
+            for my $p (@path::patterns) {
+                my ($re, $method, $args) = @$p;
+                next unless $file =~ $re;
+                my $s = view->can($method) or die "Can't locate method: $method\n";
+                my ($content, $ext, $vars) = $s->(path => $file, %$args);
+                $file =~ s/\.mdtext$/.$ext/;
+                $data{$file} = $vars;
+                last;
+            }
+        }
+    }
+
+    my $content = "";
+
+    for (sort keys %data) {
+        $content .= "- [$data{$_}->{headers}->{title}]($_)\n";
+        for my $hdr (grep /^#/, split "\n", $data{$_}->{content}) {
+            $hdr =~ /^(#+)\s+([^#]+)?\s+\1\s+\{#([^}]+)\}$/ or next;
+            my $level = length $1;
+            $level *= 4;
+            $content .= " " x $level;
+            $content .= "- [$2]($_#$3)\n";
+        }
+    }
+    $args{content} = $content;
+    return Template($template)->render(\%args), html => \%args;
+}
+
+sub exports {
+    my %args = @_;
+    my $template = "content$args{path}";
+    $args{breadcrumbs} = breadcrumbs($args{path});
+
+    my $page_path = $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};
+        }
+        $args{table} = `xsltproc $page_path/eccnmatrix.xsl $page_path/eccnmatrix.xml`;
+
+    }
+
+    return Template($template)->render(\%args), html => \%args;
+}
+
+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;
+}
+
+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;
+}
+
+sub breadcrumbs {
+    my @path = split m!/!, shift;
+    pop @path;
+    my @rv;
+    my $relpath = "";
+    for (@path) {
+        $relpath .= "$_/";
+        $_ ||= "Home";
+        push @rv, qq(<a href="$relpath">\u$_</a>);
+    }
+    return join "&nbsp;&raquo&nbsp;", @rv;
+}
+
+# arbitrary number of tables supported, but only one col per table may be sorted
+
+sub sort_tables {
+    my @orig = split /\n/, shift, -1;
+    my @out;
+    while (defined(local $_ = shift @orig))  {
+        push @out, $_;
+        /^(\|[ :vn^-]+)+\|$/ or next;
+        my($data, $col, $direction, $cur, $numeric);
+        $cur = 0;
+        while (/\|([ :vn^-]+)/g) {
+            $data = $1;
+            if ($data =~ tr/v/v/) {
+                $col = $cur;
+                $direction = -1;
+                last;
+            }
+            elsif ($data =~ tr/^/^/) {
+                $col = $cur;
+                $direction = 1;
+                last;
+            }
+            $cur++;
+        }
+        unless (defined $col) {
+            push @out, shift @orig while @orig and $orig[0] =~ /^\|/;
+            next;
+        }
+        $numeric = 1 if $data =~ tr/n/n/;
+        my @rows;
+        push @rows, [split /\s*\|\s*/, shift(@orig), -1]
+            while @orig and $orig[0] =~ /^\|/;
+        shift @$_, pop @$_ for @rows; # dump empty entries at ends
+        @rows = $numeric
+            ? sort { $a->[$col] <=> $b->[$col] } @rows
+            : sort { $a->[$col] cmp $b->[$col] } @rows;
+        @rows = reverse @rows if $direction == -1;
+        push @out, map "| " . join(" | ", @$_) . " |", @rows;
+    }
+
+    return join "\n", @out;
+}
+
+1;
+
+=head1 LICENSE
+
+           Licensed to the Apache Software Foundation (ASF) under one
+           or more contributor license agreements.  See the NOTICE file
+           distributed with this work for additional information
+           regarding copyright ownership.  The ASF licenses this file
+           to you under the Apache License, Version 2.0 (the
+           "License"); you may not use this file except in compliance
+           with the License.  You may obtain a copy of the License at
+
+             http://www.apache.org/licenses/LICENSE-2.0
+
+           Unless required by applicable law or agreed to in writing,
+           software distributed under the License is distributed on an
+           "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+           KIND, either express or implied.  See the License for the
+           specific language governing permissions and limitations
+           under the License.

Propchange: incubator/odf/site/trunk/lib/view.pm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/templates/html_page.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/templates/html_page.html?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/templates/html_page.html (added)
+++ incubator/odf/site/trunk/templates/html_page.html Mon Aug 22 23:48:04 2011
@@ -0,0 +1,3 @@
+{% extends "skeleton.html" %}
+  {% block content %}{% autoescape off %}{{ content }}{% endautoescape %}{% endblock %}
+{$ endextends $}

Propchange: incubator/odf/site/trunk/templates/html_page.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/templates/sidenav.mdtext
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/templates/sidenav.mdtext?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/templates/sidenav.mdtext (added)
+++ incubator/odf/site/trunk/templates/sidenav.mdtext Mon Aug 22 23:48:04 2011
@@ -0,0 +1,30 @@
+# General
+
+  - [About](/odftoolkit/index.html)
+  - [Incubator page](http://incubator.apache.org/projects/odftoolkit.html)
+  - [License](/odftoolkit/license.html)
+
+# Community
+
+  - [Get Involved](/odftoolkit/get-involved.html)
+  - [Mailing Lists](/odftoolkit/mailing-lists.html)
+  - [People](/odftoolkit/people.html)
+  - [Community FAQs](/odftoolkit/community-faqs.html)
+
+# Development
+
+  - [Source Code](/odftoolkit/source.html)
+  - [Website](/odftoolkit/website-local.html)
+  - [Developer FAQs](/odftoolkit/developer-faqs.html)
+  
+# PPMC
+
+  - [PPMC FAQs](/odftoolkit/ppmc-faqs.html)  
+
+# ASF
+
+  - [Apache Software Foundation](http://www.apache.org)
+  - [Thanks](http://www.apache.org/foundation/thanks.html)
+  - [Become a Sponsor](http://www.apache.org/foundation/sponsorship.html)
+  
+

Propchange: incubator/odf/site/trunk/templates/sidenav.mdtext
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/templates/single_narrative.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/templates/single_narrative.html?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/templates/single_narrative.html (added)
+++ incubator/odf/site/trunk/templates/single_narrative.html Mon Aug 22 23:48:04 2011
@@ -0,0 +1 @@
+{% extends "skeleton.html" %}

Propchange: incubator/odf/site/trunk/templates/single_narrative.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/odf/site/trunk/templates/skeleton.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/templates/skeleton.html?rev=1160503&view=auto
==============================================================================
--- incubator/odf/site/trunk/templates/skeleton.html (added)
+++ incubator/odf/site/trunk/templates/skeleton.html Mon Aug 22 23:48:04 2011
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
+{% if header %}
+{% autoescape off %}{{ header }}{% endautoescape %}{% else %}
+<title>{% block title %}{{ headers.title }}{% endblock %}</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+{% endif %}
+</head>
+
+<body>
+  <div id="banner">
+   <!-- <div id="bannerleft"><a alt="Apache ODF Toolkit (incubating)" href="http://incubator.apache.org/odftoolkit/">
+      <img id="logo" alt="Apache ODF Toolkit (Incubating)" src="/odftoolkit/images/ooo-logo.png"/></a></div>
-->
+    <div id="bannerright"><a alt="Apache Incubator" href="http://incubator.apache.org">
+      <img id="asf-logo" alt="Apache Incubator" src="/odftoolkit/images/apache-incubator-logo.png"/></a></div>
+   <div id="bannercenter"><br/>&nbsp;&nbsp;&nbsp;&nbsp;Apache
ODF Toolkit (incubating)</div>
+  </div>
+  {% if sidenav %}
+  <div id="sidenav">
+    {% filter markdown %}{% include "sidenav.mdtext" %}{% endfilter %}
+  </div>
+  <div id="contenta">
+  {% else %}
+  <div id="content">
+  {% endif %}
+    {% block title %}{% if headers.title %}<h1 class="title">{{ headers.title }}</h1>{%
endif %}{% endblock %}
+    {% block content %}{{ content|markdown }}{% endblock %}
+  </div>
+
+  <div id="footera">
+    <div id="poweredby">
+      <p><img src="/odftoolkit/images/feather-small.gif"/><br/>Powered
by the Apache CMS.</p>
+    </div>
+    <div id="copyrighta">
+      <p>
+	Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation
(ASF), sponsored by the Apache Incubator.
+	Incubation is required of all newly accepted projects until a further review indicates that
the infrastructure, communications, and
+	decision making process	have stabilized in a manner consistent with other successful ASF
projects. While incubation status is
+	not necessarily a reflection of the completeness or stability of the code, it does indicate
that the project has
+	yet to be fully endorsed by the ASF.</p>
+      <p>
+	Copyright &copy; 2011 The Apache Software Foundation Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache
License, Version 2.0</a>.
+	<a href="/openofficeorg/contact.html">Contact Us</a>
+	<br />Apache and the Apache feather logos are trademarks of The Apache Software Foundation.
+	<br />Other names appearing on the site may be trademarks of their respective owners.
+      </p>
+    </div>
+  </div>
+
+</body>
+</html>

Propchange: incubator/odf/site/trunk/templates/skeleton.html
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message