-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New noinstructionscache flag #266
base: master
Are you sure you want to change the base?
New noinstructionscache flag #266
Conversation
This commit adds a new flag: noinstructionscache to plugin syntax. This flag forces not to use an instruction cache for the included page. This flag allows using the struct serial aggregation inside the included page. More generally, it allows using any DokuWiki syntax which instructions are dependant on the current page id, inside the included page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I am not totally against this flag and the implementation is okay (apart from the missing initialization), I am really wondering why this is used and if what the struct plugin does is a good idea. Note that instructions can be processed in the context of any page, even without the include plugin. It suffices to have useheading on and a link to the page. If the other page is changed without being immediately shown (e.g., because the page has been updated on the disk), the instruction cache will be re-generated while the page with the link is shown. This can also happen due to a race condition if the linked page has been updated and the page with the link is shown before the instruction cache of the linked page could be written. In my opinion (but I have not looked deeper into the struct plugin) such processing that depends on the id should always happen in the rendering step for which the cache can be easily disabled to avoid such problems. Note that the rendering step is quite fast compared to the parsing step.
Can you provide any more insights (or provide a link to code/documentation) that explains why this is part of the parsing step and it is thus indeed necessary to disable that cache?
The new serial data feature of struct allows the user to store separate datasets for every page where it is inserted. So the following syntax:
will display different data for every single page (different data for "data:cert1", "data:cert2" and so on) . The problem here is that the "id" of the page, for which the dataset is displayed, is saved directly in the instructions:
So when we will insert the "struct serial" syntax to page "include:cert" and then include it on "data:cert1" and ""data:cert2":
I also believe that what struct does here is not a good idea but the flag I've proposed can fix it very simply without reengineering the struct plugin itself. But maybe it should be fixed in struct not in include. @splitbrain what do you think about it? |
This commit adds a new flag: noinstructionscache to plugin syntax. This flag forces not to use an instruction cache for the included page. This flag allows using the struct serial aggregation inside the included page. More generally, it allows using any DokuWiki syntax which instructions are dependant on the current page id, inside the included page.