]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn
modular, not replacement
[ikiwiki.git] / doc / todo / po:_avoid_rebuilding_to_fix_meta_titles.mdwn
1 Re the meta title escaping issue worked around by `change`. 
2
3 >   I suppose this does not only affect meta, but other things
4 >   at scan time too. Also, handling it only on rebuild feels
5 >   suspicious -- a refresh could involve changes to multiple
6 >   pages and trigger the same problem, I think. Also, exposing
7 >   this rebuild to the user seems really ugly, not confidence inducing.
8 >   
9 >   So I wonder if there's a better way. Such as making po, at scan time,
10 >   re-run the scan hooks, passing them modified content (either converted
11 >   from po to mdwn or with the escaped stuff cheaply de-escaped). (Of
12 >   course the scan hook would need to avoid calling itself!)
13
14 >   (This doesn't need to block the merge, but I hope it can be addressed
15 >   eventually..)
16 >  
17 > --[[Joey]] 
18 >> 
19 >> I'll think about it soon.
20 >> 
21 >> --[[intrigeri]]
22 >>
23 >>> Did you get a chance to? --[[Joey]] 
24
25 >>>> I eventually did, and got rid of the ugly double rebuild of pages
26 >>>> at build time. This involved adding a `rescan` hook. Rationale
27 >>>> and details are in my po branch commit messages. I believe this
28 >>>> new way of handling meta title escaping to be far more robust.
29 >>>> Moreover this new implementation is more generic, feels more
30 >>>> logical to me, and probably fixes other similar bugs outside the
31 >>>> meta plugin scope. Please have a look when you can.
32 >>>> --[[intrigeri]]
33
34 >>>>> Glad you have tackled this. Looking at
35 >>>>> 25447bccae0439ea56da7a788482a4807c7c459d,
36 >>>>> I wonder how this rescan hook is different from a scan hook
37 >>>>> with `last => 1` ? Ah, it comes *after* the preprocess hook
38 >>>>> in scan mode. Hmm, I wonder if there's any reason to have 
39 >>>>> the scan hook called before those as it does now. Reordering
40 >>>>> those 2 lines could avoid adding a new hook. --[[Joey]]
41
42 >>>>>> Sure. I was fearing to break other plugins if I did so, so I
43 >>>>>> did not dare to. I'll try this. --[[intrigeri]]
44
45 >>>>>>> Done in my po branch, please have a look. --[[intrigeri]]
46
47 >>>>>>>> I've merged it. Didn't look at the po.pm changes closely;
48 >>>>>>>> assume they're ok. [[done]] --[[Joey]] 
49 >>>>>>>> 
50 >>>>>>>> My thinking about the reordering being safe is that
51 >>>>>>>> the relative ordering of scan and preprocess in scan mode hooks
52 >>>>>>>> has not been defined before, so it should be ok to define it. :)
53 >>>>>>>> 
54 >>>>>>>> And as to possible breakage from things that assumed the old
55 >>>>>>>> ordering, such a thing would need to have a scan hook and a
56 >>>>>>>> preprocess in scan mode hook, and the two hooks would need to 
57 >>>>>>>> populate the same data structure with conflicting information,
58 >>>>>>>> in order for there to be a problem. That seems highly unlikely
59 >>>>>>>> and would be pretty broken on its own. And no plugin in ikiwiki
60 >>>>>>>> itself has both types of hooks. --[[Joey]]