aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/conditional.pm
Commit message (Collapse)AuthorAge
* In all=no conditionals, depend on the influences, not the test pagespecSimon McVittie2014-03-03
| | | | | | | | | | | | | | | | | | | | | | Previously, if a page like `plugins/trail` contained a conditional like [[!if test="backlink(plugins/goodstuff)" all=no]] (which it gets via `templates/gitbranch`), then the [[plugins/conditional]] plugin would give `plugins/trail` a dependency on `(backlink(plugins/goodstuff)) and plugins/trail`. This dependency is useless: that pagespec can never match any page other than `plugins/trail`, but if `plugins/trail` has been modified or deleted, then it's going to be rendered or deleted *anyway*, so there's no point in spending time evaluating match_backlink for it. Conversely, the influences from the result were not taken into account, so `plugins/trail` did not have the `{ "plugins/goodstuff" => $DEPEND_LINKS }` dependency that it should. Invert that, depending on the influences but not on the test. Bug: http://ikiwiki.info/bugs/editing_gitbranch_template_is_really_slow/
* avoid unnecessary uses of UNIVERSALJoey Hess2012-03-18
| | | | | | | Foo->Bar->can("method") works just as well, even if Foo::Bar is not loaded. Using UNIVERSAL::can is deprecated. But, I was unable to easily eliminate conditional.pm's use of UNIVERSAL::can
* remove unnecessary and troublesome filter callsJoey Hess2010-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This better defines what the filter hook is passed, to only be the raw, complete text of a page. Not some snippet, or data read in from an unrelated template. Several plugins that filtered text that originates from an (already filtered) page were modified not to do that. Note that this was not done very consistently before; other plugins that receive text from a page called preprocess on it w/o first calling filter. The template plugin gets text from elsewhere, and was also changed not to filter it. That leads to one known regression -- the embed plugin cannot be used to embed stuff in templates now. But that plugin is deprecated anyway. Later we may want to increase the coverage of what is filtered. Perhaps a good goal would be to allow writing a filter plugin that filters out unwanted words, from any input. We're not there yet; not only does the template plugin load unfiltered text from its templates now, but so can the table plugin, and other plugins that use templates (like inline!). I think we can cross that bridge when we come to it. If I wanted such a censoring plugin, I'd probably make it use a sanitize hook instead, for the better coverage. For now I am concentrating on the needs of the two non-deprecated users of filter. This should fix bugs/po_vs_templates, and it probably fixes an obscure bug around txt's use of filter for robots.txt.
* conditional: Fix bug that forced "all" mode off by default.Joey Hess2010-04-15
| | | | Commit b7351daacd0d4a041a51b43d99b7bf589de54f53 introduced the bug.
* setup file orderingJoey Hess2010-02-12
|
* Group related plugins into sections in the setup file, and drop unused rcs ↵Joey Hess2010-02-11
| | | | plugins from the setup file.
* conditional: use pagespec_match_listJoey Hess2009-10-09
|
* indentationJoey Hess2009-10-09
|
* conditional: use yesnoJoey Hess2009-10-09
|
* Consistently allow use of relative paths in all PageSpecs that take a page ↵Joey Hess2009-01-10
| | | | name parameter. Previously, match_created_before(), match_created_after(), match_sourcepage(), and match_destpage() did not support that, and the docs were not clear.
* finalise version 3.00 of the plugin apiJoey Hess2008-12-23
|
* Coding style change: Remove explcit vim folding markers.Joey Hess2008-12-17
|
* avoid unnecessarily rebuilding pages with complex conditionalsJoey Hess2008-09-29
| | | | | | | | | | | | I noticed that ikiwiki/formatting was beilg rebuilt when any page changed. This turned out to be because it contained a complex conditional "enabled(foo) or enabled(bar)", and the conditional plugin did not notice that this consisted only of enabled() tests, and copied it unchanged into add_depends. Thus, the page's dependencies were satisfied by any page change. The fix is to beef up the parser so that it can handle that and more complex conditionals, and detect if they consist only of such tests.
* add plugin safe/rebuild info (part 1 of 2)Joey Hess2008-08-03
| | | | too many plugins.. brain exploding..
* switch preprocess hooks to use error functionJoey Hess2008-07-13
|
* * conditional: Improve regexp testing for simple uses of pagespecsJoey Hess2007-12-28
| | | | | that match only the page using the directive, adding 'included()' and supporting negated pagespecs and added whitespace.
* fixjoey2007-07-28
|
* * Add a destpage parameter to the filter hook.joey2007-05-17
| | | | | * Fix links to smilies generated by the smiley plugin for inlined pages. The old links were often wrong, but often still worked by accident.
* * Add all=no option to conditional, can be used to form conditionals that dojoey2007-05-09
| | | | | not need to examine every page in the wiki. * Use this to simplify the goodstuff detection in the plugin template.
* the kind of perl code that can only be written at 4:30 amjoey2007-04-27
| | | | | | | (Get a good message when a PageSpec fails due to a negated success by creating success objects with a reason string, which morph into failure objects when negated.)
* * Make pagespec_match on failure return a value that is false, but in ajoey2007-04-27
| | | | | | scalar context, evaluates to a reason why the match failed. * Add testpagespec plugin, which might be useful to see why a pagespec isn't matching something.
* * pagespec_match() has changed to take named parameters, to better allowjoey2007-04-27
| | | | | | | | | for extended pagespecs. The old calling convention will still work for back-compat for now. * The calling convention for functions in the IkiWiki::PageSpec namespace has changed so they are passed named parameters. * Plugin interface version increased to 2.00 since I don't anticipate any more interface changes before 2.0.
* * Fix link() PageSpecs to not just look at the raw link text, but at wherejoey2007-03-21
| | | | | | | | | | that given link points based on the page doing the linking. Note that this could make such PageSpecs match different things than before, if you relied on the old behavior of them only matching the raw link text. * This required changing the match_* interface, adding a third parameter. * Allow link() PageSpecs to match relative, as is allowed with globs.a * Add postform option to inline plugin. * Add an bug tracker to the softwaresite example.
* more i18n improvementsjoey2007-03-07
|
* * Fix the template, toggle, and conditional plugins to filter text beforejoey2007-02-14
| | | | | | preprocessing it. * Fix smiley plugin to support smileys at the very beginning or end of the content.
* * Allow plugins to add new types of tests that can be used in PageSpecs.joey2007-02-12
* Add a "conditional" plugin, which allows displaying text if a condition is true. It is enabled by default so conditional can be used in the basewiki. * Use conditionals in the template for plugins, so that plugin pages say if they're currently enabled or not, and in various other places in the wiki.