]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/album/discussion.mdwn
a613bb2d232ed4f3d086aef4a706f575b6be575d
[ikiwiki.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.
2
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]]
8
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?
10
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]]
22
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?
24
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]]
48
49 i'm new to ikiwiki, apologies if this is dealt with elsewhere.  -brush
50
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]]
54
55 ----
56
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]] 
59
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.
64
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
70
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!
74
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
78
79 * And doesn't each viewer page really depend on every other page in the
80   same albumsection? If a new page is added, the next/prev links
81   may need to be updated, for example. If so, there will be much
82   unnecessary rebuilding.
83
84 > albumsections are just a way to insert headings into the flow of
85 > photos, so they don't actually affect dependencies.
86 >
87 > One non-obvious constraint of ikiwiki's current design is that
88 > everything "off-page" necessary to build any page has to happen
89 > at scan time, which has caused a few strange design decisions,
90 > like the fact that each viewer controls what album it's in.
91 >
92 > It's difficult for the contents of the album to just be a
93 > pagespec, like for inline, because pagespecs can depend on
94 > metadata, which is gathered in arbitrary order at scan time;
95 > so the earliest you can safely apply a pagespec to the wiki
96 > contents to get a concrete list of pages is at rebuild time.
97 >
98 > (This stalled my attempt at a trail plugin, too.) -s
99
100 * One thing I do like about having individual pages per image is
101   that they can each have their own comments, etc.
102
103 > Yes; also, they can be wikilinked. I consider those to be
104 > UI requirements. -s
105
106 * Seems possibly backwards that the albumimage controls what album
107   an image appears in. Two use cases -- 1: I may want to make a locked
108   album, but then anyone who can write to any other page on the wiki can
109   add an image to it. 2: I may want an image to appear in more than one
110   album. Think tags. So it seems it would be better to have the album
111   directive control what pages it includes (a la inline).
112
113 > See note above about pagespecs not being very safe early on.
114 > You did merge my inline-with-pagenames feature, which is safe to use
115 > at scan time, though.
116
117 * Putting a few of the above thoughts together, my ideal album system
118   seems to be one where I can just drop the images into a directory and
119   have them appear in the album index, as well as each generate their own wiki
120   page. Plus some way I can, later, edit metadata for captions,
121   etc. (Real pity we can't just put arbitrary metadata into the images
122   themselves.) This is almost pointing toward making the images first-class
123   wiki page sources. Hey, it worked for po! :) But the metadata and editing
124   problems probably don't really allow that.
125
126 > Putting a JPEG in the web form is not an option from my point of
127 > view :-) but perhaps there could just be a "web-editable" flag supplied
128 > by plugins, and things could be changed to respect it.
129 >
130 > In a way, what you really want for metadata is to have it in the album
131 > page, so you can batch-edit the whole lot by editing one file (this
132 > does mean that editing the album necessarily causes each of its viewers
133 > to be rebuilt, but in practice that happens anyway). -s
134
135 ----
136
137 Trying to use the "special extension" design:
138
139 Suppose that each viewer is a JPEG-or-GIF-or-something, with extension
140 ".albumimage". We have a gallery "memes" with three images, badger,
141 mushroom and snake.
142
143 Files in git repo:
144
145 * index.mdwn
146 * memes.mdwn
147 * memes/badger.albumimage (a renamed JPEG)
148 * memes/badger/comment_1._comment
149 * memes/badger/comment_2._comment
150 * memes/mushroom.albumimage (a renamed GIF)
151 * memes/mushroom.meta (sidecar file with metadata)
152 * memes/snake.albumimage (a renamed video)
153
154 Files in web content:
155
156 * index.html
157 * memes/index.html
158 * memes/96x96-badger.jpg (from img)
159 * memes/96x96-mushroom.jpg (from img)
160 * memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) )
161 * memes/badger/index.html (including comments)
162 * memes/badger.jpg
163 * memes/mushroom/index.html
164 * memes/mushroom.gif
165 * memes/snake/index.html
166 * memes/snake.mov
167
168 ispage("memes/badger") (etc.) must be true, to make the above rendering
169 happen, so albumimage needs to be a "page" extension.
170
171 To not confuse other plugins, album should probably have a filter() hook
172 that turns .albumimage files into HTML? That'd probably be a reasonable
173 way to get them rendered anyway.
174
175 do=edit&page=memes/badger needs to not put the JPG in a text box: somehow
176 divert or override the normal edit CGI by telling it that .albumimage
177 files are not editable in the usual way?
178
179 Every image needs to depend on, and link to, the next and previous images,
180 which is a bit tricky. In previous thinking about this I'd been applying
181 the overly strict constraint that the ordered sequence of pages in each
182 album must be known at scan time. However, that's not *necessarily* needed:
183 the album and each photo could collect an unordered superset of dependencies
184 at scan time, and at rebuild time that could be refined to be the exact set,
185 in order. Perhaps restricting to "the images in an album A must match A/*"
186 would be useful; then the unordered superset could just be "A/*". Your
187 "albums via tags" idea would be nice too though, particularly for feature
188 parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()"
189 maybe?
190
191 If images are allowed to be considered to be part of more than one album,
192 then a pretty and usable UI becomes harder - "next/previous" expands into
193 "next photo in holidays/2009/germany / next photo in tagged/smcv / ..."
194 and it could get quite hard to navigate. Perhaps next/previous links could
195 be displayed only for the closest ancestor (in URL space) that is an
196 album, or something?
197
198 Requiring renaming is awkward for non-technical Windows/Mac users, with both
199 platforms' defaults being to hide extensions; however, this could be
200 circumvented by adding some sort of hook in attachment to turn things into
201 a .albumimage at upload time, and declaring that using git/svn/... without
202 extensions visible is a "don't do that then" situation :-)
203
204 Ideally attachment could also be configured to upload into a specified
205 underlay, so that photos don't have to be in your source-code control
206 (you might want that, but I don't!).
207
208 Things that would be nice, and are probably possible:
209
210 * make the "Edit page" link on viewers divert to album-specific CGI instead
211   of just failing or not appearing
212 * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a
213   priori that it's secretly a JPEG