]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/plugins/contrib/album/discussion.mdwn
Merge branch 'master' into dependency-types
[git.ikiwiki.info.git] / doc / plugins / contrib / album / discussion.mdwn
1 thanks for this plugin.  it might help me in my application, which is to provide album/galleries which can be edited (ie. new images added, taken away, etc.) through web interface.
3 > That's my goal eventually, too. Perhaps you can help to
4 > design/write this plugin? At the moment I'm mostly
5 > waiting for a design "sanity check" from [[Joey]],
6 > but any feedback you can provide on the design would
7 > also be helpful. --[[smcv]]
9 i have two challenges: firstly, for installation, i'm not sure what all the files are that need to be downloaded (because of my setup i can't easily pull the repo).  so far i have Ikiwiki/Plugins/album.pm; ikiwiki-album; and 4 files in templates/  any others?
11 > Those are all the added files; ikiwiki-album isn't strictly
12 > needed (IkiWiki itself doesn't use that code, but you can
13 > use it to turn a directory full of images into correct
14 > input for the album plugin).
15 >
16 > You probably also want the album plugin's expanded version of
17 > style.css (or put its extra rules in your local.css).
18 > Without that, your albums will be quite ugly.
19 >
20 > There aren't currently any other files modified by my branch.
21 > --[[smcv]]
23 secondly: barring the CGI interface for editing the album, which would be great, is there at least a way to use attachment plugin or any other to manually add images and then create viewers for them?
25 > Images are just attachments, and viewers are pages (any supported
26 > format, but .html will be fastest to render). Attach each image,
27 > then write a page for each image containing the
28 > \[[!albumimage]] directive (usually it will *only* contain that
29 > directive).
30 >
31 > The script ikiwiki-album can help you to do this in a git/svn/etc.
32 > tree; doing it over the web will be a lot of work (until I get
33 > the CGI interface written), but it should already be possible!
34 >
35 > The structure is something like this:
36
37 > * album.mdwn (contains the \[[!album]] directive, and perhaps also
38 >   some \[[!albumsection]] directives)
39 > * album/a.jpg
40 > * album/a.html (contains the \[[!albumimage]] directive for a.jpg)
41 > * album/b.jpg
42 > * album/b.html (contains the \[[!albumimage]] directive for b.jpg)
43 >
44 > Have a look at ikiwiki-album to see how the directives are meant to
45 > work in practice.
46 >
47 > --[[smcv]]
49 i'm new to ikiwiki, apologies if this is dealt with elsewhere.  -brush
51 > This plugin is pretty ambitious, and is unfinished, so I'd recommend
52 > playing with  a normal IkiWiki installation for a bit, then trying
53 > out this plugin when you've mastered the basics of IkiWiki. --[[smcv]]
55 ----
57 You had wanted my feedback on the design of this. I have not looked at the
58 code or tried it yet, but here goes. --[[Joey]] 
60 * Needing to create the albumimage "viewer" pages for each photo
61   seems like it will become a pain. Everyone will need to come up
62   with their own automation for it, and then there's the question
63   of how to automate it when uploading attachments.
65 > There's already a script (ikiwiki-album) to populate a git
66 > checkout with skeleton "viewer" pages; I was planning to make a
67 > specialized CGI interface for albums after getting feedback from
68 > you (since the requirements for that CGI interface change depending
69 > on the implementation). I agree that this is ugly, though. -s
71 * With each viewer page having next/prev links, I can see how you
72   were having the scalability issues with ikiwiki's data structures
73   earlier!
75 > Yeah, I think they're a basic requirement from a UI point of view
76 > though (although they don't necessarily have to be full wikilinks).
77 > -s
79 >> I think that with the new dependency types system, the dependencies for
80 >> these can be presence dependencies, which will probably help with
81 >> avoiding rebuilds of a page if the next/prev page is changed.
82 >> (Unless you use img to make the thumbnails for those links, then it
83 >> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]] 
85 * And doesn't each viewer page really depend on every other page in the
86   same albumsection? If a new page is added, the next/prev links
87   may need to be updated, for example. If so, there will be much
88   unnecessary rebuilding.
90 > albumsections are just a way to insert headings into the flow of
91 > photos, so they don't actually affect dependencies.
92 >
93 > One non-obvious constraint of ikiwiki's current design is that
94 > everything "off-page" necessary to build any page has to happen
95 > at scan time, which has caused a few strange design decisions,
96 > like the fact that each viewer controls what album it's in.
97 >
98 > It's difficult for the contents of the album to just be a
99 > pagespec, like for inline, because pagespecs can depend on
100 > metadata, which is gathered in arbitrary order at scan time;
101 > so the earliest you can safely apply a pagespec to the wiki
102 > contents to get a concrete list of pages is at rebuild time.
104 > (This stalled my attempt at a trail plugin, too.) -s
106 >> Not sure I understand why these need to look at pagespecs at scan time?
107 >> Also, note that it is fairly doable to detect if a pagespec uses such
108 >> metadata. Er, I mean, I have a cheezy hack in `add_depends` now that does
109 >> it to deal with a similar case. --[[Joey]] 
111 * One thing I do like about having individual pages per image is
112   that they can each have their own comments, etc.
114 > Yes; also, they can be wikilinked. I consider those to be
115 > UI requirements. -s
117 * Seems possibly backwards that the albumimage controls what album
118   an image appears in. Two use cases -- 1: I may want to make a locked
119   album, but then anyone who can write to any other page on the wiki can
120   add an image to it. 2: I may want an image to appear in more than one
121   album. Think tags. So it seems it would be better to have the album
122   directive control what pages it includes (a la inline).
124 > See note above about pagespecs not being very safe early on.
125 > You did merge my inline-with-pagenames feature, which is safe to use
126 > at scan time, though.
128 * Putting a few of the above thoughts together, my ideal album system
129   seems to be one where I can just drop the images into a directory and
130   have them appear in the album index, as well as each generate their own wiki
131   page. Plus some way I can, later, edit metadata for captions,
132   etc. (Real pity we can't just put arbitrary metadata into the images
133   themselves.) This is almost pointing toward making the images first-class
134   wiki page sources. Hey, it worked for po! :) But the metadata and editing
135   problems probably don't really allow that.
137 > Putting a JPEG in the web form is not an option from my point of
138 > view :-) but perhaps there could just be a "web-editable" flag supplied
139 > by plugins, and things could be changed to respect it.
141 > In a way, what you really want for metadata is to have it in the album
142 > page, so you can batch-edit the whole lot by editing one file (this
143 > does mean that editing the album necessarily causes each of its viewers
144 > to be rebuilt, but in practice that happens anyway). -s
146 >> Yes, that would make some sense.. It also allows putting one image in
147 >> two albums, with different caption etc. (Maybe for different audiences.)
148 >>
149 >> It would probably be possible to add a new dependency type, and thus
150 >> make ikiwiki smart about noticing whether the metadata has actually
151 >> changed, and only update those viewers where it has. But the dependency
152 >> type stuff is still very new, and not plugin friendly .. so only just
153 >> possible, --[[Joey]] 
155 ----
157 Trying to use the "special extension" design:
159 Suppose that each viewer is a JPEG-or-GIF-or-something, with extension
160 ".albumimage". We have a gallery "memes" with three images, badger,
161 mushroom and snake.
163 > An alternative might be to use ".album.jpg", and ".album.gif"
164 > etc as the htmlize extensions. May need some fixes to ikiwiki to support
165 > that. --[[Joey]] 
167 Files in git repo:
169 * index.mdwn
170 * memes.mdwn
171 * memes/badger.albumimage (a renamed JPEG)
172 * memes/badger/comment_1._comment
173 * memes/badger/comment_2._comment
174 * memes/mushroom.albumimage (a renamed GIF)
175 * memes/mushroom.meta (sidecar file with metadata)
176 * memes/snake.albumimage (a renamed video)
178 Files in web content:
180 * index.html
181 * memes/index.html
182 * memes/96x96-badger.jpg (from img)
183 * memes/96x96-mushroom.jpg (from img)
184 * memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) )
185 * memes/badger/index.html (including comments)
186 * memes/badger.jpg
187 * memes/mushroom/index.html
188 * memes/mushroom.gif
189 * memes/snake/index.html
190 * memes/snake.mov
192 ispage("memes/badger") (etc.) must be true, to make the above rendering
193 happen, so albumimage needs to be a "page" extension.
195 To not confuse other plugins, album should probably have a filter() hook
196 that turns .albumimage files into HTML? That'd probably be a reasonable
197 way to get them rendered anyway.
199 > I guess that is needed to avoid preprocess, scan, etc trying to process
200 > the image, as well as eg, smiley trying to munge it in sanitize.
201 > --[[Joey]] 
203 do=edit&page=memes/badger needs to not put the JPG in a text box: somehow
204 divert or override the normal edit CGI by telling it that .albumimage
205 files are not editable in the usual way?
207 Every image needs to depend on, and link to, the next and previous images,
208 which is a bit tricky. In previous thinking about this I'd been applying
209 the overly strict constraint that the ordered sequence of pages in each
210 album must be known at scan time. However, that's not *necessarily* needed:
211 the album and each photo could collect an unordered superset of dependencies
212 at scan time, and at rebuild time that could be refined to be the exact set,
213 in order.
215 > Why do you need to collect this info at scan time? You can determine it
216 > at build time via `pagespec_match_list`, surely .. maybe with some
217 > memoization to avoid each image in an album building the same list.
218 > I sense that I may be missing a subtelty though. --[[Joey]] 
220 Perhaps restricting to "the images in an album A must match A/*"
221 would be useful; then the unordered superset could just be "A/*". Your
222 "albums via tags" idea would be nice too though, particularly for feature
223 parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()"
224 maybe?
226 If images are allowed to be considered to be part of more than one album,
227 then a pretty and usable UI becomes harder - "next/previous" expands into
228 "next photo in holidays/2009/germany / next photo in tagged/smcv / ..."
229 and it could get quite hard to navigate. Perhaps next/previous links could
230 be displayed only for the closest ancestor (in URL space) that is an
231 album, or something?
233 > Ugh, yeah, that is a problem. Perhaps wanting to support that was just
234 > too ambitious. --[[Joey]] 
236 Requiring renaming is awkward for non-technical Windows/Mac users, with both
237 platforms' defaults being to hide extensions; however, this could be
238 circumvented by adding some sort of hook in attachment to turn things into
239 a .albumimage at upload time, and declaring that using git/svn/... without
240 extensions visible is a "don't do that then" situation :-)
242 > Or extend `pagetype` so it can do the necessary matching without
243 > renaming. Maybe by allowing a subdirectory to be specified along
244 > with an extension. (Or allow specifying a full pagespec,
245 > but I hesitate to seriously suggest that.) --[[Joey]] 
247 Ideally attachment could also be configured to upload into a specified
248 underlay, so that photos don't have to be in your source-code control
249 (you might want that, but I don't!).
251 Things that would be nice, and are probably possible:
253 * make the "Edit page" link on viewers divert to album-specific CGI instead
254   of just failing or not appearing
255 * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a
256   priori that it's secretly a JPEG