[prev in list] [next in list] [prev in thread] [next in thread]
List: quanta
Subject: Re: [Quanta] HTML blocks or include files
From: Andras Mantia <amantia () kde ! org>
Date: 2005-06-27 20:58:07
Message-ID: 200506272358.12840.amantia () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Monday 27 June 2005 16:26, Holger Zebner wrote:
> > To my knowledge, Quanta doesn't have that feature exactly. But as
> > you said, it's basically just a complex search and replace. So
> > what's to stop you from doing it that way?
>
> If you imagine a news item or something like that which changes often
> thenit would be nice to be able to change just the file which
> contains the news and not to define the search&replace.
> Just a tool to speed things up.
The fact that Quanta doesn't do it right now (for several reasons, one
being that SSI is better, safer), doesn't mean that you cannot extend
Quanta to do it, if you know some scripting language. bash and some
extra tools (sed, grep, awk) might be enough, but python, perl and so
is also good. What you would need to do is to define your own rules
where a template begins and ends, like you said:
<!--INC:"myblock.inc","13.06.2005 00:06:22"-->
BLOCKTEXT
<!--/INC:"myblock.inc"-->
Write a script which replaces all the text between the two <!-- -->
lines with the content of myblock.inc if the date there is older than
the timestamp of the myblock.inc. How to do it? You can query the
document content from Quanta via DCOP methods and you can even modify
the content of the document that's in Quanta from inside the script!
kdcop is your friend finding out the interfaces and the methods.
But you can do it in your own language as well, without DCOP in this
case as you usually would like to do the replace before opening a
document or after saving it, not while it is loaded.
So assume you wrote your script which is doing the replace on it's own
in a file. Now create a script action for the script, assign this
script to some event (like "After document save") and whenever you save
a document, the BLOCKTEXT will be updated.
What is more interesting is to write a script that detects if the saved
file is myblock.inc and grep through the project files and update all
of them. The procedure is the same: write the script, create a script
action, assign it to the save event.
Are you interested in doing it? I will help you to configure the scripts
and to teach you how to pass the arguments to the scripts. Of course,
first read the handbook for 3.4.0, as that has some information about
scripts, script actions and events.
Andras
--
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
[Attachment #5 (application/pgp-signature)]
_______________________________________________
Quanta mailing list
Quanta@mail.kde.org
https://mail.kde.org/mailman/listinfo/quanta
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic