X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/1e6dd2fc3761e071a4c3b65ea99022ac006e7a6d..2de20bf48b4a0c215c58b28b2ec789d65a4fb4e8:/doc/users/smcv/gallery.mdwn?ds=inline diff --git a/doc/users/smcv/gallery.mdwn b/doc/users/smcv/gallery.mdwn index 5b4c6fe00..d80fc3ba1 100644 --- a/doc/users/smcv/gallery.mdwn +++ b/doc/users/smcv/gallery.mdwn @@ -1,8 +1,5 @@ -[[!template id=plugin name=smcvgallery author="[[Simon_McVittie|smcv]]"]] -[[!tag type/chrome]] - -This plugin has not yet been written; this page is an experiment in -design-by-documentation :-) +This plugin has now been implemented as [[plugins/contrib/album]]; this +page has older thoughts about it. ## Requirements @@ -89,12 +86,15 @@ could look something like this: The next/previous part this plugin overlaps with [[todo/wikitrails]]. -A \[[!galleryimg]] directive to assign metadata to images is probably necessary, so +A \[[!galleryimg]] directive to assign metadata to images might be necessary, so the gallery page can contain something like: \[[!galleryimg p1010001.jpg title="..." caption="..." tags="foo"]] \[[!galleryimg p1010002.jpg title="..." caption="..." tags="foo bar"]] +However, allowing other pages to push in metadata like that will make +dependency tracking difficult. + Making the viewer pages could be rather tricky. Here are some options: "synthesize source pages for viewers" is the one I'm leaning towards at the moment. @@ -105,12 +105,24 @@ One possibility is to write out the viewer pages as a side-effect of preprocessing the \[[!gallery]] directive. The proof-of-concept implementation below does this. However, this does mean the viewer pages can't have tags or metadata of their own and can't be matched by [[pagespecs|ikiwiki/pagespec]] or -[[wikilinks|ikiwiki/wikilink]]. It might be possible to implement tagging by -using \[[!galleryimg]] to assign the metadata to the *images* instead of their -viewers. +[[wikilinks|ikiwiki/wikilink]]. + +It might be possible to implement tagging by using \[[!galleryimg]] to assign +the metadata to the *images* instead of their viewers; however, that would +require hacking up both `IkiWiki::htmllink` and `IkiWiki::urlto` to redirect +links to the image (e.g. from the \[[!map]] on a tag page) to become links to +the viewer page. + +Modifications to the comments plugin would also be required, to make it allow +comments written to `foo/bar/comment_1._comment` even though the page foo/bar +does not really exist, and display comments on the viewer pages even though +they're not real pages. (Writing comments to `foo/bar.jpg/*._comment` is not +an option!) ### Synthesize source pages for viewers +(Edited to add: this is what [[plugins/contrib/album]] implements. --[[smcv]]) + Another is to synthesize source pages for the viewers. This means they can have tags and metadata, but trying to arrange for them to be scanned etc. correctly without needing another refresh run is somewhat terrifying. @@ -132,6 +144,10 @@ in that directory during the refresh hook. The source pages could be in the underlay until they are edited (e.g. tagged), at which point they would be copied into the source-code-controlled version in the usual way. +> Coming back to this: a specialized web UI to mark attachments as part of +> the gallery would make this easy too - you'd put the photos in the +> underlay, then go to the CGI and say "add all". --[[smcv]] + The synthetic source pages can be very simple, using the same trick as my [[plugins/comments]] plugin (a dedicated [[directive|ikiwiki/directives]] encapsulating everything the plugin needs). If the plugin automatically @@ -140,6 +156,9 @@ only the human-edited information and a filename reference need to be present in the source page; with some clever lookup rules based on the filename of the source page, not even the photo's filename is necessarily needed. +> Coming back to this later: the clever lookup rules make dependency tracking +> hard, though. --[[smcv]] + \[[!meta title="..."]] \[[!meta date="..."]] \[[!meta copyright="..."]]