From bcf74bd8f8b72abb6466fef1b6848dc4cb5eb7b2 Mon Sep 17 00:00:00 2001 From: MariaJackson Date: Thu, 28 Jan 2010 09:58:20 +0000 Subject: --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 683a3f8ac..8e1ab2e56 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -8,6 +8,7 @@ there are some variations on the approach that might be useful: * Or, querying the mysql back-end to get the names * using WWW::MediaWiki for importing/exporting pages from the wiki, instead of Special::Export + * use pool covers Also, some detail on converting mediawiki transclusion to ikiwiki inlines... -- cgit v1.2.3 From 7f462b658953c7907d942e71a17b53a678b2ccc6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 28 Jan 2010 05:23:28 -0500 Subject: revert spam --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 1 - 1 file changed, 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 8e1ab2e56..683a3f8ac 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -8,7 +8,6 @@ there are some variations on the approach that might be useful: * Or, querying the mysql back-end to get the names * using WWW::MediaWiki for importing/exporting pages from the wiki, instead of Special::Export - * use pool covers Also, some detail on converting mediawiki transclusion to ikiwiki inlines... -- cgit v1.2.3 From a2ee2aa9c733b2a8df1fc564e5634abe7d209c05 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 29 Jan 2010 16:05:45 -0500 Subject: note on filtering --- doc/tips/add_chatterbox_to_blog.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/add_chatterbox_to_blog.mdwn b/doc/tips/add_chatterbox_to_blog.mdwn index aa35b9331..e07e36b07 100644 --- a/doc/tips/add_chatterbox_to_blog.mdwn +++ b/doc/tips/add_chatterbox_to_blog.mdwn @@ -18,4 +18,7 @@ from there, like I have on [my blog](http://kitenet.net/~joey/blog/) show=5 feeds=no]] """]] +* To filter out `@-replies`, append "and !*@*" to the [[ikiwiki/PageSpec]]. + The same technique can be used for other filtering. + Note: Works best with ikiwiki 3.10 or better. -- cgit v1.2.3 From 06a56ea9d51d472175cb9279d92f9fb7a62fdf46 Mon Sep 17 00:00:00 2001 From: Javier Rojas Date: Mon, 8 Feb 2010 23:32:05 -0500 Subject: added tip about page navigation from within vim --- doc/tips/follow_wikilinks_from_inside_vim.mdwn | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/tips/follow_wikilinks_from_inside_vim.mdwn (limited to 'doc/tips') diff --git a/doc/tips/follow_wikilinks_from_inside_vim.mdwn b/doc/tips/follow_wikilinks_from_inside_vim.mdwn new file mode 100644 index 000000000..93a95bc7a --- /dev/null +++ b/doc/tips/follow_wikilinks_from_inside_vim.mdwn @@ -0,0 +1,43 @@ +The [ikiwiki-nav](http://www.vim.org/scripts/script.php?script_id=2968) plugin +for vim eases the editing of IkiWiki wikis, by letting you "follow" the +wikilinks on your file (page), and loading the file associated with a given +wikilink in vim. The plugin takes care of following the ikiwiki linking rules +to figure out which file a wikilink points to + +The plugin also includes commands (and mappings) to make the cursor jump to the +previous/next wikilink in the current file + +## Jumping to pages + +To open the file associated to a wikilink, place the cursor over its text, and +hit Enter (``). This functionality is also available through the +`:IkiJumpToPage` command + +## Moving to next/previous wikilink in current file + +`Ctrl-j` will move the cursor to the next wikilink. `Ctrl-k` will move it to the +previous wikilink. This functionality is also available through the +`:IkiNextWikiLink` command. This command takes one argument, the direction to +move into + + * `:IkiNextWikiLink 0` will look forward for the wikilink + * `:IkiNextWikiLink 1` will look backwards for the wikilink + +## Current issues: + + * The plugin only works for wikilinks contained in a single text line; + multiline wikilinks are not (yet) seen as such + +## Notes + +The official releases of the plugin are in the +[vim.org script page](http://www.vim.org/scripts/script.php?script_id=2968) + +The latest version of this script can be found in the following location + + + +Any feedback you can provide is appreciated; the contact details can be found +inside the plugin + +[[!tag vim]] -- cgit v1.2.3 From 59868bce02f10e1ed378f5625618198daca58d3a Mon Sep 17 00:00:00 2001 From: Javier Rojas Date: Mon, 8 Feb 2010 23:37:24 -0500 Subject: more notes about the ikiwiki-nav plugin added installation notes added pointer in the forum page to the created tip --- doc/forum/navigation_of_wiki_pages_on_local_filesystem_with_vim.mdwn | 4 ++++ doc/tips/follow_wikilinks_from_inside_vim.mdwn | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'doc/tips') diff --git a/doc/forum/navigation_of_wiki_pages_on_local_filesystem_with_vim.mdwn b/doc/forum/navigation_of_wiki_pages_on_local_filesystem_with_vim.mdwn index 0497b66b6..980b92740 100644 --- a/doc/forum/navigation_of_wiki_pages_on_local_filesystem_with_vim.mdwn +++ b/doc/forum/navigation_of_wiki_pages_on_local_filesystem_with_vim.mdwn @@ -1,3 +1,7 @@ +**UPDATE** I have created a [[page|tips/follow_wikilinks_from_inside_vim]] in +the tips section about the plugin, how to get it, install it and use it. Check +that out. --[[jerojasro]] + I wrote a vim function to help me navigate the wiki when I'm editing it. It extends the 'gf' (goto file) functionality. Once installed, you place the cursor on a wiki page name and press 'gf' (without the quotes); if the file exists, it gets loaded. This function takes into account the ikiwiki linking rules when deciding which file to go to. diff --git a/doc/tips/follow_wikilinks_from_inside_vim.mdwn b/doc/tips/follow_wikilinks_from_inside_vim.mdwn index 93a95bc7a..df8145a51 100644 --- a/doc/tips/follow_wikilinks_from_inside_vim.mdwn +++ b/doc/tips/follow_wikilinks_from_inside_vim.mdwn @@ -23,6 +23,10 @@ move into * `:IkiNextWikiLink 0` will look forward for the wikilink * `:IkiNextWikiLink 1` will look backwards for the wikilink +## Installation + +Copy the `ikiwiki_nav.vim` file to your `.vim/ftplugin` directory. + ## Current issues: * The plugin only works for wikilinks contained in a single text line; -- cgit v1.2.3 From f48e98a2ac0325f3e17b2c25151aa6af4ba93b20 Mon Sep 17 00:00:00 2001 From: Javier Rojas Date: Mon, 8 Feb 2010 23:39:06 -0500 Subject: redaction --- doc/tips/follow_wikilinks_from_inside_vim.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/follow_wikilinks_from_inside_vim.mdwn b/doc/tips/follow_wikilinks_from_inside_vim.mdwn index df8145a51..015a4ecee 100644 --- a/doc/tips/follow_wikilinks_from_inside_vim.mdwn +++ b/doc/tips/follow_wikilinks_from_inside_vim.mdwn @@ -1,6 +1,6 @@ The [ikiwiki-nav](http://www.vim.org/scripts/script.php?script_id=2968) plugin for vim eases the editing of IkiWiki wikis, by letting you "follow" the -wikilinks on your file (page), and loading the file associated with a given +wikilinks on your file (page), by loading the file associated with a given wikilink in vim. The plugin takes care of following the ikiwiki linking rules to figure out which file a wikilink points to -- cgit v1.2.3 From 5b55237ab14b9916bf51dff06d9a12c9ad81d21e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 Feb 2010 12:51:11 -0500 Subject: add a link to another vim plugin --- doc/tips/vim_syntax_highlighting.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/vim_syntax_highlighting.mdwn b/doc/tips/vim_syntax_highlighting.mdwn index 172b763c3..416318f28 100644 --- a/doc/tips/vim_syntax_highlighting.mdwn +++ b/doc/tips/vim_syntax_highlighting.mdwn @@ -1,4 +1,6 @@ [[ikiwiki.vim]] is a vim syntax highlighting file for ikiwiki -[[ikiwiki/markdown]] files. +[[ikiwiki/markdown]] files. Installation instructions are at the top of the file. + +See also: [[navigation_of_wiki_pages_on_local_filesystem_with_vim]] -- cgit v1.2.3 From 8e75bcd2dc192da1e649ae70c3dd6a181367eb2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 Feb 2010 12:55:46 -0500 Subject: fix --- doc/tips/vim_syntax_highlighting.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/vim_syntax_highlighting.mdwn b/doc/tips/vim_syntax_highlighting.mdwn index 416318f28..18b2f1c92 100644 --- a/doc/tips/vim_syntax_highlighting.mdwn +++ b/doc/tips/vim_syntax_highlighting.mdwn @@ -3,4 +3,5 @@ Installation instructions are at the top of the file. -See also: [[navigation_of_wiki_pages_on_local_filesystem_with_vim]] +See also: [[follow_wikilinks_from_inside_vim]] +[[!tag vim]] -- cgit v1.2.3 From a982b9cf193445dccec0e9ba87eeed324825c2cc Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Mon, 1 Mar 2010 13:14:48 +0000 Subject: new tip: spam and software sites --- doc/tips/spam_and_softwaresites.mdwn | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 doc/tips/spam_and_softwaresites.mdwn (limited to 'doc/tips') diff --git a/doc/tips/spam_and_softwaresites.mdwn b/doc/tips/spam_and_softwaresites.mdwn new file mode 100644 index 000000000..fe73518ef --- /dev/null +++ b/doc/tips/spam_and_softwaresites.mdwn @@ -0,0 +1,86 @@ +Any wiki with a form of web-editing enabled will have to deal with +spam. (See the [[plugins/blogspam]] plugin for one defensive tool you +can deploy). + +If: + + * you are using ikiwiki to manage the website for a [[examples/softwaresite]] + * you allow web-based commits, to let people correct documentation, or report + bugs, etc. + * the documentation is stored in the same revision control repository as your + software + +It is undesirable to have your software's VCS history tainted by spam and spam +clean-up commits. Here is one approach you can use to prevent this. This +example is for the [[git]] version control system, but the principles should +apply to others. + +## Isolate web commits to a specific branch + +Create a separate branch to contain web-originated edits (named `doc` in this +example): + + $ git checkout -b doc + +Adjust your setup file accordingly: + + gitmaster_branch => 'doc', + +## merging good web commits into the master branch + +You will want to periodically merge legitimate web-based commits back into +your master branch. Ensure that there is no spam in the documentation +branch. If there is, see 'erase spam from the commit history', below, first. + +Once you are confident it's clean: + + # ensure you are on the doc branch + $ git branch + doc + * master + $ git merge --ff doc + +## removing spam + +### short term + +In the short term, just revert the spammy commit. + +If the spammy commit was the top-most: + + $ git revert HEAD + +This will clean the spam out of the files, but it will leave both the spam +commit and the revert commit in the history. + +### erase spam from the commit history + +Git allows you to rewrite your commit history. We will take advantage of this +to eradicate spam from the history of the doc branch. + +This is a useful tool, but it is considered bad practise to rewrite the +history of public repositories. If your software's repository is public, you +should make it clear that the history of the `doc` branch in your repository +is unstable. + +Once you have been spammed, use `git rebase` to remove the spam commits from +the history. Assuming that your `doc` branch was split off from a branch +called `master`: + + # ensure you are on the doc branch + $ git branch + * doc + master + $ git rebase --interactive master + +In your editor session, you will see a series of lines for each commit made to +the `doc` branch since it was branched from `master` (or since the last merge +back into `master`). Delete the lines corresponding to spammy commits, then +save and exit your editor. + +Caveat: if there are no commits you want to keep (i.e. all the commits since +the last merge into master are either spam or spam reverts) then `git rebase` +will abort. Therefore, this approach only works if you have at least one +non-spam commit to the documentation since the last merge into `master`. For +this reason, it's best to tackle spam with reverts until you have at least one +commit you want merged back into the main history. -- cgit v1.2.3 From 823ec815d4fc9625d6fa3553ad03e9f2ff737659 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Mar 2010 14:58:13 -0400 Subject: 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.) --- IkiWiki.pm | 13 +++++++++++++ debian/changelog | 4 ++++ doc/tips/htaccess_file.mdwn | 30 ++++++++++++++++++++++++++++++ doc/todo/enable-htaccess-files.mdwn | 5 +++++ doc/usage.mdwn | 6 ++++++ ikiwiki.in | 3 +++ 6 files changed, 61 insertions(+) create mode 100644 doc/tips/htaccess_file.mdwn (limited to 'doc/tips') diff --git a/IkiWiki.pm b/IkiWiki.pm index 251ed8cc8..ee94ce659 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -334,6 +334,15 @@ sub getsetup () { safe => 0, # paranoia rebuild => 0, }, + include => { + type => "string", + default => undef, + example => '^\.htaccess$', + description => "regexp of normally ignored source files to include", + advanced => 1, + safe => 0, # regexp + rebuild => 1, + }, exclude => { type => "string", default => undef, @@ -1820,6 +1829,10 @@ sub file_pruned ($;$) { $file =~ s#^\Q$base\E/+##; } + if (defined $config{include} && length $config{include}) { + return 0 if $file =~ m/$config{include}/; + } + my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')'; return $file =~ m/$regexp/; } diff --git a/debian/changelog b/debian/changelog index 92afe661f..e5347e2a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,10 @@ ikiwiki (3.20100313) UNRELEASED; urgency=low as used by yahoo and google urls. * Add complete German basewiki and directives translation done by Sebastian Kuhnert. + * 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.) -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/doc/tips/htaccess_file.mdwn b/doc/tips/htaccess_file.mdwn new file mode 100644 index 000000000..5266eba41 --- /dev/null +++ b/doc/tips/htaccess_file.mdwn @@ -0,0 +1,30 @@ +If you try to include a `.htaccess` file in your wiki's source, in order to +configure the web server, you'll find that ikiwiki excludes it from +processing. In fact, ikiwiki excludes any file starting with a dot, as well +as a lot of other files, for good security reasons. + +You can tell ikiwiki not to exclude the .htaccess file by adding this to +your setup file: + + include => '^\.htaccess$', + +Caution! Before you do that, please think for a minute about who can edit +your wiki. Are attachment uploads enabled? Can users commit changes +directly to the version control system? Do you trust everyone who can +make a change to not do Bad Things with the htaccess file? Do you trust +everyone who *might* be able to make a change in the future? Note that a +determined attacker who can write to the htaccess file can probably get a +shell on your web server. + +If any of these questions have given you pause, I suggest you find a +different way to configure the web server. One way is to not put the +`.htaccess` file under ikiwiki's control, and just manually install it +in the destdir. + +[Apache's documentation](http://httpd.apache.org/docs/1.3/howto/htaccess.html) +says +> In general, you should never use .htaccess files unless you don't have +> access to the main server configuration file. +This is good advice -- if you can edit apache's main configuration files, +then you should not use a htaccess file. +--[[Joey]] diff --git a/doc/todo/enable-htaccess-files.mdwn b/doc/todo/enable-htaccess-files.mdwn index 412cb5eba..c895db75d 100644 --- a/doc/todo/enable-htaccess-files.mdwn +++ b/doc/todo/enable-htaccess-files.mdwn @@ -61,3 +61,8 @@ It should be off by default of course. --Max +1 for various purposes (but sometimes the filename isn't `.htaccess`, so please make it configurable) --[[schmonz]] > I've described a workaround for one use case at the [[plugins/rsync]] [[plugins/rsync/discussion]] page. --[[schmonz]] + +--- + +[[done]], you can use the `include` setting to override the default +excludes now. Please use extreme caution when doing so. --[[Joey]] diff --git a/doc/usage.mdwn b/doc/usage.mdwn index a105d7e59..f735170f0 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -234,6 +234,12 @@ also be configured using a setup file. Specifies a rexexp of source files to exclude from processing. May be specified multiple times to add to exclude list. +* --include regexp + + Specifies a rexexp of source files, that would normally be excluded, + but that you wish to include in processing. + May be specified multiple times to add to include list. + * --adminuser name Specifies a username of a user (or, if openid is enabled, an openid) diff --git a/ikiwiki.in b/ikiwiki.in index ae1251ff6..da5555629 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -65,6 +65,9 @@ sub getconfig () { "exclude=s@" => sub { push @{$config{wiki_file_prune_regexps}}, $_[1]; }, + "include=s@" => sub { + $config{include}=defined $config{include} && length $config{include} ? "$config{include}|$_[1]" : $_[1]; + }, "adminuser=s@" => sub { push @{$config{adminuser}}, $_[1] }, -- cgit v1.2.3 From ceadd862930411fed21eab16c428227fdcdc10ba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Mar 2010 15:26:24 -0400 Subject: update --- doc/tips/htaccess_file.mdwn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/htaccess_file.mdwn b/doc/tips/htaccess_file.mdwn index 5266eba41..7b4b0901a 100644 --- a/doc/tips/htaccess_file.mdwn +++ b/doc/tips/htaccess_file.mdwn @@ -22,9 +22,7 @@ different way to configure the web server. One way is to not put the in the destdir. [Apache's documentation](http://httpd.apache.org/docs/1.3/howto/htaccess.html) -says +says: > In general, you should never use .htaccess files unless you don't have > access to the main server configuration file. -This is good advice -- if you can edit apache's main configuration files, -then you should not use a htaccess file. --[[Joey]] -- cgit v1.2.3 From d958e96b01ca459055b2c34f140f7c6ec7168f92 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Mar 2010 15:28:50 -0400 Subject: update --- doc/tips/htaccess_file.mdwn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/htaccess_file.mdwn b/doc/tips/htaccess_file.mdwn index 7b4b0901a..0c1b0f2f7 100644 --- a/doc/tips/htaccess_file.mdwn +++ b/doc/tips/htaccess_file.mdwn @@ -19,10 +19,9 @@ shell on your web server. If any of these questions have given you pause, I suggest you find a different way to configure the web server. One way is to not put the `.htaccess` file under ikiwiki's control, and just manually install it -in the destdir. +in the destdir. --[[Joey]] [Apache's documentation](http://httpd.apache.org/docs/1.3/howto/htaccess.html) says: > In general, you should never use .htaccess files unless you don't have > access to the main server configuration file. ---[[Joey]] -- cgit v1.2.3 From aa36cd66baeca85ca4bca1c35c43b7a01c8a5cf7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Mar 2010 15:30:18 -0400 Subject: update --- doc/tips/htaccess_file.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/htaccess_file.mdwn b/doc/tips/htaccess_file.mdwn index 0c1b0f2f7..6964cf24e 100644 --- a/doc/tips/htaccess_file.mdwn +++ b/doc/tips/htaccess_file.mdwn @@ -21,7 +21,7 @@ different way to configure the web server. One way is to not put the `.htaccess` file under ikiwiki's control, and just manually install it in the destdir. --[[Joey]] -[Apache's documentation](http://httpd.apache.org/docs/1.3/howto/htaccess.html) +[Apache's documentation](http://httpd.apache.org/docs/2.2/howto/htaccess.html) says: > In general, you should never use .htaccess files unless you don't have > access to the main server configuration file. -- cgit v1.2.3 From 9a6a28512025c91b7518d8c9b69678e124c44128 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Thu, 18 Mar 2010 22:33:18 +0000 Subject: corrected the update-the-laptop-from-the-server section --- doc/tips/laptop_wiki_with_git.mdwn | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/laptop_wiki_with_git.mdwn b/doc/tips/laptop_wiki_with_git.mdwn index 85e26c729..857083325 100644 --- a/doc/tips/laptop_wiki_with_git.mdwn +++ b/doc/tips/laptop_wiki_with_git.mdwn @@ -68,5 +68,12 @@ used by the ikiwiki CGI, and another which you can use for updating via git). When you want to update the server from the laptop, do a `git push` from -within the laptop's bare repository, and likewise do a `git pull` to update -the laptop from the server. +within the laptop's bare repository. + +To update the laptop from the server, add a section for the laptop to the config file of the server's bare repository: + + [remote "laptop"] + fetch = +refs/*:refs/* + url = me@laptop:/path/to/bare/repository + +Then do a `git push laptop` from within the server's bare repository. -- cgit v1.2.3 From af83b4c5f576633c03c157a67994af6bfaff617a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 13:40:02 -0400 Subject: Revert "corrected the update-the-laptop-from-the-server section" No, we don't normally push from servers to laptops. Because most laptops do not have publicly accessible IP addresses, for one thing. Also because there's really no reason to ssh to the server from your laptop in order to update the laptop when you can just pull. --- doc/tips/laptop_wiki_with_git.mdwn | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/laptop_wiki_with_git.mdwn b/doc/tips/laptop_wiki_with_git.mdwn index 857083325..85e26c729 100644 --- a/doc/tips/laptop_wiki_with_git.mdwn +++ b/doc/tips/laptop_wiki_with_git.mdwn @@ -68,12 +68,5 @@ used by the ikiwiki CGI, and another which you can use for updating via git). When you want to update the server from the laptop, do a `git push` from -within the laptop's bare repository. - -To update the laptop from the server, add a section for the laptop to the config file of the server's bare repository: - - [remote "laptop"] - fetch = +refs/*:refs/* - url = me@laptop:/path/to/bare/repository - -Then do a `git push laptop` from within the server's bare repository. +within the laptop's bare repository, and likewise do a `git pull` to update +the laptop from the server. -- cgit v1.2.3 From 6dc6fe2f9bc6bcd532291c703a637d24dfe58956 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 13:45:43 -0400 Subject: fix apparently confusing wording --- doc/tips/laptop_wiki_with_git.mdwn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/laptop_wiki_with_git.mdwn b/doc/tips/laptop_wiki_with_git.mdwn index 85e26c729..cfa565d1a 100644 --- a/doc/tips/laptop_wiki_with_git.mdwn +++ b/doc/tips/laptop_wiki_with_git.mdwn @@ -67,6 +67,5 @@ as many times as you want (thus being able to have a repository which is used by the ikiwiki CGI, and another which you can use for updating via git). -When you want to update the server from the laptop, do a `git push` from -within the laptop's bare repository, and likewise do a `git pull` to update -the laptop from the server. +Use standard git commands, run in the laptop's bare git repository +to handle pulling from and pushing to the server. -- cgit v1.2.3 From 9fb3409613d32e447ababb99bc963867b80340e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Mar 2010 17:58:40 -0400 Subject: new tip --- doc/tips/yaml_setup_files.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/tips/yaml_setup_files.mdwn (limited to 'doc/tips') diff --git a/doc/tips/yaml_setup_files.mdwn b/doc/tips/yaml_setup_files.mdwn new file mode 100644 index 000000000..4ae0de4aa --- /dev/null +++ b/doc/tips/yaml_setup_files.mdwn @@ -0,0 +1,10 @@ +Here's how to convert your existing standard format ikiwiki setup file into +the new YAML format recently added to ikiwiki. + +1. First, make sure you have the [[!cpan YAML]] perl module installed. + (Run: `apt-get install libyaml-perl`) +2. Run: `ikiwiki -setup my.setup -dumpsetup my.setup --set setuptype=Yaml` + +The format of the YAML setup file should be fairly self-explanatory. + +--[[Joey]] -- cgit v1.2.3 From ec110abc6d412db5f65ea5b9311596bbe7799fd4 Mon Sep 17 00:00:00 2001 From: Redtexture Date: Sun, 28 Mar 2010 12:21:51 +0000 Subject: add "wait" (best to wait to tackle...) --- doc/tips/spam_and_softwaresites.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/spam_and_softwaresites.mdwn b/doc/tips/spam_and_softwaresites.mdwn index fe73518ef..78a35ff05 100644 --- a/doc/tips/spam_and_softwaresites.mdwn +++ b/doc/tips/spam_and_softwaresites.mdwn @@ -82,5 +82,5 @@ Caveat: if there are no commits you want to keep (i.e. all the commits since the last merge into master are either spam or spam reverts) then `git rebase` will abort. Therefore, this approach only works if you have at least one non-spam commit to the documentation since the last merge into `master`. For -this reason, it's best to tackle spam with reverts until you have at least one +this reason, it's best wait to tackle spam with reverts until you have at least one commit you want merged back into the main history. -- cgit v1.2.3 From 9c6b12fe3de453869be7fa2ae5c1d07e9751a69c Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 28 Mar 2010 14:52:03 +0000 Subject: revert misleading clarification, and try to clarify better --- doc/tips/spam_and_softwaresites.mdwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/spam_and_softwaresites.mdwn b/doc/tips/spam_and_softwaresites.mdwn index 78a35ff05..507858c0c 100644 --- a/doc/tips/spam_and_softwaresites.mdwn +++ b/doc/tips/spam_and_softwaresites.mdwn @@ -82,5 +82,6 @@ Caveat: if there are no commits you want to keep (i.e. all the commits since the last merge into master are either spam or spam reverts) then `git rebase` will abort. Therefore, this approach only works if you have at least one non-spam commit to the documentation since the last merge into `master`. For -this reason, it's best wait to tackle spam with reverts until you have at least one -commit you want merged back into the main history. +this reason, it's best to wait until you have at least one +commit you want merged back into the main history before doing a rebase, +and until then, tackle spam with reverts. -- cgit v1.2.3 From 53c8e674ace50d8733e913e8cfa5d40793e5019d Mon Sep 17 00:00:00 2001 From: PaulePanter Date: Wed, 14 Apr 2010 17:38:39 +0000 Subject: Correct comment. We want to merge the branch *doc* into branch *master* as the sample output suggests. --- doc/tips/spam_and_softwaresites.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/spam_and_softwaresites.mdwn b/doc/tips/spam_and_softwaresites.mdwn index 507858c0c..a07889e6b 100644 --- a/doc/tips/spam_and_softwaresites.mdwn +++ b/doc/tips/spam_and_softwaresites.mdwn @@ -34,7 +34,7 @@ branch. If there is, see 'erase spam from the commit history', below, first. Once you are confident it's clean: - # ensure you are on the doc branch + # ensure you are on the master branch $ git branch doc * master -- cgit v1.2.3 From b14f84c4acccbc8450a9102b3b647013989b27bb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 17:02:29 -0400 Subject: --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. --- IkiWiki.pm | 8 +++++-- IkiWiki/Plugin/bzr.pm | 5 +++++ IkiWiki/Plugin/cvs.pm | 5 +++++ IkiWiki/Plugin/darcs.pm | 5 +++++ IkiWiki/Plugin/git.pm | 5 +++++ IkiWiki/Plugin/mercurial.pm | 5 +++++ IkiWiki/Plugin/monotone.pm | 5 +++++ IkiWiki/Plugin/norcs.pm | 7 +++++- IkiWiki/Plugin/svn.pm | 5 +++++ IkiWiki/Plugin/tla.pm | 5 +++++ IkiWiki/Render.pm | 18 +++++++++++++--- debian/changelog | 5 +++++ .../How_does_ikiwiki_remember_times__63__.mdwn | 25 ++++++---------------- ...old_repository_to_new_ikiwiki_system__63__.mdwn | 4 ---- doc/plugins/write.mdwn | 7 ++++++ doc/rcs.mdwn | 8 +++++-- doc/tips/Importing_posts_from_Wordpress.mdwn | 2 +- doc/tips/inside_dot_ikiwiki/discussion.mdwn | 7 +++--- doc/todo/auto_getctime_on_fresh_build.mdwn | 8 +++++-- doc/usage.mdwn | 10 ++++----- ikiwiki.in | 3 ++- mtime-to-git | 14 ------------ 22 files changed, 109 insertions(+), 57 deletions(-) delete mode 100755 mtime-to-git (limited to 'doc/tips') diff --git a/IkiWiki.pm b/IkiWiki.pm index 1730e476a..7655dada5 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -440,10 +440,10 @@ sub getsetup () { safe => 0, rebuild => 0, }, - getctime => { + gettime => { type => "internal", default => 0, - description => "running in getctime mode", + description => "running in gettime mode", safe => 0, rebuild => 0, }, @@ -1790,6 +1790,10 @@ sub rcs_getctime ($) { $hooks{rcs}{rcs_getctime}{call}->(@_); } +sub rcs_getmtime ($) { + $hooks{rcs}{rcs_getmtime}{call}->(@_); +} + sub rcs_receive () { $hooks{rcs}{rcs_receive}{call}->(); } diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 0efc26b49..f79ca7c8f 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -20,6 +20,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -306,4 +307,8 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for bzr\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/cvs.pm b/IkiWiki/Plugin/cvs.pm index 26a3e9dd2..360d97249 100644 --- a/IkiWiki/Plugin/cvs.pm +++ b/IkiWiki/Plugin/cvs.pm @@ -49,6 +49,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub genwrapper () { @@ -485,4 +486,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for cvs\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/darcs.pm b/IkiWiki/Plugin/darcs.pm index bc8394b90..c1d6661d3 100644 --- a/IkiWiki/Plugin/darcs.pm +++ b/IkiWiki/Plugin/darcs.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub silentsystem (@) { @@ -427,4 +428,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for darcs\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index b02f4a5ed..86d80186f 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -25,6 +25,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive); } @@ -634,6 +635,10 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for git\n"; # TODO +} + sub rcs_receive () { # The wiki may not be the only thing in the git repo. # Determine if it is in a subdirectory by examining the srcdir, diff --git a/IkiWiki/Plugin/mercurial.pm b/IkiWiki/Plugin/mercurial.pm index ea00a3364..34e009c7a 100644 --- a/IkiWiki/Plugin/mercurial.pm +++ b/IkiWiki/Plugin/mercurial.pm @@ -20,6 +20,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -254,4 +255,8 @@ sub rcs_getctime ($) { return $ctime; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for mercurial\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index c33cf7e3a..67d4abbaa 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -23,6 +23,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -693,4 +694,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for monotone\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/norcs.pm b/IkiWiki/Plugin/norcs.pm index e6a05a3c5..053652a5f 100644 --- a/IkiWiki/Plugin/norcs.pm +++ b/IkiWiki/Plugin/norcs.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub getsetup () { @@ -63,7 +64,11 @@ sub rcs_diff ($) { } sub rcs_getctime ($) { - error gettext("getctime not implemented"); + return 0; +} + +sub rcs_getmtime ($) { + return 0; } 1 diff --git a/IkiWiki/Plugin/svn.pm b/IkiWiki/Plugin/svn.pm index 7d27ec842..85c205f09 100644 --- a/IkiWiki/Plugin/svn.pm +++ b/IkiWiki/Plugin/svn.pm @@ -19,6 +19,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -379,4 +380,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for svn\n"; # TODO +} + 1 diff --git a/IkiWiki/Plugin/tla.pm b/IkiWiki/Plugin/tla.pm index 764da9b98..f5ad0cc96 100644 --- a/IkiWiki/Plugin/tla.pm +++ b/IkiWiki/Plugin/tla.pm @@ -18,6 +18,7 @@ sub import { hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges); hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff); hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime); + hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime); } sub checkconfig () { @@ -284,4 +285,8 @@ sub rcs_getctime ($) { return $date; } +sub rcs_getmtime ($) { + error "rcs_getmtime is not implemented for tla\n"; # TODO +} + 1 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index e98888d76..e1cb68462 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -365,14 +365,26 @@ sub find_new_files ($) { } else { push @new, $file; - if ($config{getctime} && -e "$config{srcdir}/$file") { + if ($config{gettime} && -e "$config{srcdir}/$file") { eval { - my $time=rcs_getctime("$config{srcdir}/$file"); - $pagectime{$page}=$time; + my $ctime=rcs_getctime("$config{srcdir}/$file"); + if ($ctime > 0) { + $pagectime{$page}=$ctime; + } }; if ($@) { print STDERR $@; } + my $mtime; + eval { + my $mtime=rcs_getmtime("$config{srcdir}/$file"); + }; + if ($@) { + print STDERR $@; + } + elsif ($mtime > 0) { + utime($mtime, $mtime, "$config{srcdir}/$file"); + } } } $pagecase{lc $page}=$page; diff --git a/debian/changelog b/debian/changelog index 737d73655..615d5916f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,6 +44,11 @@ ikiwiki (3.20100415) UNRELEASED; urgency=low * conditional: Fix bug that forced "all" mode off by default. * calendarmonth.tmpl: The month calendar is now put in a sidebar. * calendar: Improved display of arrows. + * 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. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn index 6ce576db1..6b7739fd0 100644 --- a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn +++ b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn @@ -20,15 +20,17 @@ Do I have it right? > Some VCS, like git, set the file mtimes to the current time > when making a new checkout, so they will be lost if you do that. > The creation times can be retrived using the `--getctime` option. -> I suppose it might be nice if there were a `--getmtime` that pulled -> true modification times out of the VCS, but I haven't found it a big -> deal in practice for the last modification times to be updated to the -> current time when rebuilding a wiki like this. --[[Joey]] +> --[[Joey]] > > > Thanks for the clarification. I ran some tests of my own to make sure I understand it right, and I'm satisfied > > that the order of posts in my blog can be retrieved from the VCS using the `--getctime` option, at least if I > > choose to order my posts by creation time rather than modification time. But I now know that I can't rely on > > page modification times in ikiwiki as these can be lost permanently. +> +> > > Update: It's now renamed to `--gettime`, and pulls both the creation +> > > and modification times. Also, per [[todo/auto_getctime_on_fresh_build]], +> > > this is now done automatically the first time ikiwiki builds a +> > > srcdir. So, no need to worry about this any more! --[[Joey]] > > > > I would suggest that there should at least be a `--getmtime` option like you describe, and perhaps that > > `--getctime` and `--getmtime` be _on by default_. In my opinion the creation times and modification times of @@ -91,19 +93,6 @@ Do I have it right? > A quick workaround for me to get modification times right is the following > little zsh script, which unfortunately only works for git: - #!/usr/bin/env zsh - - set +x - - for FILE in **/*(.); do - TIMES="`git log --pretty=format:%ai $FILE`" - MTIME="`echo $TIMES | head -n1`" - - if [ ! -z $MTIME ]; then - echo touch -m -d "$MTIME" $FILE - touch -m -d "$MTIME" $FILE - fi - - done +>> Elided; no longer needed since --gettime does that, and much faster! --[[Joey]] > --[[David_Riebenbauer]] diff --git a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn index fe67e6aba..d7a33b526 100644 --- a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn +++ b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn @@ -20,10 +20,6 @@ How do I set up an ikiwiki system using a pre-existing repository (instead of cr > recreate the ikiwiki srcdir > 3. `git clone` from the bare git repository a second time, > to create a checkout you can manually edit (optional) -> 4. run `ikiwiki --getctime --setup your.setup` -> The getctime will ensure page creation times are accurate -> by putting the info out of the git history, -> and only needs to be done once. > > If you preserved your repository, but not the setup file, > the easiest way to make one is probably to run diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 707622956..cf7044b2c 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1085,6 +1085,13 @@ it up in the history. It's ok if this is not implemented, and throws an error. +#### `rcs_getmtime($)` + +This is used to get the page modification time for a file from the RCS, by +looking it up in the history. + +It's ok if this is not implemented, and throws an error. + #### `rcs_receive()` This is called when ikiwiki is running as a pre-receive hook (or diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn index 4e7a8d2a6..b5bfc2414 100644 --- a/doc/rcs.mdwn +++ b/doc/rcs.mdwn @@ -14,8 +14,10 @@ use, some advanced or special features are not supported in all of them. Lack of support in [[ikiwiki-makerepo]] or auto.setup can make it harder to set up a wiki using that revision control system. The `rcs_commit_staged` hook is needed to use [[attachments|plugins/attachment]] or -[[plugins/comments]]. And so on. The table below summarises this for each -revision control system and links to more information about each. +[[plugins/comments]]. `rcs_getctime` may be implemented in a fast way +(ie, one log lookup for all files), or very slowly (one lookup per file). +And so on. The table below summarises this for each revision control +system and links to more information about each. [[!table data=""" feature |[[git]]|[[svn]]|[[bzr]] |[[monotone]]|[[mercurial]]|[[darcs]]|[[tla]] |[[cvs]] @@ -25,6 +27,8 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes `rcs_rename` |yes |yes |yes |yes |no |yes |no |yes `rcs_remove` |yes |yes |yes |yes |no |yes |no |yes `rcs_diff` |yes |yes |yes |yes |no |yes |yes |yes +`rcs_getctime` |fast |slow |slow |slow |slow |slow |slow |slow +`rcs_getmtime` |fast |no |no |no |no |no |no |no anonymous push |yes |no |no |no |no |no |no |no conflict handling |yes |yes |yes |buggy |yes |yes |yes |yes """]] diff --git a/doc/tips/Importing_posts_from_Wordpress.mdwn b/doc/tips/Importing_posts_from_Wordpress.mdwn index 59330caa4..8774c9723 100644 --- a/doc/tips/Importing_posts_from_Wordpress.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress.mdwn @@ -1,6 +1,6 @@ Use case: You want to move away from Wordpress to Ikiwiki as your blogging/website platform, but you want to retain your old posts. -[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --getctime to get the preserve creation times on checkout. +[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --gettime to get the preserve creation times on checkout. WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned. diff --git a/doc/tips/inside_dot_ikiwiki/discussion.mdwn b/doc/tips/inside_dot_ikiwiki/discussion.mdwn index 34d5b9252..69df369ec 100644 --- a/doc/tips/inside_dot_ikiwiki/discussion.mdwn +++ b/doc/tips/inside_dot_ikiwiki/discussion.mdwn @@ -6,14 +6,15 @@ My database appears corrupted: No idea how this happened. I've blown it away and recreated it but, for future reference, is there any less violent way to recover from this situation? I miss having the correct created and last edited times. --[[sabr]] > update: fixed ctimes and mtimes using [these instructions](http://u32.net/Mediawiki_Conversion/Git_Import/#Correct%20Creation%20and%20Last%20Edited%20time) --[[sabr]] -> That's overly complex. Just run `ikiwiki -setup your.setup -getctime`. +> That's overly complex. Just run `ikiwiki -setup your.setup -gettime`. > BTW, I'd be interested in examining such a corrupt storable file to try > to see what happened to it. --[[Joey]] ->> --getctime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo. +>> --gettime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo. >>> Pulling the page creation date out of the git history is exactly what ->>> --getctime does. --[[Joey]] +>>> --gettime does. (It used to be called --getctime, and only do that; now +>>> it also pulls out the last modified date). --[[Joey]] >> Alas, I seem to have lost the bad index file to periodic /tmp wiping; I'll send it to you if it happens again. --[[sabr]] diff --git a/doc/todo/auto_getctime_on_fresh_build.mdwn b/doc/todo/auto_getctime_on_fresh_build.mdwn index ea95fb8c9..760c56fa1 100644 --- a/doc/todo/auto_getctime_on_fresh_build.mdwn +++ b/doc/todo/auto_getctime_on_fresh_build.mdwn @@ -1,9 +1,13 @@ [[!tag wishlist]] -It might be a good idea to enable --getctime when `.ikiwiki` does not +It might be a good idea to enable --gettime when `.ikiwiki` does not exist. This way a new checkout of a `srcdir` would automatically get -ctimes right. (Running --getctime whenever a rebuild is done would be too +ctimes right. (Running --gettime whenever a rebuild is done would be too slow.) --[[Joey]] Could this be too annoying in some cases, eg, checking out a large wiki that needs to get set up right away? --[[Joey]] + +> Not for git with the new, optimised --getctime. For other VCS.. well, +> pity they're not as fast as git ;), but it is a one-time expense... +> [[done]] --[[Joey]] diff --git a/doc/usage.mdwn b/doc/usage.mdwn index db1e36a10..553fef01e 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -320,13 +320,11 @@ also be configured using a setup file. intercepted. If you enable this option then you must run at least the CGI portion of ikiwiki over SSL. -* --getctime +* --gettime - Pull creation time for each new page out of the revision control - system. This rarely used option provides a way to get the real creation - times of items in weblogs, such as when building a wiki from a new - VCS checkout. It is unoptimised and quite slow. It is best used - with --rebuild, to force ikiwiki to get the ctime for all pages. + Extract creation and modification times for each new page from the + the revision control's log. This is done automatically when building a + wiki for the first time, so you normally do not need to use this option. * --set var=value diff --git a/ikiwiki.in b/ikiwiki.in index 38e4d3201..801ff9a0b 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -44,7 +44,8 @@ sub getconfig () { "wrappergroup=s" => \$config{wrappergroup}, "usedirs!" => \$config{usedirs}, "prefix-directives!" => \$config{prefix_directives}, - "getctime" => \$config{getctime}, + "getctime" => \$config{gettime}, + "gettime" => \$config{gettime}, "numbacklinks=i" => \$config{numbacklinks}, "rcs=s" => \$config{rcs}, "no-rcs" => sub { $config{rcs}="" }, diff --git a/mtime-to-git b/mtime-to-git deleted file mode 100755 index 9875af5d7..000000000 --- a/mtime-to-git +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# Sets mtimes of all files in the tree their last change date -# based on git's log. Useful to avoid too new dates after a -# fresh checkout, which lead to ikiwiki unnecessarily rebuilding -# basewiki files on upgrade. -if [ -d .git ]; then - for file in $(git ls-files); do - date="$(git log -1 --date=rfc "$file" | grep ^Date: | sed -e 's/Date://')" - if [ -n "$date" ]; then - echo "$date $file" - touch -d"$date" $file - fi - done -fi -- cgit v1.2.3 From e31b1b27f83f47da10b2775f192eb8eefcfc68a2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Apr 2010 19:25:25 -0400 Subject: remove note about needing --gettime; automatically run on first build now --- doc/tips/Importing_posts_from_Wordpress.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/Importing_posts_from_Wordpress.mdwn b/doc/tips/Importing_posts_from_Wordpress.mdwn index 8774c9723..ecc6ae505 100644 --- a/doc/tips/Importing_posts_from_Wordpress.mdwn +++ b/doc/tips/Importing_posts_from_Wordpress.mdwn @@ -1,6 +1,6 @@ Use case: You want to move away from Wordpress to Ikiwiki as your blogging/website platform, but you want to retain your old posts. -[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's --gettime to get the preserve creation times on checkout. +[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned. -- cgit v1.2.3 From 7e79da76332b93214a7d9a5c91bc046db4219ee2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 16:10:46 -0400 Subject: template docu reorg Remove wikitemplates page; fold its contents into templates page. Update all backlinks. Document new ability to put templates inside srcdir. --- doc/bugs/SSI_include_stripped_from_mdwn.mdwn | 2 +- doc/bugs/login_page_non-obvious_with_openid.mdwn | 4 +- doc/features.mdwn | 2 +- doc/freesoftware.mdwn | 2 +- doc/ikiwiki-calendar.mdwn | 2 +- doc/ikiwiki/directive/edittemplate.mdwn | 2 +- doc/ikiwiki/directive/pagetemplate.mdwn | 8 +- doc/ikiwiki/directive/template.mdwn | 8 +- doc/plugins/autoindex.mdwn | 2 +- doc/plugins/map/discussion.mdwn | 2 +- doc/plugins/pagetemplate.mdwn | 6 +- doc/plugins/template.mdwn | 4 +- doc/plugins/write.mdwn | 4 +- doc/templates.mdwn | 91 +++++++++++++++++++--- doc/tips/comments_feed.mdwn | 2 +- ...o-create_tag_pages_according_to_a_template.mdwn | 2 +- doc/todo/auto_rebuild_on_template_change.mdwn | 2 +- doc/todo/html.mdwn | 2 +- doc/todo/multiple_templates.mdwn | 2 +- doc/usage.mdwn | 5 +- doc/wikitemplates.mdwn | 52 ------------- doc/wikitemplates/discussion.mdwn | 46 ----------- 22 files changed, 111 insertions(+), 141 deletions(-) delete mode 100644 doc/wikitemplates.mdwn delete mode 100644 doc/wikitemplates/discussion.mdwn (limited to 'doc/tips') diff --git a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn index 5519e45c6..270da86d3 100644 --- a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn +++ b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn @@ -10,7 +10,7 @@ If I have a <--#include virtual="foo" --> in some file, it gets stripped, > Anyway, it makes sense for the htmlscrubber to strip server-side > includes because otherwise your wiki could be attacked > by them being added to it. If you want to use both the htmlscrubber and -> SSI together, I'd suggest you modify the [[wikitemplates]] +> SSI together, I'd suggest you modify the [[templates]] > and put the SSI on there. > > Ie, `page.tmpl` has a diff --git a/doc/bugs/login_page_non-obvious_with_openid.mdwn b/doc/bugs/login_page_non-obvious_with_openid.mdwn index 1d087985a..9aa702037 100644 --- a/doc/bugs/login_page_non-obvious_with_openid.mdwn +++ b/doc/bugs/login_page_non-obvious_with_openid.mdwn @@ -36,7 +36,7 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > that allows modifying that form, but does not allow creating a separate > form. The best way to make it obvious how to use it currently is to just > disable password auth, then it's nice and simple. :-) Javascript is an -> interesting idea. It's also possible to write a custom [[signin.tmpl wikitemplates]] that +> interesting idea. It's also possible to write a custom [[templates]] that > is displayed instead of the regular signin form, and it should be > possible to use that to manually lay it out better than FormBuilder > manages with its automatic layout. --[[Joey]] @@ -44,4 +44,4 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > I've improved the form, I think it's more obvious now that the openid > stuff is separate. Good enough to call this [[done]]. I think. --[[Joey]] ->> Looks good, thanks! :-) -- [[AdamShand]] \ No newline at end of file +>> Looks good, thanks! :-) -- [[AdamShand]] diff --git a/doc/features.mdwn b/doc/features.mdwn index ab521213d..07ce648ea 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). Ikiwiki -generates html using [[templates|wikitemplates]], and uses [[css]], so you +generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. ## [[Plugins]] diff --git a/doc/freesoftware.mdwn b/doc/freesoftware.mdwn index 7ac1ac6b4..2243d9b1f 100644 --- a/doc/freesoftware.mdwn +++ b/doc/freesoftware.mdwn @@ -4,7 +4,7 @@ ikiwiki, and this documentation wiki, are licensed under the terms of the GNU [[GPL]], version 2 or later. The parts of ikiwiki that become part of your own wiki (the [[basewiki]] -pages (but not the smilies) and the [[templates|wikitemplates]]) are licensed +pages (but not the smilies) and the [[templates]]) are licensed as follows: > Redistribution and use in source and compiled forms, with or without diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn index c1f4d7267..03cbdd86c 100644 --- a/doc/ikiwiki-calendar.mdwn +++ b/doc/ikiwiki-calendar.mdwn @@ -43,7 +43,7 @@ An example crontab: # TEMPLATES -This command uses two [[template|wikitemplates]] to generate +This command uses two [[templates]] to generate the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. # AUTHOR diff --git a/doc/ikiwiki/directive/edittemplate.mdwn b/doc/ikiwiki/directive/edittemplate.mdwn index d731bdb47..c486e821b 100644 --- a/doc/ikiwiki/directive/edittemplate.mdwn +++ b/doc/ikiwiki/directive/edittemplate.mdwn @@ -21,7 +21,7 @@ something like: Details: The template page can also contain [[!cpan HTML::Template]] directives, -similar to other ikiwiki [[templates]]. Currently only one variable is +like other ikiwiki [[templates]]. Currently only one variable is set: `` is replaced with the name of the page being created. diff --git a/doc/ikiwiki/directive/pagetemplate.mdwn b/doc/ikiwiki/directive/pagetemplate.mdwn index 8ad901c1a..401b38099 100644 --- a/doc/ikiwiki/directive/pagetemplate.mdwn +++ b/doc/ikiwiki/directive/pagetemplate.mdwn @@ -1,17 +1,13 @@ The `pagetemplate` directive is supplied by the [[!iki plugins/pagetemplate desc=pagetemplate]] plugin. -This directive allows a page to be displayed using a different template than -the default `page.tmpl` template. +This directive allows a page to be displayed using a different +[[template|templates]] than the default `page.tmpl` template. The page text is inserted into the template, so the template controls the overall look and feel of the wiki page. This is in contrast to the [[ikiwiki/directive/template]] directive, which allows inserting templates _into_ the body of a page. -This directive can only reference templates that are already installed -by the system administrator, typically into the -`/usr/share/ikiwiki/templates` directory. Example: - \[[!pagetemplate template="my_fancy.tmpl"]] [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index ae71ba5b5..052ca7873 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -1,7 +1,11 @@ The `template` directive is supplied by the [[!iki plugins/template desc=template]] plugin. -[[Templates]] are files that can be filled out and inserted into pages in the -wiki, by using the template directive. The directive has an `id` parameter +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. The [[templates]] page lists templates +that can be used with this directive. + +The directive has an `id` parameter that identifies the template to use. The remaining parameters are used to fill out the template. diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn index d1133e4f5..7c4e40419 100644 --- a/doc/plugins/autoindex.mdwn +++ b/doc/plugins/autoindex.mdwn @@ -3,5 +3,5 @@ This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent page, and generates the parent pages. The generated page content is -controlled by the `autoindex.tmpl` [[template|wikitemplates]], which by +controlled by the `autoindex.tmpl` [[template|templates]], which by default, uses a [[map]] to list the SubPages. diff --git a/doc/plugins/map/discussion.mdwn b/doc/plugins/map/discussion.mdwn index 2f7b140d6..54c921b0f 100644 --- a/doc/plugins/map/discussion.mdwn +++ b/doc/plugins/map/discussion.mdwn @@ -1,7 +1,7 @@ I'm wanting a [[map]] (with indentation levels) showing page _titles_ instead of page 'names'. As far as I can see, this is not an option with existing plugins - I can get a list of pages using [[inline]] and -appropriate [[wikitemplates]], but that has no indentation and therefore +appropriate [[templates]], but that has no indentation and therefore doesn't show structure well. The quick way is to modify the map plugin to have a 'titles' option. The diff --git a/doc/plugins/pagetemplate.mdwn b/doc/plugins/pagetemplate.mdwn index 53f069d0d..8254e14c5 100644 --- a/doc/plugins/pagetemplate.mdwn +++ b/doc/plugins/pagetemplate.mdwn @@ -3,8 +3,4 @@ This plugin provides the [[ikiwiki/directive/pagetemplate]] [[ikiwiki/directive]], which allows a page to be displayed -using a different [[template|wikitemplates]] than the default. - -This plugin can only use templates that are already installed in -`/usr/share/ikiwiki/templates` (or wherever ikiwiki is configured to look for -them). You can choose to use any .tmpl files in that directory. +using a different [[template|templates]] than the default. diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index da775f232..8d17e2825 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -3,5 +3,5 @@ This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out -and inserted into pages in the wiki. It's documented and existing templates -are listed in the [[templates]] page. +and inserted into pages in the wiki. Existing templates are listed in the +[[templates]] page. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 00b54bdd3..9128c7f54 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -297,7 +297,7 @@ value is ignored. hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); -[[Templates|wikitemplates]] are filled out for many different things in +[[Templates]] are filled out for many different things in ikiwiki, like generating a page, or part of a blog page, or an rss feed, or a cgi. This hook allows modifying the variables available on those templates. The function is passed named parameters. The "page" and @@ -313,7 +313,7 @@ a new custom parameter to the template. hook(type => "templatefile", id => "foo", call => \&templatefile); -This hook allows plugins to change the [[template|wikitemplates]] that is +This hook allows plugins to change the [[template|templates]] that is used for a page in the wiki. The hook is passed a "page" parameter, and should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default diff --git a/doc/templates.mdwn b/doc/templates.mdwn index f2b581d2f..f7b3adae5 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,17 +1,88 @@ -[[!meta robots="noindex, follow"]] -[[!if test="enabled(template)" -then="This wiki has templates **enabled**." -else="This wiki has templates **disabled**." -]] +[[Ikiwiki]] uses many templates for many purposes. By editing its templates, +you can fully customise this site. -Templates are files that can be filled out and inserted into pages in the -wiki. +[[!if test="enabled(template)" then=""" +## The template directive +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. +"""]] [[!if test="enabled(template) and enabled(inline)" then=""" - -These templates are available for use with the template directive. - [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] + +[[!if test="enabled(edittemplate)" then=""" +## The edittemplate directive + +The edittemplate directive can be used to make new pages default to +containing text from a template, which can be filled as out the page is +edited. +"""]] + +## Wiki templates + +These templates are used to build the wiki. The aim is to keep almost all +html out of ikiwiki and in the templates. + +* `page.tmpl` - Used for displaying all regular wiki pages. +* `misc.tmpl` - Generic template used for any page that doesn't + have a custom template. +* `editpage.tmpl` - Create/edit page. +* `change.tmpl` - Used to create a page describing a change made to the wiki. +* `passwordmail.tmpl` - Not a html template, this is used to + generate a mail with an url the user can use to reset their password. +* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. +* `rssitem.tmpl` - Used for generating individual items on rss feeds. +* `atompage.tmpl` - Used for generating atom feeds for blogs. +* `atomitem.tmpl` - Used for generating individual items on atom feeds. +* `inlinepage.tmpl` - Used for adding a page inline in a blog + page. +* `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `microblog.tmpl` - Used for showing a microblogging post inline. +* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) +* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. +* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create + a page for a post. +* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search + form to wiki pages. +* `searchquery.tmpl` - This is an omega template, used by the + [[plugins/search]] plugin. +* `comment.tmpl` - This template is used to display a comment + by the [[plugins/comments]] plugin. +* `editcomment.tmpl` - This template is the comment post form for the + [[plugins/comments]] plugin. +* `commentmoderation.tmpl` - This template is used to produce the comment + moderation form. +* `recentchanges.tmpl` - This template is used for listing a change + on the RecentChanges page. + +[[!if test="enabled(pagetemplate)" then=""" +## The pagetemplate directive + +The pagetemplate directive can allow individual pages to use a +different template than `page.tmpl`. +"""]] + +## Template locations + +Templates are located in `/usr/share/ikiwiki/templates` by default; +the `templatedir` setting can be used to make another directory be +searched first. Customized templates can also be placed inside the +"templates/" directory in your wiki's source. + +## Template syntax + +Ikiwiki uses the HTML::Template module as its template engine. This +supports things like conditionals and loops in templates and is pretty easy +to learn. All you really need to know are a few things: + +* To insert the value of a template variable, use ``. +* To make a block of text conditional on a variable being set use + `text`. +* To use one block of text if a variable is set and a second if it's not, + use `textother text` + +[[!meta robots="noindex, follow"]] diff --git a/doc/tips/comments_feed.mdwn b/doc/tips/comments_feed.mdwn index 6f8137256..6d4dbb803 100644 --- a/doc/tips/comments_feed.mdwn +++ b/doc/tips/comments_feed.mdwn @@ -6,5 +6,5 @@ add a feed that contains all the comments posted to any page. Here's how: \[[!inline pages="internal(*/comment_*)" template=comment]] The special [[ikiwiki/PageSpec]] matches all comments. The -[[template|wikitemplates]] causes the comments to be displayed formatted +[[template|templates]] causes the comments to be displayed formatted nicely. diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index f6d444890..7eb404910 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -17,7 +17,7 @@ The new tag file is then complied during the change phase. *see git history of this page if you want the patch --[[smcv]]* -This uses a [[template|wikitemplates]] called `autotagpage.tmpl`, here is my template file: +This uses a [[template|templates]] called `autotagpage.tmpl`, here is my template file: \[[!inline pages="link()" archive="yes"]] diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index a112cb9da..838d15c1a 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -6,7 +6,7 @@ This would allow setting: templatedir => "$srcdir/templates", -.. and then the [[wikitemplates]] are managed like other wiki files; and +.. and then the [[templates]] are managed like other wiki files; and like other wiki files, a change to them automatically updates dependent pages. diff --git a/doc/todo/html.mdwn b/doc/todo/html.mdwn index 44f20c876..4f4542be2 100644 --- a/doc/todo/html.mdwn +++ b/doc/todo/html.mdwn @@ -1,6 +1,6 @@ Create some nice(r) stylesheets. Should be doable w/o touching a single line of code, just -editing the [[wikitemplates]] and/or editing [[style.css]]. +editing the [[templates]] and/or editing [[style.css]]. [[done]] ([[css_market]] ..) diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 72783c556..30fb8d6ee 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -1,4 +1,4 @@ -> Another useful feature might be to be able to choose a different [[template|wikitemplates]] +> Another useful feature might be to be able to choose a different [[template|templates]] > file for some pages; [[blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 2e12517ea..9cf61cc6c 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -120,10 +120,11 @@ also be configured using a setup file. * --templatedir dir - Specify the directory that the page [[templates|wikitemplates]] are stored in. + Specify the directory that [[templates|templates]] are stored in. Default is `/usr/share/ikiwiki/templates`, or another location as configured at build time. If the templatedir is changed, missing templates will still - be searched for in the default location as a fallback. + be searched for in the default location as a fallback. Templates can also be + placed in the "templates/" subdirectory of the srcdir. Note that if you choose to copy and modify ikiwiki's templates, you will need to be careful to keep them up to date when upgrading to new versions of diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn deleted file mode 100644 index 6e5a7261d..000000000 --- a/doc/wikitemplates.mdwn +++ /dev/null @@ -1,52 +0,0 @@ -ikiwiki uses the HTML::Template module as its template engine. This -supports things like conditionals and loops in templates and is pretty easy -to learn. - -The aim is to keep almost all html out of ikiwiki and in the templates. - -It ships with some basic templates which can be customised. These are -located in `/usr/share/ikiwiki/templates` by default; the `templatedir` -setting can be used to make another directory be searched first. - -* `page.tmpl` - Used for displaying all regular wiki pages. -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. -* `editpage.tmpl` - Create/edit page. -* `change.tmpl` - Used to create a page describing a change made to the wiki. -* `passwordmail.tmpl` - Not a html template, this is used to - generate a mail with an url the user can use to reset their password. -* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. -* `rssitem.tmpl` - Used for generating individual items on rss feeds. -* `atompage.tmpl` - Used for generating atom feeds for blogs. -* `atomitem.tmpl` - Used for generating individual items on atom feeds. -* `inlinepage.tmpl` - Used for adding a page inline in a blog - page. -* `archivepage.tmpl` - Used for listing a page in a blog archive page. -* `microblog.tmpl` - Used for showing a microblogging post inline. -* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) -* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. -* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create - a page for a post. -* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search - form to wiki pages. -* `searchquery.tmpl` - This is an omega template, used by the - [[plugins/search]] plugin. -* `comment.tmpl` - This template is used to display a comment - by the [[plugins/comments]] plugin. -* `editcomment.tmpl` - This template is the comment post form for the - [[plugins/comments]] plugin. -* `commentmoderation.tmpl` - This template is used to produce the comment - moderation form. -* `recentchanges.tmpl` - This template is used for listing a change - on the RecentChanges page. - -The [[plugins/pagetemplate]] plugin can allow individual pages to use a -different template than `page.tmpl`. - -The [[plugins/template]] plugin also uses templates, though those -[[templates]] are typically stored as pages in the wiki, and are inserted -into pages. - -The [[plugins/edittemplate]] plugin is used to make new pages default to -containing text from a template, which can be filled as out the page is -edited. diff --git a/doc/wikitemplates/discussion.mdwn b/doc/wikitemplates/discussion.mdwn deleted file mode 100644 index f97444e5f..000000000 --- a/doc/wikitemplates/discussion.mdwn +++ /dev/null @@ -1,46 +0,0 @@ -## Place for local templates -Where does one put any locally modified templates for an individual ikiwiki? --Ivan Z. - -> You can put them whereever you like; the `templatedir` controls -> where ikiwiki looks for them. --[[Joey]] - -Thank you for your response! My question arose out of my intention to make -custom templates for a wiki--specifically suited for the kind of content -it will have--so, that would mean I would want to distribute them through -git together with other content of the wiki. So, for this case the -separation of conceptually ONE thing (the content, the templates, and the -config option which orders to use these templates) into THREE separate -files/repos (the main content repo, the repo with templates, and the config -file) is not convenient: instead of distributing a single repo, I have to -tell people to take three things if they want to replicate this wiki. How -would you solve this inconvenience? Perhaps, a default location of the -templates *inside* the source repo would do?--Ivan Z. - -> I would avoid putting the templates in a subdirectory of the ikiwiki srcdir. -> (I'd also avoid putting the ikiwiki setup file there.) -> While it's safe to do either in some cases, there are configurations where -> it's unsafe. For example, a malicious user could use attachment handling to -> replace those files with their own, bad versions. -> -> So, two ideas for where to put the templatedir and ikiwiki setup. - -> * The easiest option is to put your wiki content in a subdirectory -> ("wiki", say) and point `srcdir` at that. -> then you can have another subdirectory for the wikitemplates, -> and put the setup file at the top. -> * Another option if using git would be to have a separate branch, -> in the same git repository, that holds wikitemplates and the setup file. -> Then you check out the repository once to make the `srcdir` available, -> and have a second checkout, of the other branch, to make the other stuff -> available. -> -> Note that with either of these methods, you have to watch out if -> giving other direct commit access to the repository. They could -> still edit the setup file and templates, so only trusted users should -> be given access. (It is, however, perfectly safe to let people edit -> the wiki via the web, and is even safe to configure -> [[tips/untrusted_git_push]] to such a repository.) --[[Joey]] - -Thanks, that's a nice and simple idea: to have a subdirectory! I'll try it. --Ivan Z. - -A [[!taglink wish|wishlist]]: the ikiwiki program could be improved so that it follows the same logic as git in looking for its config: it could ascend directories until it finds an `.ikiwiki/` directory with `.ikiwiki/setup` and then uses that configuration. Now I'm tired to always type `ikiwiki --setup path/to/the/setup --refresh` when working in my working clone of the sources; I'd like to simply type `ikiwiki` instead, and let it find the setup file. The default location to look for templates could also be made to be a sibling of the setup file: `.ikiwiki/templates/`. --Ivan Z. -- cgit v1.2.3 From 86484c109d30c0062c5a5056f4adf41c0581b5e9 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 26 Apr 2010 15:14:08 +0000 Subject: table name for querying the mediawiki mysql db --- doc/tips/convert_mediawiki_to_ikiwiki.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn index 9719d9a7e..db1a1745c 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn @@ -59,7 +59,13 @@ specific prefix: e.g. `Category:` will be stripped off. ### Querying the database If you have access to the relational database in which your mediawiki data is -stored, it is possible to derive a list of page names from this. +stored, it is possible to derive a list of page names from this. With mediawiki's +MySQL backend, the page table is, appropriately enough, called `table`: + + SELECT page_namespace, page_title FROM page; + +As with the previous method, you will need to do some filtering based on the +namespace. ## Step 2: fetching the page data -- cgit v1.2.3 From 60481cad90d61a4d1abe2dc5e69eee69ce938992 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 26 Apr 2010 15:19:04 +0000 Subject: move list of namespaces to its own section --- doc/tips/convert_mediawiki_to_ikiwiki.mdwn | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn index db1a1745c..fe0fd46b0 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn @@ -48,10 +48,7 @@ in HTML, you may need to add further processing to the last line. Note that by default, `Special:Allpages` will only list pages in the main namespace. You need to add a `&namespace=XX` argument to get pages in a -different namespace. The following numbers correspond to common namespaces: - - * 10 - templates (`Template:foo`) - * 14 - categories (`Category:bar`) +different namespace. (See below for the default list of namespaces) Note that the page names obtained this way will not include any namespace specific prefix: e.g. `Category:` will be stripped off. @@ -67,6 +64,12 @@ MySQL backend, the page table is, appropriately enough, called `table`: As with the previous method, you will need to do some filtering based on the namespace. +### namespaces + +The list of default namespaces in mediawiki is available from , reproduced here for convenience: + +[[mediawiki_namespaces]] + ## Step 2: fetching the page data Once you have a list of page names, you can fetch the data for each page. -- cgit v1.2.3 From 76e8e4ea838516ebdb8e981fff47efa6af836079 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 26 Apr 2010 15:24:50 +0000 Subject: insert table of common namespaces --- doc/tips/convert_mediawiki_to_ikiwiki.mdwn | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn index fe0fd46b0..3a266bc8b 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn @@ -66,9 +66,18 @@ namespace. ### namespaces -The list of default namespaces in mediawiki is available from , reproduced here for convenience: - -[[mediawiki_namespaces]] +The list of default namespaces in mediawiki is available from . Here are reproduced the ones you are most likely to encounter if you are running a small mediawiki install for your own purposes: + +[[!table data=""" +Index | Name | Example +0 | Main | Foo +1 | Talk | Talk:Foo +2 | User | User:Jon +3 | User talk | User_talk:Jon +6 | File | File:Barack_Obama_signature.svg +10 | Template | Template:Prettytable +14 | Category | Category:Pages_needing_review +"""]] ## Step 2: fetching the page data -- cgit v1.2.3 From d3c994d980c2f52102c78c0157ce06140c639bc6 Mon Sep 17 00:00:00 2001 From: "http://jmtd.livejournal.com/" Date: Mon, 26 Apr 2010 15:29:04 +0000 Subject: fix indent --- doc/tips/convert_mediawiki_to_ikiwiki.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn index 3a266bc8b..38de01109 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki.mdwn @@ -59,7 +59,7 @@ If you have access to the relational database in which your mediawiki data is stored, it is possible to derive a list of page names from this. With mediawiki's MySQL backend, the page table is, appropriately enough, called `table`: - SELECT page_namespace, page_title FROM page; + SELECT page_namespace, page_title FROM page; As with the previous method, you will need to do some filtering based on the namespace. -- cgit v1.2.3 From a6bd053638c67e5410c4a0a3742ba3825320b344 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Apr 2010 16:31:00 -0400 Subject: remove manual file remove instructions Since that was written, ikiwiki got fixed to track old rendered files across --rebuild and remove them. --- doc/tips/switching_to_usedirs.mdwn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc/tips') diff --git a/doc/tips/switching_to_usedirs.mdwn b/doc/tips/switching_to_usedirs.mdwn index 183ce00ac..92871439f 100644 --- a/doc/tips/switching_to_usedirs.mdwn +++ b/doc/tips/switching_to_usedirs.mdwn @@ -8,9 +8,7 @@ to usedirs, or edit your setup file and turn usedirs back off. or manually. * Since usedirs is enabled, ikiwiki will have created a bunch of new html files. Where before ikiwiki generated a `dest/foo.html`, now it will - generate `dest/foo/index.html`. But, the old html files will still be - present too. Remove them: - find dest -name \*.html -not -name index.html -exec rm {} \; + generate `dest/foo/index.html`. The old html files will be removed. * If you have a blog that is aggregated on a Planet or similar, all the items in the RSS or atom feed will seem like new posts, since their URLs have changed. See [[howto_avoid_flooding_aggregators]] for a workaround. -- cgit v1.2.3 From 0c7d2cf9b2773bd17c0ec549ed1ba833ff1913e1 Mon Sep 17 00:00:00 2001 From: albertlash Date: Thu, 29 Apr 2010 03:44:27 +0000 Subject: --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 683a3f8ac..31110f3c6 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -1,3 +1,11 @@ +20100428 - I just wrote a simple ruby script which will connect to a mysql server and then recreate the pages and their revision histories with Grit. It also does one simple conversion of equals titles to pounds. Enjoy! + +http://github.com/docunext/mediawiki2gitikiwiki + +-- [[users/Albert]] + +---- + The u32 page is excellent, but I wonder if documenting the procedure here would be worthwhile. Who knows, the remote site might disappear. But also there are some variations on the approach that might be useful: -- cgit v1.2.3 From ebde1ee2fd814e45e0e108bb1a9ba81499d86c87 Mon Sep 17 00:00:00 2001 From: albertlash Date: Thu, 29 Apr 2010 03:44:52 +0000 Subject: --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 31110f3c6..592a06a5b 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -1,6 +1,6 @@ 20100428 - I just wrote a simple ruby script which will connect to a mysql server and then recreate the pages and their revision histories with Grit. It also does one simple conversion of equals titles to pounds. Enjoy! -http://github.com/docunext/mediawiki2gitikiwiki + -- [[users/Albert]] -- cgit v1.2.3 From d57d2ecca722cb7c43d2b14ed31f38c3e204079c Mon Sep 17 00:00:00 2001 From: simonraven Date: Thu, 29 Apr 2010 16:18:15 +0000 Subject: YA URI to another mediawiki to git project --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 592a06a5b..8a2261543 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -657,3 +657,6 @@ page.--[[users/Chadius]] > on mediawiki in general. It seems to produce output that could be > used by the [[plugins/contrib/mediawiki]] plugin, if the filenames > were fixed to use the right extension. --[[Joey]] + +>> Here's another I found while browsing around starting from the link you gave Joey
+>> -- cgit v1.2.3 From f7f1dd3a3852ef158a577387faee2c34c4f9cfad Mon Sep 17 00:00:00 2001 From: simonraven Date: Thu, 29 Apr 2010 16:24:23 +0000 Subject: more to add on my comment --- doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/tips') diff --git a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn index 8a2261543..d67a9131b 100644 --- a/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn +++ b/doc/tips/convert_mediawiki_to_ikiwiki/discussion.mdwn @@ -659,4 +659,7 @@ page.--[[users/Chadius]] > were fixed to use the right extension. --[[Joey]] >> Here's another I found while browsing around starting from the link you gave Joey
->> +>>
+>> As I don't run mediawiki anymore, but I still have my xz/gzip-compressed XML dumps, +>> it's certainly easier for me to do it this way; also a file or a set of files is easier to lug +>> around on some medium than a full mysqld or postgres master and relevant databases. -- cgit v1.2.3 From 34076e398cb7662e3bf0659d591faa4208679882 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 17:16:15 -0400 Subject: html5 bug closure, and documentation --- doc/bugs/html5_support.mdwn | 6 ++++++ doc/features.mdwn | 2 +- doc/roadmap.mdwn | 2 +- doc/tips/html5.mdwn | 25 +++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 doc/tips/html5.mdwn (limited to 'doc/tips') diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 0b15e64f6..3d1689301 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -106,3 +106,9 @@ As a workaround: ## tidy plugin Will reformat html5 to html4. + +---- + + +Ok, I consider this [[done]], at least as a first pass. Html5 mode +is experimental, but complete enough. --[[Joey]] diff --git a/doc/features.mdwn b/doc/features.mdwn index 215c1cecd..1f8168703 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). -(Experimental HTML5 support is also available.) +(Experimental [[tips/HTML5]] support is also available.) Ikiwiki generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 4b5f01c45..e257c21a2 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -80,7 +80,7 @@ Probably incomplete list: * YADA format setup files per default? * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. -* html5 on by default (some day..) +* [[tips/html5]] on by default (some day..) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that diff --git a/doc/tips/html5.mdwn b/doc/tips/html5.mdwn new file mode 100644 index 000000000..9321aa401 --- /dev/null +++ b/doc/tips/html5.mdwn @@ -0,0 +1,25 @@ +First, if you just want to embed videos using the html5 `