Commit Graph

212 Commits (6fc25c8df79c4ce9afde256be5d377ee82562c31)

Author SHA1 Message Date
Joey Hess f4c517110e formatting 2010-02-12 15:53:50 -05:00
Joey Hess 7b07286a6f layout 2010-02-12 15:41:19 -05:00
Joey Hess 4a7558539c add highlevel view of when hooks are called during compile and cgi phases 2010-02-12 15:38:07 -05:00
Joey Hess 60410369da add variable value examples 2010-02-12 14:48:22 -05:00
Joey Hess ba19f940bd move note to sidebox 2010-02-12 14:44:26 -05:00
Joey Hess b1c47b4065 heading tweaks 2010-02-12 14:41:28 -05:00
Joey Hess 5d566d8b32 reorg and expand docs of some variables 2010-02-12 14:38:43 -05:00
Joey Hess 20ba12802b add section information 2010-02-12 04:22:15 -05:00
Joey Hess a63929f6cc Group related plugins into sections in the setup file, and drop unused rcs plugins from the setup file. 2010-02-11 22:24:15 -05:00
Joey Hess 1e0b724bac document that state variables are not available in the checkconfig hook 2010-01-31 14:03:19 -05:00
Joey Hess 268a2dd54c htmllink: allow a title attribute to be specified 2009-11-26 14:10:21 -05:00
Joey Hess 66b46576ec Moved the postscan hook to run on the raw html of a page, before the template is filled out. This improves the search plugin's indexing, since it will not include navigational elements from the page template or sidebar. 2009-11-08 13:48:07 -05:00
Joey Hess 74409f940d add_depends: optimise influence calculation
I made match_* functions whose influences can vary depending on the page
matched set a special "" influence to indicate this.

Then add_depends can try just one page, and if static influences are found,
stop there.
2009-10-09 17:15:40 -04:00
Joey Hess 6f2cc5ac8c pagespec_match_list: change limit to filter 2009-10-09 13:20:41 -04:00
Joey Hess 769b78df07 pagespec_match_list allow additional pagespec limit parameters again 2009-10-09 13:02:10 -04:00
Joey Hess 5e7b2dea84 rename use_pagespec to pagespec_match_list
To avoid breaking plugins, also support the old pagespec_match_list
calling convention, with a deprecation warning.
2009-10-08 23:51:06 -04:00
Joey Hess 32cd5f0b79 inline: switch to use_pagespec
Taking advantage of every single one of its features, of course.
Even had to add one more..
2009-10-08 18:30:50 -04:00
Joey Hess 5e236f5d25 add use_pagespec and deptype functions 2009-10-08 17:53:20 -04:00
Joey Hess 5f9860e65c add type info to influence information 2009-10-07 21:52:37 -04:00
Joey Hess 4002d7c1a4 add influence info to match_*
Also update docs, test suite.
2009-10-07 20:31:13 -04:00
Joey Hess 4528b95d25 mention that pagespec_match returns an overloaded value 2009-10-07 18:06:49 -04:00
Joey Hess 3ebd4e0b45 Add genwrapper hook, that can be used to add code into the C wrapper. 2009-09-10 14:04:46 -04:00
http://schmonz.livejournal.com/ d9fa13504d add missing backquote 2009-07-29 22:38:51 -04:00
http://schmonz.livejournal.com/ 6f88e3631e fix typo 2009-07-26 05:40:58 -04:00
Joey Hess ef003f48f4 Merge branch 'master' into po
Conflicts:
	debian/changelog
2009-05-19 13:07:47 -04:00
Jon Dowland 335462c05d document longname parameter 2009-05-16 14:01:12 +01:00
Joey Hess 2a7721febd Avoid %links accumulating duplicates. (For TOVA)
This is sorta an optimisation, and sorta a bug fix. In one
test case I have available, it can speed a page build up from 3
minutes to 3 seconds.

The root of the problem is that $links{$page} contains arrays of
links, rather than hashes of links. And when a link is found,
it is just pushed onto the array, without checking for dups.

Now, the array is emptied before scanning a page, so there
should not be a lot of opportunity for lots of duplicate links
to pile up in it. But, in some cases, they can, and if there
are hundreds of duplicate links in the array, then scanning it
for matching links, as match_link and some other code does,
becomes much more expensive than it needs to be.

Perhaps the real right fix would be to change the data structure
to a hash. But, the list of links is never accessed like that,
you always want to iterate through it.

I also looked at deduping the list in saveindex, but that does
a lot of unnecessary work, and doesn't completly solve the problem.

So, finally, I decided to add an add_link function that handles deduping,
and make ikiwiki-transition remove the old dup links.
2009-05-06 00:27:24 -04:00
Joey Hess aa306957ba pagespec_match_list added and used in most appropriate places
* pagespec_match_list: New API function, matches pages in a list
  and throws an error if the pagespec is bad.
* inline, brokenlinks, calendar, linkmap, map, orphans, pagecount,
  pagestate, postsparkline: Display a handy error message if the pagespec
  is erronious.
2009-04-23 15:45:30 -04:00
Joey Hess 748aa7af77 pagespec error/failure distinction and error display by inline
* Add IkiWiki::ErrorReason objects, and modify pagespecs to return
  them in cases where they fail to match due to a configuration or syntax
  error.
* inline: Display a handy error message if the inline cannot display any
  pages due to such an error.

This is perhaps somewhat incomplete, as other users of pagespecs do not
display the error, and will eventually need similar modifications to inline.
I should probably factor out a pagespec_match_all function and make it throw
ErrorReasons.
2009-04-23 14:07:28 -04:00
Joey Hess 252edaea66 clarify 2009-04-22 15:36:40 -04:00
intrigeri 8cfe428a28 rename hook: run once per file to be renamed
... as Joey suggested on todo/need_global_renamepage_hook

This hook is applied recursively to returned additional rename
hashes, so that it handles the case where two plugins use the hook:
plugin A would see when plugin B adds a new file to be renamed.

The full set of rename hashes can no longer be changed by hook functions, that
are only allowed to return any additional rename hashes it wants to add.
Rationale: the correct behavior of the recursion would be hard, if not
impossible, to define, if already considered pages were changing on the run.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 11:44:00 +01:00
intrigeri ae474d8e14 Merge commit 'upstream/master' into prv/po
Conflicts:

	IkiWiki/Plugin/editpage.pm
	debian/control
	debian/copyright
	doc/todo/need_global_renamepage_hook.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 09:50:27 +01:00
Joey Hess 66dc253437 Add noextension parameter to htmlize hooks to support, eg, Makefile. 2009-02-19 18:38:45 -05:00
Joey Hess 3ce8a2f8b9 revert addition of several blank lines 2009-02-17 22:17:59 -05:00
AlexandreDupas 6f9c18f7cb correct WikiLinks to the WikiLink page 2009-02-16 08:00:18 -05:00
Joey Hess 9a84181ad9 document writefile symlink checks 2009-02-09 16:04:33 -05:00
intrigeri 51badc960d rename hook: instead of modifying the passed-by-name array, return a copy
This is intended to solve Joey's concerns expressed on
http://ikiwiki.info/todo/need_global_renamepage_hook/, i.e. the need to make it
possible to use this hook from external plugins.

A plugin using this hook still can add/modify/remove elements of the
@torename array.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 17:08:55 +01:00
intrigeri 03ab262319 revert renamepage's hook original name
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 00:00:00 +01:00
intrigeri 78a095aa42 only pass named parameters to the canremove hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 23:07:19 +01:00
intrigeri f02672c113 only pass named parameters to the canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 23:02:31 +01:00
Joey Hess 53be24789e don't add new exported warning function
Nothing in the po plugin actually uses this function.

The benefit of adding the function in general is debatable, but I'd
prefer to keep the changes involved in merging po at a minimum.
2009-01-26 13:37:57 -05:00
intrigeri f8c306a21b remove cansave plugin, now replaced by Joey's checkcontent one
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-19 19:53:32 +01:00
intrigeri a3726968bc make checkcontent compatible with hooks that need the full content
Always pass the full (modified) content in `content` named parameter. When the
user edits an existing wiki page, also pass a `diff` named parameter, which
includes only the lines that they added to the page, or modified.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-19 19:44:39 +01:00
intrigeri 832d4d31d1 Merge commit 'upstream/master' into prv/po
Conflicts:

	IkiWiki/Plugin/editpage.pm
	IkiWiki/Plugin/skeleton.pm.example
	doc/plugins/write.mdwn
	t/syntax.t
2009-01-17 14:01:53 +01:00
Joey Hess f7b2cfcf50 checkcontent: New hook, can be used to implement arbitrary content filters, including spam filters. 2009-01-16 20:46:55 -05:00
intrigeri 1c53179e97 add a warning (exported) function to the core
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-16 15:06:42 +01:00
intrigeri d69fdf6445 editpage: added a cansave hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 19:48:27 +01:00
intrigeri e895157397 Pass src, srcfile, dest and destfile to the canrename hook.
This is not needed by the use I'm doing of it, but seems more consistent to me.
Future users of this hook may need this data to make their mind.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 18:04:37 +01:00
intrigeri a8105f6859 rename: pass the CGI and session to the rename hook
The po plugin remame + canrename hook combination will need this.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:47:20 +01:00
intrigeri 3316f9cc73 rename: implemented new canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:52:34 +01:00