My repository contains image sources made with tools like Inkspace, Dia, LibreOffice, Gimp and so on.
Instead of pushing the images themselves into git or manually exporting them to PNG/SVG,
I'd like to keep just the sources in git, and have ikiwiki compile them into the final
images just like it compiles Markdown into HTML. Is it possible to add new files types
and tell ikiwiki how to compile them?
(After reading some plugin docs...)
I just read 'perlintro' yesterday in unrelated context, but... could it maybe be done by writing a plugin like this one, which compiles textile?
-- fr33domlover
Several plugins process data using external programs. You may have a look at:
The first and second plugins I mentionned create an image using an external tool, and integrate it in the page. It may be exactly what you want.
-- Louis
Thanks, I already saw those.
I need a plugin of exactly the same kind, but which calls other tools, such as Dia and Inkspace.
In addition, embedding into a page means the same image may end up being generated
many times. So it's best to generate the image as an attachment of some page, and then
all other pages in the wiki can use it. What do you think?
Also, if I write a plugin (and test it of course), where do I publish it so people can
see and enjoy it? Is plugins moderated?
-- fr33domlover
Then the pandoc may be a good start, since you can configure it for Pandoc to take over processing of all .mkdn files, or only files with a different extension. Have a look at it to make your plugin process files with a particular extension. Then, it will be possible to have several pages refer to the same file, generated only once (maybe by storing stuff in
%pagestate
or%wikistate
.Have a look at write to write your plugin.
What is usually done is:
you advertise your plugin by creating a subpage of contrib. Use the plugin template (it generates the frame you can see on the right of one of my plugins, for example):
-- Louis
Great, thanks. I'll take a look. But it's a bit different, because images are not HTML pages at all.
Thanks for the quick replies
Hello, I enventually wrote a plugin that might fit your need: compile.
In setup file, you specify which command is to be applied to files. For instance, to convent
odt
files topdf
, you can use:Then, in your wiki pages, you can use
\[[!compile files="foo.odt"]]
. This will convert file to pdf, and render as a link to thepdf
file. If optioninline
is set, you can also simply use a wikilink[[foo.odt]]
, which will have the same effect.The only problem I see is that when linking several times to the same file, it will be compiled several times. I marked it as a feature request to the plugin.
Regards,
-- Louis