[pmwiki-users] Questions about PTV and PTV mass edit

Petko Yotov 5ko at 5ko.fr
Wed Jul 3 22:15:24 PDT 2024


There is this recipe International PTVs that might work without 
mass-editing files:

   https://www.pmwiki.org/wiki/Cookbook/InternationalPTVs

I've put this recipe to the core candidates.

The bits that iPTVs don't work yet, for pagelist ordering, or in 
pagelist templates, should be made to work. :-)

Alternatively, we can refactor PageTextVar() to allow pre-processing of 
the page text before PTVs are extracted. This could allow you to define 
variable replacements removing the accents, so that a text is valid:

   édition : Larousse

Then in the wiki you use {$:edition} without accents instead of 
{$:édition}.


Note that in both cases FastCache may not detect a change in config.php 
that modifies the pages HTML without the pages being modified.

As for the mass editing, I second Gregor's implied suggestion to not do 
this directly on the live website. I'd also recommend having a backup 
snapshot from before the operation, ready to be restored.

Petko

On 04/07/2024 00:39, ABClf wrote:
> I understand your answer, thank you.
> Here are more informations, to complete my question, in case someone 
> has advice.
> 
> At first stage, what I am planning to do are very basic and tiny 
> replacements ;
> for example, I would like to able to replace things such as :
> 
> édition :
> with
> edition :
> 
> I guess I have around 20 terms to get replaced, affecting a few
> thousands of pages.
> 
> For such a basic task (one word replacement, no multiline, no link
> affected), I would believe unix tools to be effective – as long as you
> know how to use them safely ;) – rather than playing with PmWiki API
> (first : far out of my knowledge ; second : I may have a lot of pages
> to process and it looks like overkill to edit/save hundreds or
> thousands pages for a one (or 10) word replacement).
> 
> Also, for such a cosmetic/minor/negligible task, I don't mind about
> the diff ; I do restore pages sometimes, but not often, and I should
> be able to check the restored copy twice.
> 
> I understand it is much better to preserve timestamp replacement
> (sure, I don't want to touch the unix time= data and indeed I do use
> fastcache recipe).
> 
> At least, it is true that PmWiki file text format is somewhat tricky
> (to me, it is one of the very few things I regret with PmWiki) but the
> planned task would have very minimal impact and is expected to be
> quite easy.
> 
> I didn't dare to use Anomen's XMLPageStore for my main site (if
> something bad happens will I be able to fix it ? if there is no more
> support in case of PHP incompatibility ?) but I do use it for a
> private and less important part with success. Wiki.d files created
> with that script are a lot cleaner.  No idea about the security
> issues.
> 
> As for .pageindex creation, it takes long but it worked last time it
> ran ; nevertheless I'm not sure the server does like the experiment
> too much ; and because it is quite a big and long task in my case, I'm
> limited to regen .pageindex only if needed.
> 
> Thank you,
> Gilles.
> 
> 
> Le mer. 3 juil. 2024 à 22:03, Petko Yotov <5ko at 5ko.fr> a écrit :
>> 
>> On 03/07/2024 21:48, Petko Yotov wrote:
>> > PTVs are normally not indexed in .pageindex, only the page names, last
>> > modified times, and the list of words for searches.
>> 
>> Also the link targets from the page to other pages or to categories 
>> are
>> stored in .pageindex.
>> 
>> Petko



More information about the pmwiki-users mailing list