From ca02c57ee47d4c05946c0c34eee32a0ad4ec6b01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 14:07:12 -0400 Subject: document add_autofile --- doc/plugins/write.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'doc') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 0bf6fcf48..e33c99421 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -966,6 +966,22 @@ added. Pass it the page that contains the link, and the link text. An optional third parameter sets the link type. If not specified, it is an ordinary [[ikiwiki/WikiLink]]. +### `add_autofile($$$)` + +Sometimes you may want to add a file to the `srcdir`. For example, +[[plugins/tag]] pages can be automatically created as needed. This function +can be used to do that. + +The three parameters are the filename to add, the name of the plugin, +and a callback function. The callback will be called if it is appropriate +to automatically add the file, and should then take care of creating it, +and doing anything else it needs to (such as checking it into revision +control). Note that the callback may not always be called. For example, +if an automatically added file is deleted by the user, ikiwiki will avoid +re-adding it again. + +This function needs to be called during the scan hook, or earlier to work. + ## Miscellaneous ### Internal use pages -- cgit v1.2.3 From 59ceeb5621ae0ae2bcb7501c6ac0c7a06562a7cc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Apr 2010 17:15:07 -0400 Subject: improve docs --- doc/plugins/write.mdwn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index e33c99421..5190a26ed 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -968,9 +968,9 @@ it is an ordinary [[ikiwiki/WikiLink]]. ### `add_autofile($$$)` -Sometimes you may want to add a file to the `srcdir`. For example, -[[plugins/tag]] pages can be automatically created as needed. This function -can be used to do that. +Sometimes you may want to add a file to the `srcdir` as a result of content +of other pages. For example, [[plugins/tag]] pages can be automatically +created as needed. This function can be used to do that. The three parameters are the filename to add, the name of the plugin, and a callback function. The callback will be called if it is appropriate @@ -980,7 +980,8 @@ control). Note that the callback may not always be called. For example, if an automatically added file is deleted by the user, ikiwiki will avoid re-adding it again. -This function needs to be called during the scan hook, or earlier to work. +This function needs to be called during the scan hook, or earlier in the +build process, in order to add the file early enough for it to be built. ## Miscellaneous -- cgit v1.2.3 From 9c8761ba49b06a76a923eb91735f842f419d2916 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 14:27:12 -0400 Subject: add_autofile filename should be relative to srcdir --- doc/plugins/write.mdwn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 5190a26ed..404c3b44f 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -972,13 +972,13 @@ Sometimes you may want to add a file to the `srcdir` as a result of content of other pages. For example, [[plugins/tag]] pages can be automatically created as needed. This function can be used to do that. -The three parameters are the filename to add, the name of the plugin, -and a callback function. The callback will be called if it is appropriate -to automatically add the file, and should then take care of creating it, -and doing anything else it needs to (such as checking it into revision -control). Note that the callback may not always be called. For example, -if an automatically added file is deleted by the user, ikiwiki will avoid -re-adding it again. +The three parameters are the filename to create (relative to the `srcdir`), +the name of the plugin, and a callback function. The callback will be +called if it is appropriate to automatically add the file, and should then +take care of creating it, and doing anything else it needs to (such as +checking it into revision control). Note that the callback may not always +be called. For example, if an automatically added file is deleted by the +user, ikiwiki will avoid re-adding it again. This function needs to be called during the scan hook, or earlier in the build process, in order to add the file early enough for it to be built. -- cgit v1.2.3 From 204c0a63f3fd7673dac83da6aa5f9c9e3cc9a6c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 15:22:05 -0400 Subject: document tag_autocreate --- doc/plugins/tag.mdwn | 3 +++ doc/roadmap.mdwn | 1 + 2 files changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index 8ff70a069..bdf39d7e8 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,6 +8,9 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. +If the `tag_autocreate` setting is enabled, tag pages will automatically be +created as needed. + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 0c7bf2fa8..8e2a01827 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -78,6 +78,7 @@ Probably incomplete list: * Make pagespecs match relative by default? (see [[discussion]]) * Flip wikilinks? (see [[todo/link_plugin_perhaps_too_general?]]) * YADA format setup files per default? +* Enable `tag_autocreate` by default. In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that -- cgit v1.2.3 From d048e9c64aca24b8e064aaf1608862b50c427de2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 20:39:20 -0400 Subject: turn on tag_autocreate by default if tagbase is set --- doc/ikiwiki/directive/tag.mdwn | 3 ++- doc/plugins/tag.mdwn | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/ikiwiki/directive/tag.mdwn b/doc/ikiwiki/directive/tag.mdwn index 807a96f25..c8d9b9816 100644 --- a/doc/ikiwiki/directive/tag.mdwn +++ b/doc/ikiwiki/directive/tag.mdwn @@ -19,7 +19,8 @@ instead: Note that if the wiki is configured to use a tagbase, then the tags will be located under a base directory, such as "tags/". This is a useful way to avoid having to write the full path to tags, if you want to keep them -grouped together out of the way. +grouped together out of the way. Also, since ikiwiki then knows where to put +tags, it will automatically create tag pages when new tags are used. Bear in mind that specifying a tagbase means you will need to incorporate it into the `link()` [[ikiwiki/PageSpec]] you use: e.g., if your tagbase is diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index bdf39d7e8..8e1286e62 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -8,8 +8,12 @@ These directives allow tagging pages. It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to match pages that are tagged with a specific tag. -If the `tag_autocreate` setting is enabled, tag pages will automatically be -created as needed. +The `tagbase` setting can be used to make tags default to being put in a +particular subdirectory. + +The `tag_autocreate` setting can be used to control whether new tag pages +are created as needed. It defaults to being done only if a `tagbase` is +set. [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this -- cgit v1.2.3 From 17a89d3d19f3a04ca2686ff18df127e5afaf9577 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Apr 2010 21:57:12 -0400 Subject: update --- doc/plugins/tag/discussion.mdwn | 1 + doc/todo/auto-create_tag_pages_according_to_a_template.mdwn | 2 ++ 2 files changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/plugins/tag/discussion.mdwn b/doc/plugins/tag/discussion.mdwn index 03dcb7b2f..dfd749252 100644 --- a/doc/plugins/tag/discussion.mdwn +++ b/doc/plugins/tag/discussion.mdwn @@ -28,3 +28,4 @@ See [[todo/auto-create tag pages according to a template]] -- Jeremy Schultz +`tag_autocreate` can now enable this. --[[Joey]] 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 32870dd3d..1e0a910f4 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 @@ -247,3 +247,5 @@ I've tested it somewhat. --[[Joey]] [da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0 (commitdiff for da5d29f95f6e693e8c14be1b896cf25cf4fdb3c0) [a358d74bef51dae31332ff27e897fe04834571e6]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=a358d74bef51dae31332ff27e897fe04834571e6 (commitdiff for a358d74bef51dae31332ff27e897fe04834571e6) [981400177d68a279f485727be3f013e68f0bf691]: http://git.liegesta.at/?p=ikiwiki.git;a=commitdiff;h=981400177d68a279f485727be3f013e68f0bf691 (commitdiff for 981400177d68a279f485727be3f013e68f0bf691) + +[[!tag done]] -- cgit v1.2.3