aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
Commit message (Collapse)AuthorAge
* add dependency type parameters to add_dependsJoey Hess2009-10-03
| | | | | | | | | | | | | | | Dependency types are represented by bits in the values of the %depends and %depends_simple hashes. Change the dependslist array saved to the index to a depends hash. depends_simple is also converted from an array to a hash. Note that the depends field used to be a string, and we still have compat code to handle upgrades from that, as well as from the arrays. I didn't use ikiwiki-transition because I don't want ikiwiki to break if users forget to run it; also we're going to recommend a full rebuild on upgrade to this version to get the improved dependency handling. So this compat code can be removed or moved to ikiwiki-transition later.
* Fix a bug that could lead to duplicate links being recorded for tags.Joey Hess2009-10-03
| | | | | | | | | | Here I was bitten by perl's aliasing of foreach variables to the loop array contents, and match_link accidentially changed the contents of %links. In Jon's testcase, a tag added an absolute link, which was made relative by the above bug, and then the link was added again in preprocess, and turned into a duplicate.
* do not need to qualify %linksJoey Hess2009-10-03
|
* Merge branch 'master' into cvsJoey Hess2009-09-10
|\
| * Fix parsing web commits from ipv6 addresses.Joey Hess2009-09-10
| | | | | | | | | | | | | | | | I weakended the regexp, so this matches ipv6 addresses too. It does not ensure that the address is valid, but that should not matter here. Note that addresses ending in "::" are not matched, so eg, the unspecified address will not match -- but should never appear here anyway.
| * underlay: Also allow configuring additional directories to search for ↵Joey Hess2009-09-08
| | | | | | | | template files in.
| * memoize template_fileJoey Hess2009-09-08
| | | | | | | | | | This avoids a lot of unncessary stats, and trims about 1 second off a docwiki rebuild here.
* | Merge branch 'master' of git://github.com/joeyh/ikiwikiAmitai Schlair2009-08-30
|\|
| * <pedant>rename depends_exact to depends_simpleJoey Hess2009-08-28
| | | | | | | | | | | | | | It's not "exact" since case munging has to be done, and I think "simple" captures the optimisation better.</pedant> With apologies to smcv, who probably has to rebuild his wiki now.
| * Force %depends_exact to lower case, fixing incorrect case-sensitivitySimon McVittie2009-08-28
| |
| * Auto-detect "simple dependencies" instead of requiring callers to use ↵Simon McVittie2009-08-28
| | | | | | | | add_depends_exact()
| * Add depends_exact: simplified dependency tracking for dependencies on a ↵Simon McVittie2009-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | single page Let E be the number of dependencies per page of the form "A depends on B and nothing else", let D be the number of other dependencies per page, let P be the total number of pages, and let C be the number of changed pages in a refresh. This patch should speed up a refresh from O(E*C*P + D*C*P) to O(C + E*P + D*C*P), assuming that hash lookups are O(1). In practice, plugins like inline and map produce a lot of these very simple dependencies, and my album plugin's combination of inline with a large number of pages causes it to suffer particularly badly. In testing on a wiki with about 7000 objects (3500 full pages, 3500 images), a full rebuild continued to take about 5:30, and a refresh after touching about 350 pages and 350 images reduced from 5:30 to 1:30. As with my previous optimizations, this change will result in downgrades not working correctly until the wiki is rebuilt.
| * Merge commit 'remotes/smcv/ready/remove-pagespec-merge'Joey Hess2009-08-25
| |\
| | * Remove now-unused function pagespec_mergeSimon McVittie2009-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that dependencies are a list of pagespecs with an implicit "or" operation, there's no need to try to merge pagespecs under normal use. ikiwiki-transition contains the only use of the function, so move it there rather than deleting it entirely (it's used to concatenate all admins' lists of locked pages).
| * | Revert "Allow add_depends to take an arrayref"Joey Hess2009-08-25
| |/ | | | | | | | | | | This reverts commit e4cd168ebedd95585290c97ff42234344bfed46c. There was no benefit to this change.
| * IkiWiki::pagename: memoize resultsSimon McVittie2009-08-25
| | | | | | | | | | This relies for its correctness on %config, %hooks and pagetype() not changing.
| * Allow add_depends to take an arrayrefSimon McVittie2009-08-25
| |
| * Use a hash to de-duplicate dependenciesSimon McVittie2009-08-25
| |
| * Don't bother to save {depends} to the indexSimon McVittie2009-08-24
| | | | | | | | As per Joey's review.
| * Optimize the dependencies listSimon McVittie2009-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a large wiki you can spend a lot of time reading through large lists of dependencies to see whether files need to be rebuilt (album, with its one-page-per-photo arrangement, suffers particularly badly from this). The dependency list is currently a single pagespec, but it's not used like a normal pagespec - in practice, it's a list of pagespecs joined with the "or" operator. Accordingly, change it to be stored as a list of pagespecs. On a wiki with many tagged photo albums, this reduces the time to refresh after `touch tags/*.mdwn` from about 31 to 25 seconds. Getting the benefit of this change on an existing wiki requires a rebuild.
| * created_before/after: throw error if specified page does not existJoey Hess2009-08-16
| | | | | | | | | | This assumes that no ctime means the page doesn't exist, which seems reasonable.
| * fix error message displayJoey Hess2009-08-16
| | | | | | | | The gettext call can clear $@ in at least some cases.
| * Add discussionpage configuration settingJoey Hess2009-08-13
| | | | | | | | | | | | By adding this setting, we get both more configurability, and a minor optimisation too, since gettext does not need to be called continually to get the Discussion value.
* | Add my CVS plugin and related patches.Amitai Schlair2009-08-13
|/
* Merge branch 'master' into poJoey Hess2009-07-19
|\ | | | | | | | | Conflicts: debian/changelog
| * Move OpenID pretty-printing from openid plugin to coreSimon McVittie2009-07-10
| | | | | | | | | | | | | | | | On various sites I have two IkiWiki instances running from the same repository: one accessible via http and only accepting openid logins, and one accessible via authenticated https and only accepting httpauth. The https version should still pretty-print OpenIDs seen in git history, even though it does not itself accept OpenID logins.
| * Optimise use of gettext, and avoid ugly warnings if Locale::gettext is not ↵Joey Hess2009-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available. The test suite was emitting a lot of ugly gettext warnings; setting LC_ALL didn't solve the problem for all locale setups (since ikiwiki remaps it to LANG, and ikiwiki didn't know about the C locale). People also seem generally annoyed by the messages when Locale::Gettext is not installed, and I suspect will be generally happier if it just silently doesn't localize. The optimisation came about when I noticed that the gettext sub was doing rather a lot of work each call just to see if localisation is needed. We can avoid that work by caching, and the best thing to cache is a version of the gettext sub that does exactly the right thing. This was slightly complicated by the locale setting, which might need to override the original locale (or lack thereof) after gettext has been called. So it needs to invalidate the cache in that case. It used to do it via a global variable, which I am happy to have also gotten rid of.
* | Merge commit 'upstream/master' into pub/pointrigeri2009-06-06
|\| | | | | | | | | | | | | | | | | Conflicts: debian/changelog debian/control Signed-off-by: intrigeri <intrigeri@boum.org>
| * Tighten up matching of bare words inside directivesJoey Hess2009-06-05
| | | | | | | | | | | | | | Do not allow an unterminated """ string to be treated as a series of bare words. Fixes runaway regexp recursion/backtracking in strange situations. (See 1d57a21c987a5e970df01efe10acdf69982c2d61 for test case.)
* | Merge branch 'master' into poJoey Hess2009-05-19
|\| | | | | | | | | Conflicts: debian/changelog
| * Allow curly braces to be used in pagespecsJoey Hess2009-05-18
| | | | | | | | | | | | | | And avoid a whole class of potential security problems (though none that I know of actually existing..), by avoiding performing any string interpolation on user-supplied data when translating pagespecs.
| * Allow underlaydir to be overridden without messing up inclusion of other ↵Joey Hess2009-05-07
| | | | | | | | underlays via add_underlay.
| * Avoid %links accumulating duplicates. (For TOVA)Joey Hess2009-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Revert "pagespec_match_list * optimisation"Joey Hess2009-04-23
| | | | | | | | | | | | | | | | | | | | This reverts commit 2f96c49bd1826ecb213ae025ad456a714aa04863. I forgot about internal pages. We don't want * matching them! I left the optimisation in pagecount, where it used to live. Internal pages probably don't matter when they're just being counted.
| * pagespec_match_list * optimisationJoey Hess2009-04-23
| | | | | | | | | | Add an optimisation for the semi-common case of a "*" pagespec. Can avoid doing any real processing in this case.
| * pagespec_match_list added and used in most appropriate placesJoey Hess2009-04-23
| | | | | | | | | | | | | | | | * 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.
| * pagespec error/failure distinction and error display by inlineJoey Hess2009-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge commit 'upstream/master' into pub/pointrigeri2009-04-20
|\| | | | | | | | | | | | | Conflicts: debian/changelog debian/control
| * add _darcs to prune listJoey Hess2009-04-04
| |
* | Merge branch 'master' into poJoey Hess2009-03-27
|\| | | | | | | | | Conflicts: debian/control
| * Fix bug that caused weird things to appear as page types.Joey Hess2009-03-15
| | | | | | | | | | | | The problem was introduced by the recent noextension patches. Object autovivification caused junk to get into %htmlize, and all keys of that showed up as page types.
| * unknown option wording tweakJoey Hess2009-03-13
| | | | | | | | | | | | | | | | | | Because getopt::long is used in passthrough mode, if a known option like --wikiname that needs a parameter is specified w/o the parameter, it will not be processed, and passed on through. So in this case the "unknown option" message is innaccurate. Make it slightly better by noting that the problem can be a missing parameter.
* | brought back checkcontent hook full-content compat.intrigeri2009-03-08
|/ | | | | | | | This modification was initially done in editpage, in commit a3726968bc13f19f458c372cbd7cf92ae4c6fce5, but was then lost while merging upstream/master branch. Signed-off-by: intrigeri <intrigeri@boum.org>
* Add noextension parameter to htmlize hooks to support, eg, Makefile.Joey Hess2009-02-19
|
* move check_canedit, check_content to IkiWiki library from editpageJoey Hess2009-02-12
| | | | | | | | | | | | It no longer makes sense to keep these functions in editpage, because serveral plugins now exist that use them, and users may want to disable editpage, while leaving those plugins enabled. Most notably, comments uses both functions, and it's entirely appropriate to disable editpage but still want to have comments enabled. Less likely, attachments, rename, and remove all use check_canedit -- but it would be unusual indeed to want to use these w/o editpage.
* clarify description of verboseJoey Hess2009-01-24
| | | | It enables debug prints, so not just during building, but at runtime.
* add human-readable error when unknown pagespec function is calledJoey Hess2009-01-20
| | | | | | | | | | It used to replace unknown functions with "0" when translating a pagespec. Instead, replace it with a FailReason object. This way, the pagespec will still evaluate as before (possibly successfully if other terminals exist), but a human-readable error will be shown if the result is displayed. Also, an empty pagespec used to be replaced with "0", to avoid a eval error. Also use a FailReason here.
* export installdirJoey Hess2009-01-12
| | | | For use by Setup/Automator
* 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.
* refactor pagespec derelevitisation codeJoey Hess2009-01-10
|