summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSimon McVittie <smcv@carbon.pseudorandom.co.uk>2008-07-14 22:22:39 +0100
committerSimon McVittie <smcv@carbon.pseudorandom.co.uk>2008-07-14 22:22:39 +0100
commita65d312467c5ab179ecf4aa715790f371a46634a (patch)
tree7565862f3e2f86a1e9ff623d991f3150860230a4 /doc
parent31bc223abbe0ec1990921b4bab85f074431b0c1d (diff)
parent66053f6fc7b300c9b49a5c69d2c7a1eeec841743 (diff)
Merge branch 'master' of git://git.ikiwiki.info
Diffstat (limited to 'doc')
-rw-r--r--doc/bugs/Broken_URL_to_your_blog_script.mdwn10
-rw-r--r--doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn3
-rw-r--r--doc/plugins/write.mdwn13
-rw-r--r--doc/plugins/write/tutorial.mdwn4
-rw-r--r--doc/rcs/mercurial.mdwn12
-rw-r--r--doc/tips/blog_script.mdwn2
-rw-r--r--doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn2
-rw-r--r--doc/todo/color_plugin.mdwn28
-rw-r--r--doc/todo/mercurial.mdwn2
-rw-r--r--doc/todo/pedigree_plugin.mdwn76
10 files changed, 137 insertions, 15 deletions
diff --git a/doc/bugs/Broken_URL_to_your_blog_script.mdwn b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
new file mode 100644
index 000000000..3d6661d9c
--- /dev/null
+++ b/doc/bugs/Broken_URL_to_your_blog_script.mdwn
@@ -0,0 +1,10 @@
+Joey, I would like to see your blog script I've found
+at [[Tips|tips/blog_script]] page, but it seems that the URL
+(http://git.kitenet.net/?p=joey/home;a=blob_plain;f=bin/blog)
+to its Git repo is broken:
+
+ 403 Forbidden - No such project
+
+--[[Paweł|ptecza]]
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn b/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
index e30bf33e8..a1b5ba94a 100644
--- a/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
+++ b/doc/bugs/__96____96__clear:_both__39____39___for___96__.page__42____39____63__.mdwn
@@ -30,7 +30,6 @@ adding this `clear: both`?
>> Then sites could choose whether to set clear:both on the inlinefooter
>> or not, and this would be separate from the same styling on whole pages.
>>
->> Implemented in [my repository](http://git.debian.org/?p=users/smcv/ikiwiki.git);
->> see the "css" branch. --[[smcv]]
+>> [[done]] --[[smcv]]
[[patch]]
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index 6b49ec58d..4dc55e302 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -412,12 +412,13 @@ Aborts with an error message. If the second parameter is passed, it is a
function that is called after the error message is printed, to do any final
cleanup.
-Note that while any plugin can use this for a fatal error, plugins should
-try to avoid dying on bad input when building a page, as that will halt
-the entire wiki build and make the wiki unusable. So for example, if a
-[[ikiwiki/PreProcessorDirective]] is passed bad parameters, it's better to
-return an error message, which can appear on the wiki page, rather than
-calling error().
+If called inside a preprocess hook, error() does not abort the entire
+wiki build, but instead replaces the [[ikiwiki/PreProcessorDirective]] with
+a version containing the error message.
+
+In other hooks, error() is a fatal error, so use with care. Try to avoid
+dying on bad input when building a page, as that will halt
+the entire wiki build and make the wiki unusable.
#### `template($;@)`
diff --git a/doc/plugins/write/tutorial.mdwn b/doc/plugins/write/tutorial.mdwn
index 8b12fd183..94b72c763 100644
--- a/doc/plugins/write/tutorial.mdwn
+++ b/doc/plugins/write/tutorial.mdwn
@@ -169,7 +169,7 @@ be a guard on how high it will go.
}
my $num=$last{$page}++;
if ($num > 25) {
- return "[[fib will only calculate the first 25 numbers in the sequence]]";
+ error "can only calculate the first 25 numbers in the sequence";
}
return fib($num);
}
@@ -182,7 +182,7 @@ does for numbers less than 1. Or for any number that's not an integer. In
either case, it will run forever. Here's one way to fix that:
if (int($num) != $num || $num < 1) {
- return "[[fib positive integers only, please]]";
+ error "positive integers only, please";
}
As these security problems have demonstrated, even a simple input from the
diff --git a/doc/rcs/mercurial.mdwn b/doc/rcs/mercurial.mdwn
index 5eaae1997..b4baf07f4 100644
--- a/doc/rcs/mercurial.mdwn
+++ b/doc/rcs/mercurial.mdwn
@@ -2,7 +2,17 @@
system developed by Matt Mackall. Ikiwiki supports storing a wiki in a
mercurial repository.
-Ikiwiki can run as a post-update hook to update a wiki whenever commits
+Ikiwiki can run as a `post-commit` and/or `incoming` hook to update a wiki whenever commits or remote pushes
come in. When running as a [[cgi]] with Mercurial, ikiwiki automatically
commits edited pages, and uses the Mercurial history to generate the
[[RecentChanges]] page.
+
+Example for a `.hg/hgrc` file in `$SRCDIR`:
+
+ [hooks]
+ post-commit = /home/abe/bin/rebuildwiki
+ incoming = /home/abe/bin/rebuildwiki
+
+Do not use `commit` or `precommit` hooks or ikiwiki will run into a dead lock when committing in `$SRCDIR`
+
+See also [[todo/mercurial|todo/mercurial]]
diff --git a/doc/tips/blog_script.mdwn b/doc/tips/blog_script.mdwn
index b0f5f14c1..1dfd71538 100644
--- a/doc/tips/blog_script.mdwn
+++ b/doc/tips/blog_script.mdwn
@@ -1,4 +1,4 @@
-I have a [blog](http://git.kitenet.net/?p=joey/home;a=blob_plain;f=bin/blog)
+I have a [blog](http://git.kitenet.net/?p=joey/home.git;a=blob_plain;f=bin/blog)
program that I use to write blog posts in a text editor. The first line I
enter is used as the title, and it automatically comes up with a unique page
name based on the title and handles all the details of posting to my blog.
diff --git a/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn b/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
index 27d238ecd..b97c81efa 100644
--- a/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
+++ b/doc/todo/Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename.mdwn
@@ -75,5 +75,5 @@ a dedicated plugin, called `genealogictitle` or whatever, and :
>> Well, it seems I once more designed a solution before clearly
>> defining my problem... What I really need is more generic, can be
->> done as a plugin, and deserves its own todo item (yet to come), so
+>> done as a plugin, and deserves its own [[todo|pedigree_plugin]], so
>> I'm tagging this one wontfix^W [[done]]. I'm sorry. -- intrigeri
diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn
new file mode 100644
index 000000000..ac6eb8c51
--- /dev/null
+++ b/doc/todo/color_plugin.mdwn
@@ -0,0 +1,28 @@
+Recently I've wanted to colour some piece of text on my Ikiwiki page.
+It seems that Markdown can do it only using HTML tags, so I used
+&lt;span class="color"&gt;foo bar baz&lt;/span&gt;.
+
+However, in my opinion mixing Markdown syntax and HTML tags is rather ugly,
+so maybe we should create a new color plugin to add more color to Ikiwiki ;)
+I know that another Wikis have similar plugin, for example
+[WikiDot](http://www.wikidot.com/).
+
+I've noticed that htmlscrubber plugin strips `style` attribute, because of
+security, so probably we need to use `class` attribute of HTML. But then
+we have to customize our `local.css` file to add all color we want to use.
+It's not as easy in usage like color name or definition as plugin argument,
+but I don't have a better idea right now.
+
+What do you think about it? --[[Paweł|ptecza]]
+
+> Making a plugin preserve style attributes can be done, it just has to add
+> them after the sanitize step, which strips them. The general method is
+> adding placeholders first, and replacing them with the real html later.
+>
+> The hard thing to me seems to be finding a syntax that is better than a
+> `<span>`. A preprocessor directive is not really any less ugly than html
+> tags, though at least it could play nicely with nested markdown: --[[Joey]]
+>
+> \[[color red,green """
+> Xmas-colored markdown here
+> """]]
diff --git a/doc/todo/mercurial.mdwn b/doc/todo/mercurial.mdwn
index 0a1098f70..77b538c02 100644
--- a/doc/todo/mercurial.mdwn
+++ b/doc/todo/mercurial.mdwn
@@ -1,5 +1,3 @@
-* Need to get post commit hook working (or an example of how to use it.)
- * See below. --[[bma]]
* rcs_notify is not implemented (not needed in this branch --[[Joey]])
* Is the code sufficiently robust? It just warns when mercurial fails.
* When rcs_commit is called with a $user that is an openid, it will be
diff --git a/doc/todo/pedigree_plugin.mdwn b/doc/todo/pedigree_plugin.mdwn
new file mode 100644
index 000000000..8214385d2
--- /dev/null
+++ b/doc/todo/pedigree_plugin.mdwn
@@ -0,0 +1,76 @@
+After realizing (thanks to
+[[Allow_TITLE_to_include_part_of_the_path_in_addition_to_the_basename]])
+that I needed some kind of "parentlinks on steroids", I wrote a new
+plugin, called pedigree.
+
+This plugin provides a bunch of loops that one can use in his/her
+`HTML::Template`'s to iterate over all or a subset of a page's
+parents. Inside these loops, half a dozen variables are made
+available, in addition to `PAGE` and `URL` that are already provided
+by parentlinks.
+
+Amongst many possibilities, one can e.g. simply use this plugin to
+give every parent link a different `class=` attribute, depending
+either on its depth in the path leading to the current page, or on its
+distance to it.
+
+The code and documentation (including simple and complex usage
+examples) are in the 'pedigree' Git branch in this repo:
+
+ git://repo.or.cz/ikiwiki/intrigeri.git
+
+Seems there is also a [gitweb](http://repo.or.cz/w/ikiwiki/intrigeri.git).
+
+> Ok, I'll take a look. BTW, could you allow user joey on repo.or.cz
+> push access to the main ikiwiki repo you set up there? --[[Joey]]
+
+>> I did not. The main ikiwiki repo on repo.or.cz seems to have been
+>> been setup by johannes.schindelin@gmx.de ; mine is what they call
+>> a "fork" (but it's not, obviously).
+
+Any opinions on the idea/design/implementation?
+
+> Seems that there should be a more generic way to do `PEDIGREE_BUT_ROOT`
+> and `PEDIGREE_BUT_TWO_OLDEST` (also `is_second_ancestor`,
+> `is_grand_mother` etc). One way would be to include in `PEDIGREE`
+> a set of values like `depth_1`, `depth_2`, etc. The one corresponding
+> to the `absdepth` would be true. This would allow a template like this:
+
+ <TMPL_LOOP NAME="PEDIGREE">
+ <TMPL_IF NAME="depth_1">
+ </TMPL_ELSE>
+ <TMPL_IF NAME="depth_2">
+ </TMPL_ELSE>
+ <TMPL_VAR PAGE> /* only showing pages 2 levels deep */
+ </TMPL_IF>
+ </TMPL_IF>
+ </TMPL_LOOP>
+
+> The only missing information would be `reldepth`, but in the above
+> example the author of that template knows that it's `absdepth - 1`
+> (Things would be a lot nicer if `HTML::Template` had equality tests!)
+>
+> Since this would make it more generic and also fix your one documented
+> bug, I can see no reason not to do it. ;-) --[[Joey]]
+
+>> Thanks for your comments. I'll answer soon. (Grrr, I really
+>> need to find a way to edit this wiki offline, every minute
+>> online costs bucks to me, my old modem gently weeps,
+>> and I hate webbrowsers.) -- intrigeri
+
+(I'll try never to rebase this branch, but writing this plugin has
+been a pretext for me to start learning Git, so...)
+
+To finish with, it seems no plugin bundled with ikiwiki uses the current
+parentlinks implementation, so one could event think of moving it from the
+core to this plugin (which should then be enabled by default, since the
+default templates do use parentlinks ;).
+
+> I think that moving parentlinks out to a plugin is a good idea.
+> However, if it's done, I think the plugin should be named parentlinks,
+> and should continue to use the same template variables as are used now,
+> to avoid needing to change custom templates. Pedigree is a quite nice
+> name, but renaming it to parentlinks seems to be the way to go to me.
+> --[[Joey]]
+
+>> Agreed. -- intrigeri