incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Fisher <dave2w...@comcast.net>
Subject [www] OOo Website Conversion (was: Re: Moving OOo web: results of fetch-all-web.sh)
Date Tue, 09 Aug 2011 01:07:46 GMT
Hi -

Progress.

On Aug 8, 2011, at 8:38 AM, Kay Schenk wrote:

> On 08/08/2011 08:29 AM, Dave Fisher wrote:
>> Hi Kay,
>> 
>> I was able to get HTML wrapped using the Apache CMS last night. I'm not ready to
commit anything yet. I'll summarize where I am and possible next steps.
>> 
>> In order to make progress the key was investigating the source for the {% %} template
tagging. This is found here:
>> 
>> cms/build/lib/Dotiac/DTL/Tag
>> 
>> I changed view.pm to include an html_page procedure
>> 
>> In path.pm I added a pattern for html wrapping.
>> 
>> our @patterns = (
>>         [qr!\.mdtext$!, single_narrative =>  { template =>  "single_narrative.html"
}],
>>         [qr!\.html$!, html_page =>  { template =>  "html_page.html" }],
>> ) ;
> 
> ah! good! So this can be parsed on a page by page basis? If so, super!
> 
> 
>> 
>> The template html_page.html looks a lot like single_narrative.html but adds an override
to the content block.
>> 
>> {% extends "skeleton.html" %}
>> {% block content %}{% autoescape off %}{{ content }}{% endautoescape %}{% endblock
%}

Now is this:

{% extends "skeleton.html" %}
  {% block content %}{% autoescape off %}{{ content }}{% endautoescape %}{% endblock %}
{$ endextends $}

>> 
>> We keep a single skeleton which is good.
> 
> This is great news! Thanks for your wonderful insights and work!

You are welcome. With a few tweaks things are committed and the process works!

> 
>> 
>> Next steps are
>> 
>> - blocks for javascript and css insertion.

For testing purposes I split the www/index.html into an index.style and shortened index.html.

I'm not sure if this is best or if the split needs to be done while processing the view. This
is a subject for tomorrow.

Also, this page needs a lot of work on styles to make it look like before. Kenai stores content
in places we may not have access to via the svn repos like "branding"

>> - controlling sidenav. The current html_page.html is not very good for the pages
that Carl modified in the download directory.

For all html wrapped content I now turn off the sidenav. For mdtext the sidenav remains.

>> - header and footer framework

For tomorrow.

>> - online cms editing of html

Confirmed the editing of html. There is syntax coloring in the CMS WebGUI.

>> - scripting of Kenai html into CMS compatible - stripping of headers and extraction
of javascript and css.

To be discussed. It depends on how many sets of special page styles are really needed. Here
is how it currently works:

Here is the script for wrapping the html:

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};
        }
    }

    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;
}

Which interacts with templates/skeleton.html

  <title>{% block title %}{{ headers.title }}{% endblock %}</title>
  
{% autoescape off %}{% if scriptstyle %}{{ scriptstyle }}{% else %}{% include "scriptstyle.html"%}{%
endif %}{% endautoescape %}

So you see there is a default location for css and javascript.

The question is if there should be a set of selectable javascript/css templates, or if we
want to have these files be next to the file they apply to.

If we go to a specific set of templates method then we would change to:

{% autoescape off %}{% if scriptstyle %}{% include scriptstyle %}{% else %}{% include "scriptstyle.html"%}{%
endif %}{% endautoescape %}

Regards,
Dave


>> 
>> Regards,
>> Dave
>> 
>> On Aug 7, 2011, at 8:35 AM, Kay Schenk wrote:
>> 
>>> 
>>> 
>>> On 08/06/2011 09:03 PM, Dave Fisher wrote:
>>>> 
>>>> On Aug 4, 2011, at 12:16 PM, Kay Schenk wrote:
>>>> 
>>>>> I just wanted to report that this script worked just fine as near
>>>>> as I can tell.
>>>> 
>>>> Great. When I did the work for the www and download project I used a
>>>> different script which is still a stub as there was a hand editing
>>>> step to correct inconsistent line endings.
>>>> 
>>>>> The post about the script  has shown up in several places, but
>>>>> placing it as its own subject seemed appropriate.
>>> 
>>> yes...it got buried! :)
>>> 
>>>>> 
>>>>> Now back to investigating headers/footers.
>>>> 
>>>> I added a page to the wiki with some of my thoughts today about
>>>> headers and footers for the websites including the MediaWiki and User
>>>> Forums.
>>>> 
>>>> https://cwiki.apache.org/confluence/display/OOOUSERS/Website+Template
>>> 
>>> good! this needs regular updating as we iron out issues...I'll take a look
>>>> 
>>>> I am going to try a new template/skeleton.html tomorrow.
>>>> 
>>>> Regards, Dave
>>> 
>>> OK, I'm going to try to start "migrating" some of the old OO.o pages to the "www"
area on Apache today. I won't link them in to anything. This will just be for my education
at this point.
>>> 
>>> So, I am kind of wondering why you took "download" off the main line so to speak.
Thoughts?
>>> 
>>> As far as I'm concerned given the current layout and "incubator" status, we might
consider just leaving the side navigation items as they are or augmenting them somewhat, and
using this existing "template" instead of the more involved "top tab" business currently with
the OO.o site. But...we'll see what we think after a few "tests" I guess.
>>> 
>>> later...
>>>> 
>>>>> 
>>>>> --
>>>>> ---------------------------------------------------------------------------------------
>>>>> 
>>>>> 
>>> MzK
>>>>> 
>>>>> "If you can keep your head when all others around you are losing
>>>>> theirs - maybe you don't fully understand the situation!" --
>>>>> Unknown
>>>> 
>>> 
>>> --
>>> ------------------------------------------------------------------------
>>> MzK
>>> 
>>> "Those who love deeply never grow old;
>>> they may die of old age, but they die young."
>>>                        -- Sir Arthur Pinero
>> 
> 
> -- 
> ------------------------------------------------------------------------
> MzK
> 
> "Those who love deeply never grow old;
> they may die of old age, but they die young."
>                        -- Sir Arthur Pinero


Mime
View raw message