From quanta Mon Jun 27 20:58:07 2005 From: Andras Mantia Date: Mon, 27 Jun 2005 20:58:07 +0000 To: quanta Subject: Re: [Quanta] HTML blocks or include files Message-Id: <200506272358.12840.amantia () kde ! org> X-MARC-Message: https://marc.info/?l=quanta&m=111990882606334 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1622959489==" --===============1622959489== Content-Type: multipart/signed; boundary="nextPart2929675.YNUtVSdbFo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2929675.YNUtVSdbFo Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 27 June 2005 16:26, Holger Zebner wrote: > > To my knowledge, Quanta doesn't have that feature exactly. =A0But as > > =A0you said, it's basically just a complex search and replace. =A0So > > =A0what'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=20 being that SSI is better, safer), doesn't mean that you cannot extend=20 Quanta to do it, if you know some scripting language. bash and some=20 extra tools (sed, grep, awk) might be enough, but python, perl and so=20 is also good. What you would need to do is to define your own rules=20 where a template begins and ends, like you said: BLOCKTEXT Write a script which replaces all the text between the two =20 lines with the content of myblock.inc if the date there is older than=20 the timestamp of the myblock.inc. How to do it? You can query the=20 document content from Quanta via DCOP methods and you can even modify=20 the content of the document that's in Quanta from inside the script!=20 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=20 case as you usually would like to do the replace before opening a=20 document or after saving it, not while it is loaded.=20 So assume you wrote your script which is doing the replace on it's own=20 in a file. Now create a script action for the script, assign this=20 script to some event (like "After document save") and whenever you save=20 a document, the BLOCKTEXT will be updated. What is more interesting is to write a script that detects if the saved=20 file is myblock.inc and grep through the project files and update all=20 of them. The procedure is the same: write the script, create a script=20 action, assign it to the save event. Are you interested in doing it? I will help you to configure the scripts=20 and to teach you how to pass the arguments to the scripts. Of course,=20 first read the handbook for 3.4.0, as that has some information about=20 scripts, script actions and events. Andras =2D-=20 Quanta Plus developer - http://quanta.kdewebdev.org K Desktop Environment - http://www.kde.org --nextPart2929675.YNUtVSdbFo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBCwGhkTQdfac6L/08RAiruAJ0XC1woi0TLmxq7XIet2DvKxUc/3gCgv7GQ zOCrMQau8CXaYW2QR8OHUlM= =DnT3 -----END PGP SIGNATURE----- --nextPart2929675.YNUtVSdbFo-- --===============1622959489== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Quanta mailing list Quanta@mail.kde.org https://mail.kde.org/mailman/listinfo/quanta --===============1622959489==--