]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/conditional_underlay_files.mdwn
move the patch into my repository
[ikiwiki.git] / doc / todo / conditional_underlay_files.mdwn
1 I'd like to see some way to include certain files from the underlay only when the wiki has certain plugins enabled.  For example:
2
3 * Only include smileys.mdwn and the smileys subdirectory if you enable the [[plugins/smiley]] plugin.
4 * Exclude openid.mdwn if you disable the [[plugins/openid]] plugin.
5 * Include shortcuts.mdwn only if you enable the [[plugins/shortcut]] plugin.
6 * Include blog.mdwn only if you don't disable the [[plugins/inline]] plugin.
7 * Include favicon.ico only if you enable the [[plugins/favicon]] plugin.
8 * Include wikiicons/diff.png (and the wikiicons directory) only if you enable the CGI.
9 * Include a hypothetical restructuredtexthelp.rst or similar for other formats only with those formats enabled.
10
11 I can see two good ways to implement this.  Ideally, with
12 [[conditional_text_based_on_ikiwiki_features]] available, ikiwiki could
13 parse a page like conditionalpages.mdwn, which could contain a set of
14 conditional-wrapped page names; that seems like the most elegant and
15 ikiwiki-like approach.  Alternatively, ikiwiki.setup could contain a
16 Perl-generated exclude option by default; that would work, but it seems
17 hackish.
18
19 > Another way might be to have a third directory of source files where
20 > plugins could drop in pages, and only build the files from there if their
21 > plugins were enabled.
22
23 > Using the conditionals in a page to control what other pages get built
24 > feels complex to me.
25
26 > Instead, this has been implmented as the `add_underlay()` function.
27 > [[done]]
28 > --[[Joey]]
29