Commit Graph

435 Commits (a1aa71efc9d1db42b425f43afc1ff4a37c4c0f3a)

Author SHA1 Message Date
Joey Hess dee2940c0b automatically run --gettime, and optimise it for git
* Automatically run --gettime the first time ikiwiki is run on
  a given srcdir.
* Optimise --gettime for git, so it's appropriatly screamingly
  fast. (This could be done for other backends too.)
* However, --gettime for git no longer follows renames.
* Use above to fix up timestamps on docwiki, as well as ensure that
  timestamps on basewiki files shipped in the deb are sane.
2010-04-16 18:30:56 -04:00
Joey Hess b14f84c4ac --gettime revamp
* Rename --getctime to --gettime. (The old name still works for
  backwards compatability.)
* --gettime now also looks up last modification time.
* Add rcs_getmtime to plugin API; currently only implemented
  for git.
2010-04-16 17:02:29 -04:00
Joey Hess d50bd08439 refactor sortspec translation 2010-04-12 12:41:32 -04:00
Joey Hess 0bfc364a7d optimization: pagespec_match_list with no num limit matches before sorting
This can be a lot faster, since huge numbers of pages are not sorted
only to mostly be thrown away. It sped up a build of my blog by at least
5 minutes.
2010-04-11 01:30:03 -04:00
Joey Hess 153c0ff13b minor style etc changes 2010-04-06 23:29:18 -04:00
Joey Hess bab8fec524 Merge remote branch 'smcv/ready/sort-package'
Conflicts:
	debian/NEWS
2010-04-06 23:15:33 -04:00
Joey Hess f6fd7639da Merge remote branch 'smcv/ready/link-types' 2010-04-06 22:50:19 -04:00
Simon McVittie cb8b2f80b2 Use $a and $b for SortSpec cmp callbacks 2010-04-05 22:50:51 +01:00
Joey Hess f8457f9a90 fix bug that left stray </p> tags
Both markdown and tidy add paragraph tags around text, that needs to be
stripped when the text is a short, one line fragment that is being inserted
into a larger page. tidy also adds several newlines to the end, and this
broke removal of the paragraph tags.
2010-04-05 17:18:30 -04:00
Simon McVittie f80e1cb577 Remove the typedlink(tag foo) pagespec feature, which is less friendly than tagged()
Plugins that introduce a link type should also introduce pagespec syntax
for it.
2010-04-04 00:43:58 +01:00
Simon McVittie c1a42e76bc implement typed links; add tagged_is_strict config option 2010-04-04 00:43:48 +01:00
Simon McVittie 04a59b3c65 Move sort hooks to the IkiWiki::SortSpec namespace
Also rename cmpspec_translate (internal function) to sortspec_translate
for consistency.
2010-04-03 14:28:21 +01:00
Simon McVittie 75fd080465 Remove support for check_cmp_foo (pre-sort checks) 2010-04-03 14:28:21 +01:00
Simon McVittie a875ee8be7 Split out sortnaturally into a plugin 2010-04-03 14:28:21 +01:00
Joey Hess 799b93d258 don't check $@ after pagespec_translate
pagespec_translate may set $@ if it fails to parse a pagespec, but
due to memoization, this is not reliable. If a memoized call is repeated,
and $@ is already set for some other reason previously, it will remain
set through the call to pagespec_translate.

Instead, just check if pagespec_translate returns undef.
2010-03-28 20:23:22 -04:00
Joey Hess 0d524ad672 Fix incorrect influence info returned by a failing link() pagespec, that could lead to bad dependency handling in certian situations. 2010-03-26 01:38:53 -04:00
Simon McVittie b86276ffed Reimplement extensible sorting mechanisms, in the same way as pagespecs 2010-03-25 23:31:53 +00:00
Simon McVittie 60edd2dc31 Allow sorting to be combined and/or reversed 2010-03-24 23:51:48 +00:00
Simon McVittie e67a9382f6 Allow hooks to add sorting functions to pagespec_match_list 2010-03-24 00:29:10 +00:00
Joey Hess 07bb08d094 shorten setuptype 2010-03-19 15:55:10 -04:00
Joey Hess b1dade8d96 allow multiple setup file types, and support safe parsing
Finally removed the last hardcoding of IkiWiki::Setup::Standard.
Take the first "IkiWiki::Setup::*" in the setup file to define the
setuptype, and remember that type to use in dumping later. (But it can be
overridden using --set, etc.)

Also, support setup file types that are not evaled.
2010-03-19 14:52:17 -04:00
Joey Hess cbf269eee2 audited use POSIX
The POSIX perl module exports a huge number of functions by default, so
make sure all imports are qualified. (And remove one that was not
necessary.)
2010-03-19 13:12:28 -04:00
Joey Hess 60b71996da add Makefile to exclude example 2010-03-17 23:24:31 -04:00
Joey Hess cbc5fcff61 set exclude example to match *.private and improve its description 2010-03-17 23:21:35 -04:00
Joey Hess a5ded6437d slight optimisation to file_pruned
Precompile the regexp, rather than rebuilding on every call.
2010-03-14 15:21:42 -04:00
Joey Hess 823ec815d4 Add a include setting, which can be used to make ikiwiki process wiki source files, such as .htaccess, that would normally be skipped for security or other reasons. Closes: #447267 (Thanks to Aaron Wilson for the original patch.) 2010-03-14 14:58:13 -04:00
Joey Hess c0ad4929de Improve openid url munging; do not display anchors and cgi parameters, as used by yahoo and google urls. 2010-03-13 20:10:50 -05:00
Joey Hess 60d2dd318f Add new --clean option; this makes ikiwiki remove all built files in the destdir, as well as wrappers and the .ikiwiki directory. 2010-02-28 00:12:47 -05:00
Joey Hess b3c3c42b26 Loosen regexp, to allow empty quoted parameters in directives. 2010-02-26 11:49:51 -05:00
Joey Hess f1183cbf0c add ngettext support & optimize gettext handling
As I was adding ngettext support, I realized I could optimize the gettext
functions by memoizing the creation of the gettext object. Note that
the object creation is still deferred until a gettext function is called,
to avoid unnecessary startup penalties on code paths that do not need
gettext.

A side benefit is that separate stub functions are no longer needed to
handle the C language case.
2010-02-14 18:09:12 -05:00
Joey Hess c923e0ba33 Allow globs to be used in user() pagespecs. 2010-02-11 20:39:10 -05:00
Joey Hess e11876b700 httpauth: Add httpauth_pagespec setting that can be used to limit pages to only being edited via users authed with httpauth. 2010-02-11 18:25:10 -05:00
Joey Hess 03777230ea update comment re openid library version 2010-02-06 15:29:25 -05:00
Joey Hess 8380a9d000 factor out a userpage function
Not yet exported, as only 4 quite core plugins use it.
2010-02-04 18:24:15 -05:00
Joey Hess cfcb3d1880 remove userlink()
That was dead code; changes to lockedit and recentchanges removed the last
callers.
2010-02-04 15:17:21 -05:00
Joey Hess c0e938e972 fix typo
This was probably not noticed because it only results in a warning, and in
the checkcontent diff having some unchanged lines in it.
2009-12-14 18:20:11 -05:00
Joey Hess f1ddf4bd98 fix bestlink to not return just-deleted pages
bestlink was looking at whether %links existed for a page in order to tell
if the page exists, but just-deleted pages still have entries in there (for
reasons it may be best not to explore). So bestlink would return
just-deleted pages. Instead, make bestlink use %pagesources.

Also, when finding a deleted page, %pagecase was not cleared of that page.
This, again, made bestlink return just-deleted pages. Now that is cleared.

Fixing bestlink exposed another issue though. The backlink calculation code
uses bestlink. So when a page was deleted, no backlinks to it are found,
and pages that really did backlink to it were not updated, and had broken
links.

To fix that, the code that actually removes deleted pages had to be split
out from find_del_files, so it can run a bit later. It is run just after
backlinks are calculated. This way, backlink calculation still sees the
deleted pages, but everything afterwards does not.

However, it does not address the original bug report that started this
whole thing, [[bugs/bestlink_returns_deleted_pages]]. Because there
bestlink is run in the needsbuild hook. And that happens before backlink
calculation, and so bestlink still returns deleted pages then. Also in the
scan hook.

If bestlink needs to work consistently during those hooks, a more involved
fix will be needed.
2009-11-30 17:34:29 -05:00
Joey Hess 2255a6a0bb calendar: Add title attributes for all links in the calendars. 2009-11-26 14:58:35 -05:00
Joey Hess 268a2dd54c htmllink: allow a title attribute to be specified 2009-11-26 14:10:21 -05:00
Joey Hess 046ac5fec5 remove debugging and cruft 2009-10-13 15:00:07 -04:00
Joey Hess a20bc7a3fc influence blocker implementation
This avoids unnecessary influences being recorded from pagespecs
such as "link(done) and bugs/*", when a page cannot ever possibly
match.

A pagespec term that returns a value without influence is an influence
blocker. If such a blocker has a false value (possibly due to being
negated) and is ANDed with another term, it blocks that term's influence
from propigating out.

If the term is ORed, or has a true value, it does not block influence.
(Consider "link(done) or bugs/*" and "link(done) and !nosuchpage")

In the implementation in merge_influence, I had to be careful to never
negate $this or $other when testing if they are an influence blocker,
since negation mutates the object. Thus the slightly weird if statement.
2009-10-13 14:37:14 -04:00
Joey Hess 5e4e43e2c7 match_link: dynamic influence needed for page that currently has no links 2009-10-13 13:33:51 -04: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 4ef0b2d77b rework influence calculation
Thought of a cleaner way to accumulate all influences in
pagespec_match_list, using the pagespec_match result object as an
accumulator.

(This also accumulates all influences from failed matches, rather than just
one failed match. I'm not sure if the old method was correct.)
2009-10-09 14:27:11 -04:00
Joey Hess 3807aa298c fix pagespec_match_list handling of list parameter 2009-10-09 13:28:41 -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 b7351daacd conditional: use yesno 2009-10-09 12:54:35 -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 37ec6a8243 Merge branch 'master' into dependency-types
Conflicts:
	IkiWiki.pm
	IkiWiki/Render.pm
	debian/changelog
2009-10-08 20:33:58 -04:00