Commit Graph

322 Commits (63439fa10b2b59e85337d7a0f71ddaa38dfb0018)

Author SHA1 Message Date
Joey Hess 75a096d056 Work around perl $_ scoping nonsense that caused breakage when loading external plugins. 2008-08-29 18:40:41 -04:00
Joey Hess adc2eb3d8c Options set in the setup file are now immediatly loaded by ikiwiki -setup. This allows later switches to override them. Previously, setup file options overrode most command line options. 2008-08-06 01:58:04 -04:00
Joey Hess 182edf291b typo 2008-08-05 19:39:50 -04:00
Joey Hess 4b4bce5006 Revert "typo"
This reverts commit c8d3626c51.
2008-08-05 19:39:30 -04:00
Joey Hess c8d3626c51 typo 2008-08-05 19:30:09 -04:00
Joey Hess 4f22989be1 don't set values for verbose and syslog by default
Setting the values in the setup file by default makes it annoyingly hard to
override them at the command line (since setup files override the command
line).

Both default to off if no value is set.
2008-08-05 19:16:24 -04:00
Joey Hess 6f2d1536b8 improve fix to DTRT for a param of "0" 2008-08-04 14:58:21 -04:00
Simon McVittie 4c2f46e3fa Suppress warning about uninitialized value if directives look like [[!foo]]
(cherry picked from commit cf58eefaa56eb17c227d97d129bf95e3dab54fd3)
2008-08-04 14:56:23 -04:00
Joey Hess 6fb0226a55 reorg settings 2008-08-03 17:02:00 -04:00
Joey Hess 4405cebd0a add advanced and basic modes 2008-08-03 14:57:24 -04:00
Joey Hess 11a9853d4b reword 2008-08-03 00:05:49 -04:00
Joey Hess c762b65ce4 show unsafe options (RO) by default
Small data leak, but only to admins, and I think it's worth it to see the
stuff that cannot be configured.
2008-08-02 22:50:09 -04:00
Joey Hess 4708aeceb3 websetup form display done 2008-08-02 16:41:37 -04:00
Joey Hess 25c35b6e90 banned_users move to setup file, stage 1 2008-08-01 17:39:17 -04:00
Joey Hess f41448d9ca rcs plugin loading reorg
Move rcs plugin load to loadplugins; move duplicate rcs detection logic out
of individual plugins and into loadplugins. Avoids checkconfig failing when
run twice.
2008-08-01 16:45:05 -04:00
Joey Hess e12627e0a4 update 2008-07-30 14:44:50 -04:00
Joey Hess 25142cfa1d libdir can be empty 2008-07-27 19:20:14 -04:00
Joey Hess 6154dd03cb finish with rcs plugin conversion 2008-07-26 22:28:18 -04:00
Joey Hess 3d82d47e18 Merge branch 'master' into autoconfig 2008-07-26 21:16:16 -04:00
Joey Hess c83fd4a328 wrapper setup reorg
Flattened the wrapper setup, as this lets it be handled better by the
setup generation code.
2008-07-26 21:00:11 -04:00
Joey Hess 38618838c9 add example wrapper and fix formatting 2008-07-26 19:49:45 -04:00
Joey Hess 8051316904 add missing setup options, tweak others' display 2008-07-26 19:28:15 -04:00
Joey Hess 52bbdbb1a5 load all plugins when generating setup 2008-07-26 19:10:11 -04:00
Joey Hess 2bffce0d89 reorder 2008-07-26 18:36:56 -04:00
Joey Hess 2bbe1bf9af move more settings out to rcs 2008-07-26 18:29:33 -04:00
Joey Hess 90b310b93c getsetup-ize svn and bzr 2008-07-26 18:26:56 -04:00
Joey Hess e829930008 put preprocess loop errors inside an error span 2008-07-26 17:53:03 -04:00
Joey Hess 1c00717cb2 can now dump fully functional setup files 2008-07-26 15:34:38 -04:00
Joey Hess 49e86d2562 turn booleans into questions 2008-07-26 14:43:47 -04:00
Joey Hess abab46f983 add info for all common setup file options, and most internal ones 2008-07-26 14:39:12 -04:00
Joey Hess a71b9a1cf1 fix feed urls
The fix for colons involved adding "./" to some urls. Due to the weird way
inline called urlto, these snuck into feed urls and permalinks. Fix it by
adding an optional third parameter to urlto.
2008-07-25 16:16:44 -04:00
Joey Hess c2ffd205f3 Really fix bug with links to pages with names containing colons
Previous fix mised a few cases.
2008-07-21 17:27:14 -04:00
Joey Hess 246db0f234 whitespace 2008-07-17 00:22:25 -04:00
Joey Hess 2c05a34be1 Merge commit 'intrigeri/pedigree' 2008-07-16 17:31:15 -04:00
intrigeri 35668b87d3 pedigree rename to parentlinks: rename/adapt everything
* Renamed to parentlinks every single variable or function called
  pedigree
* Removed the parentlinks function from Render.pm
* Enabled the new parentlinks plugin by default
* Adapted testsuite and documentation to reflate the above facts

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 16:25:39 +02:00
Joey Hess edb59cd5b9 Error handling improvement for preprocess hooks. It's now safe to call error() from such hooks; it will cause a nicely formatted error message to be inserted into the page. 2008-07-13 14:41:40 -04:00
Joey Hess e3c0e49774 only htmlize errors when cgi is actually running 2008-07-12 23:23:25 -04:00
Joey Hess d101269bde Move yesno function out of inline and into IkiWiki core, not exported. 2008-07-12 12:01:22 -04:00
Joey Hess d73d4fed03 rename beautify_url to stress it only works on the path component 2008-07-11 10:33:41 -04:00
Joey Hess 98bd33eee4 Revert "Revert "Fix a bug with links to pages whose names contained colons.""
This reverts commit 810a355308.

I double-checked, and the change seems ok after all, actually.
2008-07-11 10:31:08 -04:00
Joey Hess 810a355308 Revert "Fix a bug with links to pages whose names contained colons."
This reverts commit e25c3a0a7c.

I didn't think that through far enough; beautify_url may be called on full
urls, which don't start with "/"!

Conflicts:

	debian/changelog
2008-07-11 09:52:17 -04:00
Joey Hess 8b00c9523d whitespace 2008-07-11 06:09:34 -04:00
Joey Hess e25c3a0a7c Fix a bug with links to pages whose names contained colons.
So the problem is that ikiwiki would generate a relative link like
href="colon:problem", which web browsers treat as being in the "colon:"
uri scheme.

The best fix seems to be to make url beautification fix this, by slapping
a "./" in front.
2008-07-08 10:03:55 -04:00
Joey Hess 05124f9a86 editpage escaping fixes
* The editpage form now uses the raw page name, not the page title, in its
  'page' cgi parameter. Using the title was ambiguous and made it
  impossible to tell between some pages, like "foo/bar" and "foo__47__bar",
  sometimes causing the wrong page to be edited.
* This change means that some edit links need to be updated.
  Force a rebuild on upgrade to this version.
* Above change also allowed really fixing escaped slashes from the blogpost
  form.
2008-07-06 15:52:04 -04:00
Joey Hess 8d3f65c293 typo 2008-07-02 18:22:49 -04:00
Joey Hess c150590e27 factor out glob2re 2008-07-02 18:22:49 -04:00
Joey Hess 7cd40ea4eb better approach for cgi upload disabling
Make it a config setting, this way subtle load order issues don't come into
play. (As much?)
2008-07-01 13:43:32 -04:00
Joey Hess 5e6a6b1086 append index.html to url generated by urlto("")
This special case crops up when generating the parentlink to the toplevel
index page. urlto("") had been generating a link to "./" (or "../" etc)
for that, which is fine, if the web server redirects that to the toplevel
index.html. It's less fine if there is no web server.

I actually ran into the problem first when using gopher. (Yes, yes, don't
laugh.. see upcoming tip.) But it also crops up when browsing local wiki
files.

Of course, the index.html is stripped back off if usedirs is enabled.
2008-06-15 15:04:26 -04:00
Joey Hess 1dddec0ba9 Pass a destpage parameter to the sanitize hook.
Because the search plugin needed it, also because it's one of the few
plugins that didn't already have it.

I also considered adding it to htmlize, but I really cannot imagine caring
what the destpage is when htmlizing. (I'll probably be poven wrong later.)
2008-06-04 01:24:23 -04:00
Joey Hess 1546b48b97 move indexing to sanitize hook
I think this will give better results overall.

I made %IkiWiki::preprocessing accessible and used it to avoid indexing
at unnecessary points.
2008-06-04 00:58:46 -04:00
Joey Hess 6725413516 Add rel=nofollow to edit links. This may prevent some spiders from pounding on the cgi following edit links. 2008-05-28 03:09:04 -04:00
Joey Hess 5efaed6de6 Avoid unsightly warning message when evaling broken pagespecs.
Also improve error message when a pagespec fails to parse.
2008-05-22 13:11:25 -04:00
Joey Hess 0438de905b ENV can be used in the setup file to override environment variable setting, such as TZ or PATH. 2008-05-15 18:20:52 -04:00
Joey Hess ec866f8370 Optimised file statting code when scanning for modified pages; cut the number of system calls in half. (Still room for improvement.) 2008-05-07 14:11:56 -04:00
Joey Hess a7b8069b9d avoid strange FreeBSD problem
<mxey> I have a weird problem with Ikiwiki on FreeBSD: When rendering this page <http://rafb.net/p/zmfROX86.html>, I get "ikiwiki.setup: Modification of a read-only value attempted at /usr/local/lib/perl5/site_perl/5.8.8/IkiWiki.pm line 1300.".

And converting the constructors to not operate on the parameters directly
but use lexical variables fixed it. Not sure exactly when this occurs.
2008-05-05 14:50:26 -04:00
Joey Hess b2dea99417 Fix ugly display when editing a page that has vanished.
srcfile now has an optional second parameter to avoid it throwing an error
if the source file does not exist.
2008-05-02 13:02:07 -04:00
Joey Hess 7d7f85bbb5 Correct a bug in pagespec matching, where a empty pagespec matched all pages.
This manifested as wikis with no locked pages treating them all as locked.
The bug was introduced in version 2.41.

Medium urgency upload due to above fix.
2008-04-24 13:49:15 -04:00
Joey Hess e1d456a86f Fix missing import of escapeHTML in userlink. (Scott Bronson) 2008-04-10 17:39:51 -04:00
Joey Hess f6bd81db15 Added a hardlink option in the setup file, useful if the source and dest are on the same filesystem and the wiki includes large media files, which would normally be copied, wasting time and space. 2008-03-29 21:02:47 -04:00
Joey Hess 5d9ed614db fix page source storing
This saves space, and stores the data under the right keys.
2008-03-21 14:42:59 -04:00
Joey Hess e3866fd94f fix transition call 2008-03-21 13:56:52 -04:00
Joey Hess 3479809f96 add transition code for indexdb 2008-03-21 09:37:52 -04:00
Joey Hess 213eb2e408 Changed to a binary index file, written using Storable, for speed
During refresh of a wiki with 800 files, loadindex was using more total
time than any other function, and saveindex was also in the top ten.
Rewriting them to use Storable makes them three times as fast.

0.7 seconds is saved on my laptop in profiling mode.
2008-03-21 09:07:44 -04:00
Joey Hess bf7360347e Precompile pagespecs, about 10% overall speedup
About 12% of ikiwiki runtime was spent in pagespec_match. It was evaling
the same pagespec code over and over again. This changes pagespec_translate
to return memoized, precompiled functions that can be called to match against
a given pagespec.

This also allows getting rid of the weird variable scoping trick that had
to be in effect for pagespec_translate to be called -- the variables are
now just fed into the function it returns.

On my laptop, this drops build time for the docwiki from about 60 to 50
seconds.
2008-03-21 06:36:07 -04:00
Joey Hess f40fec811d improve comment 2008-03-21 05:59:33 -04:00
Joey Hess 8a29361c32 * Detect invalid pagespecs and do not merge them in add_depends,
as that can result in a broken merged pagespec that matches nothing.
2008-03-17 14:04:59 -04:00
Joey Hess 52d9f8e9f3 * Correct bug in encoding of %pagestate keys, fixes edittemplate. 2008-03-17 13:08:16 -04:00
Joey Hess 736fa378c5 typo 2008-02-24 15:58:20 -05:00
Joey Hess 4763514861 * Add the linkify and scan hooks. These hooks can be used to implement
custom, first-class types of wikilinks.
* Move standard wikilink implementation to a new wikilink plugin, which
  will of course be enabled by default.
2008-02-11 22:48:27 -05:00
Josh Triplett fb82474be0 Tighten page name regex to not allow carriage returns or line feeds 2008-02-09 22:53:28 -08:00
Josh Triplett 1bcfef8be8 Allow whitespace in page names.
Spaces in page names map to underscores in file names.  Newlines and
tabs follow ikiwiki's usual filename escaping rules: __10__ and __9__.
2008-02-06 20:02:25 -08:00
Joey Hess f92505d78b Merge branch 'master' into prefix-directives 2008-02-05 15:59:42 -05:00
Joey Hess bf522a347f * inline: Add new `allowrss` and `allowatom` config options. These can be
used if you want a wiki that doesn't default to generating rss or atom
  feeds, but that does allow them to be turned on for specific blogs.
2008-02-04 18:36:50 -05:00
Joey Hess 09187f83bc clear %pagestate in loadindex
This is to handle the case where loadindex is called multiple times in one run,
as when aggregating.
2008-02-03 03:25:47 -05:00
Joey Hess 870adf3bbf move openiduser function to the openid plugin 2008-01-30 02:39:17 -05:00
Joey Hess 64a8c828b8 * meta: Add pagespec functions to match against title, author, authorurl,
license, and copyright. This can be used to create custom RecentChanges.
* meta: To support the pagespec functions, metadata about pages has to be
  retained as pagestate.
* Fix encoding bug when pagestate values contained spaces.
2008-01-29 17:16:51 -05:00
Joey Hess 47ee266163 improve support for internal pages
This makes it a lot quicker to deal with lots of recentchanges pages
appearing and disappearing. It avoids needing to clutter up pagespecs with
exclusions for those pages, by making normal pagespecs not match them.
2008-01-29 15:05:49 -05:00
Joey Hess 21f44880cd non-tabular recentchanges display
Doesn't look as good as the old table, but works as a rss feed.
2008-01-29 01:48:55 -05:00
Joey Hess d7fdd04b5a * Removed support for sending commit notification mails. Along with it went
the svnrepo and notify settings, though both will be ignored if left in
  setup files.
2008-01-29 00:36:58 -05:00
Joey Hess 1b8f1b867c only linkify openids in userlink
Can't use htmllink in userlink due to it being called from recentchanges
in cases where there is no configured url. It seems easist, at least for now,
to not linkify user names in this case. I don't think I've ever clicked on such
a link anyway.

Might revisit this later.
2008-01-28 23:32:36 -05:00
Joey Hess 29f3082772 move userlink to IkiWiki.pm
I have a plugin that needs to use userlink.
2008-01-28 22:58:31 -05:00
Josh Triplett 1b03a06c8c Add new preprocessor directive syntax¸ using a '!' prefix.
Add a prefix_directives option to the setup file to turn this syntax
on; currently defaults to false, for backward compatibility.  Support
optional '!' prefix even with prefix_directives off, and use that in
the underlay to support either setting of prefix_directives.  Add NEWS
entry with migration information.
2008-01-27 16:14:38 -08:00
Joey Hess 14002b58d2 fix 2008-01-09 14:45:07 -05:00
Joey Hess e01960e90a not only markdown adds gunk, so remove it in the main htmlize function 2008-01-09 14:41:28 -05:00
Joey Hess 50faf0b151 Call preprocessor hooks in void context during the scan pass.
This allows the hook to determine if it's just scanning, and avoid expensive
operations.
2008-01-09 02:30:46 -05:00
Joey Hess dd0b844477 further improve the .. regexp 2007-12-17 13:53:51 -05:00
Joey Hess 90bce7d139 * Don't refuse to render files with ".." in their name. (Anchor the regexp.) 2007-12-17 13:37:19 -05:00
Joey Hess 214bc2b65b * Allow dashes in preprocessor directive commands, and shortcuts. 2007-12-12 16:13:15 -05:00
Joey Hess 58049e97c1 * Fix file pruning code to work if ikiwiki is run with "." as the srcdir. 2007-12-10 15:12:56 -05:00
Joey Hess ff97b0358b bug fix 2007-12-08 18:25:22 -05:00
Joey Hess 055179cb4c * Finally implemented a simple per-page data storage mechanism for plugins,
via the %pagestate hash.
* Use pagestate in meta to detect potential redir loops.
2007-12-08 17:40:50 -05:00
Joey Hess 91fe16f35c * Add umask configuration option. Closes: #443329 2007-11-27 16:46:02 -05:00
Joey Hess d00e8d78c8 * Don't consider links to anchors on the same page to be self links.
Patch by Daniel Burrows. Closes: #451729
* When usedirs is disabled, link direct to index.html files, not to
  directories, to improve browsing of file:// urls.
  Patch by Daniel Burrows. Closes: #451728
2007-11-17 19:58:17 -05:00
Joey Hess 3e17b7d612 need to remove trailing slashes in not one, but 2 places
htmllink needs to do it because it uses the basename of the link as the link
text

bestlink needs to do it because it is not always called from htmllink
2007-11-17 16:32:02 -05:00
Joey Hess 80d16f80bf * Allow trailing slashes after page names in wikilinks. 2007-11-17 16:26:34 -05:00
Joey Hess 264a82a435 * inline: Add timeformat parameter to control how the ctime of
inlined pages is displayed. Closes: #451019
2007-11-13 16:14:48 -05:00
joey 2d9ee11006 * Add a "createlink" class attribute to the span for wikilinks pointing
to not-yet-existing pages. I don't have a useful style defined for that
  though.
2007-10-13 23:08:38 +00:00
joey 3945473f8a clear hashes in loadindex, so that it can safely be called more than once
even if pages have been deleted in between
2007-10-10 18:46:25 +00:00
joey b86f9b8409 * Don't allow whitespace in link text in a wikilink. This was still
allowed by the regexp in one case though not documented to work, and
  was ambiguous with preprocessor directives.
2007-09-24 16:50:49 +00:00
joey 4ccb9be7c6 improve diagnostics 2007-09-22 18:10:40 +00:00