updates
parent
70c5e7f0c8
commit
1705e6246e
|
@ -320,7 +320,7 @@ sub baseurl (;$) { #{{{
|
||||||
sub abs2rel ($$) { #{{{
|
sub abs2rel ($$) { #{{{
|
||||||
# Work around very innefficient behavior in File::Spec if abs2rel
|
# Work around very innefficient behavior in File::Spec if abs2rel
|
||||||
# is passed two relative paths. It's much faster if paths are
|
# is passed two relative paths. It's much faster if paths are
|
||||||
# absolute!
|
# absolute! (Debian bug #376658)
|
||||||
my $path="/".shift;
|
my $path="/".shift;
|
||||||
my $base="/".shift;
|
my $base="/".shift;
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,11 @@
|
||||||
The plugin interface is currently that they can register hooks, and can
|
I don't want this interface to be too firm; it's ok for a plugin like
|
||||||
call any other ikiwiki internal function they desire, generally through
|
`ddate` to redefine an internal function like IkiWiki::displaytime if it
|
||||||
Ikiwiki::function calls. Also, some Ikiwiki::config etc variables can be
|
wants to.. But plugins that still access stuff through IkiWiki:: should be
|
||||||
used.
|
aware that that stuff can change at any time and break them. Possibly without
|
||||||
|
perl's type checking catching the breakage, in some cases. Plugins that
|
||||||
|
only use exported symbols should not be broken by future ikiwiki changes.
|
||||||
|
|
||||||
This is a very weak interface, and should be firmed up to something more
|
Functions used by only some plugins, undecided about exporting:
|
||||||
like a proper perl library. I've been waiting to get some idea of what bits
|
|
||||||
of ikiwiki are most useful to plugins before doing it; there are plenty of
|
|
||||||
plugins to know that now.
|
|
||||||
|
|
||||||
IkiWiki will now export some function calls and variables when loaded.
|
|
||||||
|
|
||||||
Functions used by many plugins, which I'm sure should be exported:
|
|
||||||
|
|
||||||
* hook
|
|
||||||
* debug
|
|
||||||
* error
|
|
||||||
* template
|
|
||||||
* htmlpage
|
|
||||||
* add_depends
|
|
||||||
* pagespec_match
|
|
||||||
* bestlink
|
|
||||||
* htmllink
|
|
||||||
* readfile
|
|
||||||
* writefile
|
|
||||||
* pagetype
|
|
||||||
* srcfile
|
|
||||||
* pagename
|
|
||||||
* displaytime
|
|
||||||
|
|
||||||
Functions used by only some plugins, undecided:
|
|
||||||
|
|
||||||
* lockwiki, unlockwiki (aggregate)
|
* lockwiki, unlockwiki (aggregate)
|
||||||
Too internal to ever be exported.
|
Too internal to ever be exported.
|
||||||
|
@ -51,22 +28,13 @@ Functions used by only some plugins, undecided:
|
||||||
* linkify
|
* linkify
|
||||||
* preprocess
|
* preprocess
|
||||||
* filter
|
* filter
|
||||||
Used by several, but problimatic since plugins typically define
|
The 4 above are used by a few plugins, but problimatic since plugins
|
||||||
functions with these names..
|
typically also define functions with these names.. I also feel that
|
||||||
|
this part of ikiwiki needs some more work before it's set in stone.
|
||||||
|
These are always called together, in the same order, though
|
||||||
|
sometimes htmlize isn't included.
|
||||||
|
|
||||||
Variables used by plugins:
|
Variables used by plugins but not exported yet:
|
||||||
|
|
||||||
* %IkiWiki::config (various values; probably not worth locking down any
|
* %IkiWiki::pagecase (aggregate)
|
||||||
more, export it)
|
* %IkiWIki::backlinks (pagestats)
|
||||||
* %IkiWiki::links (many, seems clearcut to export)
|
|
||||||
* %IkiWiki::renderedfiles (orphans, inline, search)
|
|
||||||
* %IkiWiki::pagesources (pagecount, sidebar, template, inline)
|
|
||||||
* %IkiWiki::pagecase (aggregate.. will not export yet)
|
|
||||||
* %IkiWIki::backlinks (pagestats.. will not export yet)
|
|
||||||
|
|
||||||
I don't want this interface to be too firm; it's ok for a plugin like
|
|
||||||
`ddate` to redefine an internal function like IkiWiki::displaytime if it
|
|
||||||
wants to.. But plugins that still access stuff through IkiWiki:: should be
|
|
||||||
aware that that stuff can change at any time and break them. Possibly without
|
|
||||||
perl's type checking catching the breakage, in some cases. Plugins that
|
|
||||||
only use exported symbols should not break by future ikiwiki changes.
|
|
||||||
|
|
Loading…
Reference in New Issue