]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/todo/admonitions.mdwn
fb3268c7d7e13d1a5f708b493c060f2e565c99a8
[git.ikiwiki.info.git] / doc / todo / admonitions.mdwn
1 In the [MoinMoin wiki][], there is this neat little hack called
2 [Admonitions][] that basically create a `<div>` block with a specific
3 style out of a certain section of the text.
5 I couldn't find a way to do this easily in Ikiwiki. On the one hand,
6 there is no easy way to create div blocks with arbitrary styles (which
7 is basically what MoinMoin admonitions are). On the other hand, there
8 are no neat little logos in stylesheets like there are in Moinmoin
9 either.
11 It would be great to see this implemented in Ikiwiki. Now, I know I
12 can make a `<div>` myself, but I am not sure we should encourage users
13 to inject arbitrary HTML in ikiwiki pages. And even then, we should
14 add adminition CSS classes to make that easier to use.
16 Ideally, Ikiwiki would support Pandoc or Github-style fenced blocks
17 and could abuse those to allow arbitrary styles (and markup!) to kick
18 in. The [[ikiwiki/directive/format]] directive could also be used, I
19 guess, but I dislike how it requires all those brackets and quotes and
20 bangs and all...
22 -- [[anarcat]]
24 [MoinMoin wiki]: https://moinmo.in/
25 [Admonitions]: https://moinmo.in/HelpOnAdmonitions
27 > ikiwiki's general design is that it supports exactly three forms
28 > of markup:
29 >
30 > * whatever the `htmlize` plugin does
31 > * as a special ikiwiki-specific extension, \[[wikilinks]]
32 > * as another special ikiwiki-specific extension, \[[!directives]]
33 >
34 > All markup interpretation beyond wikilinks and directives is
35 > the `htmlize` plugin's responsibility. The `mdwn` plugin
36 > interprets Markdown, the `rst` plugin interprets
37 > reStructuredText and so on.
38 >
39 > It sounds as though you're asking for a `htmlize` plugin which
40 > interprets an extended dialect of Markdown:
41 >
42 > * standard Markdown (inasmuch as such a thing exists) as usual
43 > * mapping certain syntax (what?) to "admonitions"
44 >
45 > ikiwiki deliberately doesn't implement Markdown parsing, it just
46 > calls out to one of several Perl implementations of Markdown.
47 >
48 > Alternatively, you could have a small plugin that translates
49 >
50 >     [[!warning "Do what I say, not as I do."]]
51 >
52 > into an appropriate `<div>`. That's the "lightest" form of
53 > markup that is built into ikiwiki itself.
54 >
55 > Alternatively^2, some different hook (I think [[plugins/typography]]
56 > might use the right one?) could interpret an ad-hoc syntax and
57 > turn it into a `<div>` either before or after `htmlize` processing.
58 > However, that would be adding an extra layer of syntax for your
59 > users to keep track of.
60 >
61 > [[templates|ikiwiki/directive/template]] are another way this could
62 > work:
63 >
64 >     \[[!template id=warning text="Do as I say, not as I do."]]
65 >
66 > There's a "note" template bundled with ikiwiki already.
67 >
68 > --[[smcv]]