ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xak <zfraz...@vsapartners.com>
Subject Re: Need help with REPLACING an SSI directive
Date Thu, 30 Apr 2009 22:08:40 GMT


Yeah, that is exactly what I want to do. Just somehow recognize the SSI
string in the HTML and then replace it with the actual file contents. 

I thought ANT would be nice because there are other tasks as part of the
publishing -- copying all files to new directories, concatenating CSS files,
compressing JavaScript files, etc. I guess PERL or Python would work with
all that too but I don't know those languages. ANT seemed more accessible
even if not totally appropriate.

Worst case, I can embed tokens in the HTML next to the SSIs, replace the
tokens, and then strip out the comments. But then I have the tokens visible
when working in SSI-mode. Not the worst thing in the world but I figured
there should be a way.

Thanks. Maybe I'll dive into another scripting option.

Zack



David Weintraub wrote:
> 
> I'm trying to figure out exactly what you need. You want to *insert*
> the file the ServerSide Include is referring to instead of using
> Server Side Includes?
> 
> I would think Ant would be an overkill in this case. A simple Perl or
> Python script would do exactly what you want and shouldn't take long
> to do.
> 
> The filter is mainly for replacing strings and not including whole
> files into other files.
> 
> On Thu, Apr 30, 2009 at 2:54 PM, xak <zfrazier@vsapartners.com> wrote:
>>
>> First off, I am very new to using ANT and I'n not a Java developer but my
>> needs are very simple ...
>>
>> I am creating a web site that is decently large but it must be static. So
>> I'm thinking that I can develop the site locally using server-side
>> includes
>> to avoid hardcoding all the navigation, etc. and then "publish" the site
>> using ANT where all the SSIs are replaced with the actual file contents.
>>
>> Replacing a token is easy enough but I don't know how to "regex" the
>> comment
>> syntax of the SSIs. Is that even the right approach? Can I use replace or
>> do
>> I need something else?
>>
>> This is in the SSI syntax in the HTML:
>>  <!--#include file="_includes/_html_head_open.html" -->
>>
>> I need to replace with ${html.head.open} as defined below:
>>   <loadfile property="html.head.open"
>> srcFile="${src}/_includes/_html_head_open.html" />
>>
>> So I need something like this where the token is the SSI:
>>   <replace dir="${output}" token="@html.head.open@"
>> value="${html.head.open}" />
>>
>> The most important thing here is to be able to develop the source files,
>> view them in the browser and then only at the end do a publish build
>> where
>> the SSIs are replaced. That's it.
>>
>> I know there are ANT tasks out there to turn various template markup into
>> HTML but that is overkill for my needs.
>>
>> Any assistance will be greatly appreciated.
>>
>> Zack
>> --
>> View this message in context:
>> http://www.nabble.com/Need-help-with-REPLACING-an-SSI-directive-tp23322263p23322263.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Need-help-with-REPLACING-an-SSI-directive-tp23322263p23325209.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message